1/*
2 *  IOFireWireLibCoalesceTree.h
3 *  IOFireWireFamily
4 *
5 *  Created by Niels on Fri Mar 14 2003.
6 *  Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
7 *
8 *	$Log: IOFireWireLibCoalesceTree.h,v $
9 *	Revision 1.2  2003/07/21 06:53:10  niels
10 *	merge isoch to TOT
11 *
12 *	Revision 1.1.2.1  2003/07/01 20:54:23  niels
13 *	isoch merge
14 *
15 */
16
17#import <IOKit/IOKitLib.h>
18
19namespace IOFireWireLib {
20
21	// ============================================================
22	//
23	// CoalesceTree
24	//
25	// ============================================================
26
27	class CoalesceTree
28	{
29		struct Node
30		{
31			Node*				left ;
32			Node*				right ;
33			IOVirtualRange		range ;
34		} ;
35
36		public:
37
38			CoalesceTree() ;
39			~CoalesceTree() ;
40
41		public:
42
43			void	 			CoalesceRange(const IOVirtualRange& inRange) ;
44			const UInt32	 	GetCount() const ;
45			void			 	GetCoalesceList(IOVirtualRange* outRanges) const ;
46
47		protected:
48
49			void				DeleteNode(Node* inNode) ;
50			void				CoalesceRange(const IOVirtualRange& inRange, Node* inNode) ;
51			const UInt32		GetCount(Node* inNode) const ;
52			void				GetCoalesceList(IOVirtualRange* outRanges, Node* inNode, UInt32* pIndex) const ;
53
54		protected:
55
56			Node *	mTop ;
57	} ;
58
59} // namespace
60