#include <general_tree.hh>
Public Types | |
typedef memory::TAllocSmartPointer< TTreeNode, TAllocator > | alloc_smart_pointer |
Smart pointer to this class. | |
typedef const TItem & | const_reference |
Const reference type. | |
typedef TItem * | pointer |
Pointer type. | |
typedef TItem & | reference |
Reference type. | |
typedef TItem | value_type |
Value type. | |
typedef std::size_t | size_type |
Size type. | |
Public Methods | |
TTreeNode (const TItem &rktITEM) | |
void | insert (alloc_smart_pointer &rqtTARGET_NODE) throw (TConstraintException) |
size_type | height (void) const |
const TTreeNode * | parent (void) const |
size_type | size (void) const |
Static Public Methods | |
alloc_smart_pointer | _copy (const alloc_smart_pointer &rkqtNODE, TTreeNode *&rptNODE_HEAP) |
alloc_smart_pointer | _copy (alloc_smart_pointer &rqtTARGET_NODE, const alloc_smart_pointer &rkqtNODE, TTreeNode *&rptNODE_HEAP) throw (TConstraintException) |
alloc_smart_pointer | _copySiblings (const alloc_smart_pointer &rkqtNODE, const TTreeNode *pktPARENT_NODE, TTreeNode *&rptNODE_HEAP) |
TTreeNode * | _create (const TItem &rktITEM, TTreeNode *ptNODE_HEAP) |
void | _link (alloc_smart_pointer &qtLEFT_NODE, alloc_smart_pointer &qtRIGHT_NODE) |
void | _link (alloc_smart_pointer &qtLEFT_NODE, alloc_smart_pointer &qtMIDDLE_NODE, alloc_smart_pointer &qtRIGHT_NODE) |
void | _unlink (TTreeNode *ptTARGET_NODE) throw (TConstraintException) |
Public Attributes | |
TItem | tItem |
Node item. | |
TTreeNode * | ptLeftNode |
Pointer to the left node (if any). | |
TTreeNode * | ptParentNode |
Pointer to the parent node (if any). | |
alloc_smart_pointer | qtFirstChildNode |
Pointer to the first child node. | |
alloc_smart_pointer | qtRightNode |
Pointer to the right sibling node. |
Definition at line 56 of file general_tree.hh.
|
Builds a new instance with item rktITEM.
Definition at line 217 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::qtFirstChildNode, and mpcl::util::collection::TTreeNode< TItem, TAllocator >::qtRightNode. |
|
Copies source node rkqtNODE onto this instance.
Definition at line 1272 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::ptParentNode, and mpcl::util::collection::TTreeNode< TItem, TAllocator >::qtRightNode. |
|
Copies source node rkqtNODE onto this instance.
Definition at line 1250 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::_copySiblings(), mpcl::util::collection::TTreeNode< TItem, TAllocator >::alloc_smart_pointer, and mpcl::util::collection::TTreeNode< TItem, TAllocator >::tItem. Referenced by mpcl::util::collection::TTreeNode< TItem, TAllocator >::_copySiblings(). |
|
Returns a copy of source sibling nodes in rkqtNODE (including it).
Definition at line 1308 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::_copy(), and mpcl::util::collection::TTreeNode< TItem, TAllocator >::alloc_smart_pointer. Referenced by mpcl::util::collection::TTreeNode< TItem, TAllocator >::_copy(). |
|
Creates a new node.
Definition at line 153 of file general_tree.hh. |
|
Links node qtMIDDLE_NODE between qtLEFT_NODE and qtRIGHT_NODE updating parent node from qtLEFT_NODE.
Definition at line 185 of file general_tree.hh. |
|
Links node qtRIGHT_NODE to node qtLEFT_NODE.
Definition at line 167 of file general_tree.hh. |
|
Unlinks the node ptTARGET_NODE (and its child nodes) from its parent node.
Definition at line 1350 of file general_tree.hh. |
|
Returns the height of the tree.
Definition at line 1564 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::alloc_smart_pointer, mpcl::util::collection::TTreeNode< TItem, TAllocator >::qtFirstChildNode, and mpcl::util::collection::TTreeNode< TItem, TAllocator >::size_type. |
|
Inserts node qtTARGET_NODE (but not its right sibling nodes) as the last child of this node.
Definition at line 1436 of file general_tree.hh. |
|
Returns a pointer to the parent node (if any).
Definition at line 250 of file general_tree.hh. |
|
Returns the number of nodes attached (including this).
Definition at line 1584 of file general_tree.hh. References mpcl::util::collection::TTreeNode< TItem, TAllocator >::alloc_smart_pointer, mpcl::util::collection::TTreeNode< TItem, TAllocator >::qtFirstChildNode, and mpcl::util::collection::TTreeNode< TItem, TAllocator >::size_type. |