M
Mitchel Haas
Hello,
Feeling a need for a generic tree container to supplement the available
containers in the STL,
I've created a generic tree container library (TCL). The library usage is
very much like the containers in the STL, including iterator usage.
Info on the library can be found here..
http://www.visuallandlord.com/developers_corner/open_source/tree_container_library/overview.php
The library and sample code can be downloaded from this site also.
The TCL is open source, and has been thoroughly tested,
but still needs a workout to reveal possible remaining bugs.
Currently it compiles on VC 7 and gcc.
The library is certainly no matching quality to that of the STL or BOOST.
It's purpose is to simply to provide a dependable tree type container
storage.
The library offers three flavors of tree containers:
tree<> : every child within a given parent must be unique
multitree<>: duplicates can exist within a given parent
unique_tree<>: no duplicates can exist within the entire tree structure.
All nodes in the tree must be unique. The unique_tree offers
a handy insert operation of the form insert(parent, child).
In the unique_tree, orphans may be enabled or disabled.
Enabling orphans allows the insertion of nodes in an order
where the parent isn't guarenteed to be present before one
of it's children are inserted.
All three tree classes are derived from a base class, basic_tree<>.
Standard node iterators are provided for iterating children within a parent.
Special "descendent" iterators are avalilable to traverse children and
descendents of nodes:
pre_order_iterator, post_order_iterator, and level_order_iterator.
I'd welcome any feedback, questions, comments, or suggestions regarding the
library.
Thanks,
Mitch Haas
Feeling a need for a generic tree container to supplement the available
containers in the STL,
I've created a generic tree container library (TCL). The library usage is
very much like the containers in the STL, including iterator usage.
Info on the library can be found here..
http://www.visuallandlord.com/developers_corner/open_source/tree_container_library/overview.php
The library and sample code can be downloaded from this site also.
The TCL is open source, and has been thoroughly tested,
but still needs a workout to reveal possible remaining bugs.
Currently it compiles on VC 7 and gcc.
The library is certainly no matching quality to that of the STL or BOOST.
It's purpose is to simply to provide a dependable tree type container
storage.
The library offers three flavors of tree containers:
tree<> : every child within a given parent must be unique
multitree<>: duplicates can exist within a given parent
unique_tree<>: no duplicates can exist within the entire tree structure.
All nodes in the tree must be unique. The unique_tree offers
a handy insert operation of the form insert(parent, child).
In the unique_tree, orphans may be enabled or disabled.
Enabling orphans allows the insertion of nodes in an order
where the parent isn't guarenteed to be present before one
of it's children are inserted.
All three tree classes are derived from a base class, basic_tree<>.
Standard node iterators are provided for iterating children within a parent.
Special "descendent" iterators are avalilable to traverse children and
descendents of nodes:
pre_order_iterator, post_order_iterator, and level_order_iterator.
I'd welcome any feedback, questions, comments, or suggestions regarding the
library.
Thanks,
Mitch Haas