This is the base class of the internal node type Node. This type implements functionality needed. Derived type Node then only adds the custom value T
.
Objects of this type cannot be received directly and all interface is available via public type StringTree::Cursor only, which holds a pointer to an object of this class.
Definition at line 156 of file stringtreebase.inl.
Public Field Index: | |
NodeList | children |
The hook to the doubly linked list of children. | |
uinteger | qtyChildren |
The number of children currently stored in this node. | |
Public Field Index: inherited from BidiNodeBase< NodeBase > | |
NodeBase * | p |
Public Field Index: inherited from SidiNodeBase< NodeBase > | |
NodeBase * | n |
Public Field Index: inherited from StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::NodeKey | |
NodeNameUnion | name |
NodeBase * | parent |
Public Method Index: | |
NodeBase (const NodeKey &pKey) | |
NodeBase (NodeBase *pParent, const NameType &pName) | |
strings::TAString< CharacterType, lang::HeapAllocator > & | assemblePath (strings::TAString< CharacterType, lang::HeapAllocator > &target, const NodeBase *childNode, const NodeBase *maxParent, CharacterType separatorChar) const |
uinteger | deleteChild (StringTreeBase *tree, NodeBase *child) |
uinteger | deleteChildren (StringTreeBase *tree) |
int | depth () const |
int | distance (const NodeBase *other) const |
NodeBase * | findChild (StringTreeBase *tree, const NameType &childName) |
template<typename... TArgs> | |
std::pair< NodeBase *, bool > | findOrCreateChild (StringTreeBase *tree, const NameType &childName, TArgs &&... args) |
bool | isRoot () const |
Public Method Index: inherited from BidiNodeBase< NodeBase > | |
BidiNodeBase () noexcept=default | |
Default constructor. (Does not initialize the pointer!) | |
BidiNodeBase (BidiNodeBase &&) noexcept=default | |
Defaulted move constructor. | |
BidiNodeBase (const BidiNodeBase &)=delete | |
BidiNodeBase (NodeBase *next, NodeBase *prev) noexcept | |
void | addBefore (NodeBase *elem) noexcept |
void | addBehind (NodeBase *elem) noexcept |
BidiNodeBase & | operator= (BidiNodeBase &&) noexcept=default |
BidiNodeBase & | operator= (const BidiNodeBase &)=delete |
NodeBase * | prev () const noexcept |
void | prev (BidiNodeBase *previous) noexcept |
void | remove () noexcept |
Unhooks this node from a list. | |
void | remove (NodeBase *last) noexcept |
Public Method Index: inherited from SidiNodeBase< NodeBase > | |
SidiNodeBase () noexcept=default | |
Default constructor. (Does not initialize the pointer.) | |
SidiNodeBase (const SidiNodeBase &)=delete | |
SidiNodeBase (NodeBase *next) noexcept | |
SidiNodeBase (SidiNodeBase &&) noexcept=default | |
Defaulted move constructor. | |
NodeBase * | addBehind (NodeBase *elem) noexcept |
integer | count (SidiNodeBase *end=nullptr) const noexcept |
bool | hasNext () const |
NodeBase * | next () const |
void | next (SidiNodeBase *p) |
SidiNodeBase & | operator= (const SidiNodeBase &)=delete |
SidiNodeBase & | operator= (SidiNodeBase &&) noexcept=default |
bool | pointsTo (const SidiNodeBase *elem) const |
NodeBase * | removeNext () noexcept |
NodeBase * | removeRangeBehind (NodeBase *last) noexcept |
Public Method Index: inherited from StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::NodeKey | |
NodeKey (NodeBase *pParent, const NameType &pName) | |
Additional Inherited Members | |
Public Type Index: inherited from BidiNodeBase< NodeBase > | |
using | FWDNode |
Alias name for an instantiation of the base template. | |
NodeList children |
The hook to the doubly linked list of children.
Definition at line 163 of file stringtreebase.inl.
uinteger qtyChildren |
The number of children currently stored in this node.
Definition at line 160 of file stringtreebase.inl.
|
inline |
Constructor.
pKey | The key portion of the node. |
Definition at line 167 of file stringtreebase.inl.
|
inline |
Constructor. Custom data is default-initialized.
pParent | Parent node to search a child for. |
pName | Child name to search |
Definition at line 175 of file stringtreebase.inl.
|
inline |
Implementation of TCursor::AssemblePath.
target | The target to append the path to. |
childNode | The (current) child node. |
maxParent | The last parent node to travel up to. The root node is designated by nullptr . |
separatorChar | The separator character as defined with the template parameter of class StringTree. |
Definition at line 349 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 296 of file stringtreebase.inl.
|
inline |
Deletes all child nodes.
tree | The tree this node belongs to. |
Definition at line 316 of file stringtreebase.inl.
|
inline |
Iterates over the parent nodes to the root node and returns this node's depth.
Definition at line 226 of file stringtreebase.inl.
|
inline |
Iterates over the parent nodes and searches given other in the path.
other | The node to calculate the distance to. |
0
if the nodes are the same. -1
if other was not found. Definition at line 243 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 193 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 the 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 270 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 182 of file stringtreebase.inl.