#include <general_tree.hh>
Public Types | |
typedef TNode::alloc_smart_pointer | QTNode |
Alloc-smart-pointer to node type. | |
typedef memory::TAllocSmartPointer< TGeneralTree, TAllocator > | QTTree |
Smart-pointer to general tree type. | |
typedef TGeneralTreePreIterator< const TItem, TAllocator > | const_iterator |
Const iterator type. | |
typedef TGeneralTreeSideIterator< const TItem, TAllocator > | const_side_iterator |
Const side iterator type. | |
typedef TGeneralTreePreIterator< TItem, TAllocator > | iterator |
Iterator type. | |
typedef TGeneralTreeSideIterator< TItem, TAllocator > | side_iterator |
Iterator type. | |
typedef TNode::size_type | size_type |
Size type. | |
typedef TItem | value_type |
Value type. | |
Public Methods | |
TGeneralTree (void) | |
TGeneralTree (const TItem &rktITEM) | |
TGeneralTree (const TGeneralTree &rktGENERAL_TREE) | |
virtual | ~TGeneralTree (void) |
Destroys the instance. Complexity is like of clear(). | |
void | clear (void) |
TGeneralTree & | copy (const TGeneralTree &rktGENERAL_TREE) |
template<typename TIterator> TIterator | erase (TIterator tPOSITION) |
template<typename TIterator> TIterator | erase (TIterator tBEGIN, TIterator tEND) |
void | insert (QTTree &rqtGENERAL_TREE) throw (TConstraintException) |
void | insert (const TItem &rktITEM) throw (TConstraintException) |
template<class TIterator> void | insert (TIterator tPOSITION, QTTree &rqtGENERAL_TREE) throw (TConstraintException) |
template<class TIterator> void | insert (TIterator tPOSITION, const TItem &rktITEM) throw (TConstraintException) |
TGeneralTree & | operator= (const TGeneralTree &rktGENERAL_TREE) |
void | setRoot (const TItem &rktITEM) |
iterator | begin (void) |
const_iterator | begin (void) const |
side_iterator | beginChild (void) throw (TConstraintException) |
const_side_iterator | beginChild (void) const throw (TConstraintException) |
bool | empty (void) const |
iterator | end (void) |
const_iterator | end (void) const |
side_iterator | endChild (void) |
const_side_iterator | endChild (void) const |
const TItem & | getRoot (void) const throw (TConstraintException) |
TItem & | getRoot (void) throw (TConstraintException) |
size_type | height (void) const |
TGeneralTree | leftChild (void) const |
size_type | max_size (void) const |
TGeneralTree | rightSibling (void) const |
size_type | size (void) const |
void | swap (TGeneralTree &rtTREE) |
Definition at line 704 of file general_tree.hh.
|
Builds a new instance of empty tree.
Definition at line 777 of file general_tree.hh. Referenced by mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::leftChild(), and mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::rightSibling(). |
|
Builds a new instance with a root node that is a copy of rktITEM.
Definition at line 786 of file general_tree.hh. |
|
Builds a new instance copying from tree rktGENERAL_TREE.
Definition at line 795 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size_type. |
|
Returns the iterator at first sub-tree. Complexity is constant.
Definition at line 1053 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::const_iterator. |
|
Returns the iterator at first sub-tree. Complexity is constant.
Definition at line 1044 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::iterator. |
|
Returns the iterator at first sub-tree. Complexity is constant.
Definition at line 1078 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::const_side_iterator. |
|
Returns the iterator at first sub-tree. Complexity is constant.
Definition at line 1063 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::side_iterator. |
|
Clears all the sub-trees. Complexity is constant.
Definition at line 819 of file general_tree.hh. Referenced by mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::~TGeneralTree(). |
|
Copies another tree onto this instance. Complexity is linear.
Definition at line 829 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::qtRootNode, mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size(), and mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size_type. Referenced by mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::operator=(). |
|
Returns true if tree is empty. Complexity is constant.
Definition at line 1092 of file general_tree.hh. |
|
Returns the iterator at position past the last sub-tree. Complexity is constant.
Definition at line 1112 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::const_iterator. |
|
Returns the iterator at position past the last sub-tree. Complexity is constant.
Definition at line 1102 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::iterator. |
|
Returns the iterator at position past the last sub-tree. Complexity is constant.
Definition at line 1132 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::const_side_iterator. |
|
Returns the iterator at position past the last sub-tree. Complexity is constant.
Definition at line 1122 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::side_iterator. |
|
Erases sub-trees from position tBEGIN to tEND. Complexity is linear.
Definition at line 888 of file general_tree.hh. |
|
Erases sub-tree pointed by tPOSITION. Complexity is constant.
Definition at line 869 of file general_tree.hh. |
|
Returns the root node item. Complexity is constant.
Definition at line 1157 of file general_tree.hh. |
|
Returns the root node item. Complexity is constant.
Definition at line 1142 of file general_tree.hh. |
|
Returns the height of the tree. Complexity is like TNode::height().
Definition at line 1171 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size_type. |
|
Inserts as the last child node, the item rktITEM. Complexity is like of TNode::insert().
Definition at line 984 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::QTNode. |
|
Inserts the sub-tree rqtGENERAL_TREE at position tPOSITION. Complexity is like of TNode::insert().
Definition at line 957 of file general_tree.hh. |
|
Inserts, as the last position, the item rktITEM. Complexity is like of TNode::insert().
Definition at line 929 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::QTNode. |
|
Inserts, as the last sub-tree, the tree rqtGENERAL_TREE. Complexity is like of TNode::insert().
Definition at line 911 of file general_tree.hh. |
|
Returns a tree pointing to the left child sub-tree. Complexity is constant.
Definition at line 1182 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::TGeneralTree(). |
|
Returns maximum size of the tree.
Definition at line 1195 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size_type. |
|
Copies another tree onto this instance. Complexity is linear.
Definition at line 1011 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::copy(). |
|
Returns a tree pointing to the right sibling sub-tree. Complexity is constant.
Definition at line 1206 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::TGeneralTree(). |
|
Sets the root node item to rktITEM. Complexity is constant.
Definition at line 1021 of file general_tree.hh. |
|
Returns the number of nodes. Complexity is like TNode::size().
Definition at line 1219 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::size_type. Referenced by mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::copy(). |
|
Swaps tree with rtTREE.
Definition at line 1236 of file general_tree.hh. References mpcl::util::collection::TGeneralTree< TItem, TAllocator, TNode >::qtRootNode. |