This is the "final" internal node type, which is created and stored for every node of the tree. It adds field data of template type T to store custom container data.
Objects of this type can not be received directly and all interface is available via public type StringTree::NodePtr only, which holds a pointer to an object of this class.
Note that the templated allocator type TAllocator is declared as a friend of this class to be able to access the otherwise protected constructor.
Definition at line 196 of file stringtreebase.inl.
Public Fields | |
| NodeList | children |
| T | data |
| uinteger | qtyChildren |
Public Fields inherited from BidiNodeBase< Node > | |
| Node * | pprev |
Public Fields inherited from SidiNodeBase< Node > | |
| Node * | pnext |
Public Fields inherited from StringTreeBase< T, TNodeMaintainer, TRecycling >::NodeKey | |
| NameType | name |
| Node * | parent |
Public Methods | |
| Node (const Node &)=delete | |
| template<typename... TArgs> | |
| Node (const NodeKey &pKey, TArgs &&... args) | |
| Node (Node &&)=delete | |
| template<typename... TArgs> | |
| Node (Node *pParent, const NameType &pName, TArgs &&... args) | |
| AString & | assemblePath (AString &target, character separatorChar) const |
| uinteger | deleteChild (StringTreeBase *tree, Node *child) |
| uinteger | deleteChildren (StringTreeBase *tree) |
| int | depth () const |
| Node * | findChild (StringTreeBase *tree, const NameType &childName) |
| template<typename... TArgs> | |
| std::pair< Node *, bool > | findOrCreateChild (StringTreeBase *tree, const NameType &childName, TArgs &&... args) |
| bool | isRoot () const |
Public Methods inherited from BidiNodeBase< Node > | |
| BidiNodeBase () noexcept=default | |
| BidiNodeBase (BidiNodeBase &&) noexcept=default | |
| BidiNodeBase (const BidiNodeBase &)=delete | |
| BidiNodeBase (Node *next, Node *prev) noexcept | |
| void | addBefore (Node *elem) |
| void | addBehind (Node *elem) |
| BidiNodeBase & | operator= (BidiNodeBase &&) noexcept=default |
| BidiNodeBase & | operator= (const BidiNodeBase &)=delete |
| Node * | prev () const |
| void | prev (BidiNodeBase *newPrev) |
| void | remove () |
| void | remove (Node *last) |
Public Methods inherited from SidiNodeBase< Node > | |
| SidiNodeBase () noexcept=default | |
| SidiNodeBase (const SidiNodeBase &)=delete | |
| SidiNodeBase (Node *next) noexcept | |
| SidiNodeBase (SidiNodeBase &&) noexcept=default | |
| Node * | addBehind (Node *elem) |
| integer | count (SidiNodeBase *end=nullptr) const |
| bool | hasNext () const |
| Node * | next () const |
| void | next (SidiNodeBase *p) |
| SidiNodeBase & | operator= (const SidiNodeBase &)=delete |
| SidiNodeBase & | operator= (SidiNodeBase &&) noexcept=default |
| bool | pointsTo (const SidiNodeBase *elem) const |
| Node * | removeNext () |
| Node * | removeRangeBehind (Node *last) |
Public Methods inherited from StringTreeBase< T, TNodeMaintainer, TRecycling >::NodeKey | |
| NodeKey (Node *pParent, const NameType &pName) | |
Additional Inherited Members | |
Public Types inherited from BidiNodeBase< Node > | |
| using | FWDNode = SidiNodeBase< Node > |
Constructor. Custom data is default-initialized.
| TArgs | Types of variadic parameters given with parameter args. |
| pKey | The key portion of the node. |
| args | Variadic parameters to be forwarded to constructor of custom type T. |
Definition at line 221 of file stringtreebase.inl.
Constructor. Custom data is default-initialized.
| TArgs | Types of variadic parameters given with parameter args. |
| pParent | Parent node to search a child for. |
| pName | Child name to search |
| args | Variadic parameters to be forwarded to constructor of custom type T. |
Definition at line 235 of file stringtreebase.inl.
Implementation of StringTree::NodePtr::AssemblePath.
| target | The target to append the path to. |
| separatorChar | The separator character as defined with the template parameter of class StringTree. |
Definition at line 402 of file stringtreebase.inl.
|
inline |
Deletes a given child node.
| tree | The tree this node belongs to. |
| child | A pointer to a child of this node that is to be deleted. |
Definition at line 350 of file stringtreebase.inl.
|
inline |
Deletes all child nodes.
| tree | The tree this node belongs to. |
Definition at line 372 of file stringtreebase.inl.
|
inline |
Iterates over the parent nodes to the root node and returns the this node's depth.
Definition at line 256 of file stringtreebase.inl.
|
inline |
Searches a child with a given name. The name is not checked for ., .. or if separation characters.
| tree | The tree this node belongs to. |
| childName | The name of the child to search. |
nullptr if not found. Definition at line 276 of file stringtreebase.inl.
|
inline |
Searches a child with a given name, if not found, one is created. The name is not checked for ., .. or if separation characters.
| TArgs | Types of variadic parameters given with parameter args. |
| tree | The tree this node belongs to. |
| childName | The name of the child to search. |
| args | Variadic parameters to be forwarded to constructor of custom type T in the case a child is created. |
true if the insertion took place and false nothing was changed. Definition at line 322 of file stringtreebase.inl.
|
inline |
Returns true if this is the root node, false otherwise.
true if this is the root node, false otherwise. Definition at line 247 of file stringtreebase.inl.
| NodeList children |
The hook to the doubly linked list of children.
Definition at line 203 of file stringtreebase.inl.
| T data |
The templated custom data object stored with each node.
Definition at line 206 of file stringtreebase.inl.
| uinteger qtyChildren |
The number of children currently stored in this node.
Definition at line 200 of file stringtreebase.inl.