template<typename TChar = character>
struct alib::containers::StringTreeNamesAlloc< TChar >
Built-in implementation usable as template parameter TNodeHandler of class StringTree.
This type copies the node's name into memory acquired with the monotonic allocator that the StringTree uses.
- Attention
- The use of this type is dangerous in respect to memory exhaustion. While class StringTree uses monotonic allocation in a very safe way, with the use of this type, repeated removals and insertions of tree nodes, increase the memory usage.
Consequently, the use of this type is restricted to cases that imply a limited number of insertions.
- See also
- Two other built-in implementations of this type to be used with StringTree instantiations are provided with this ALib Module:
-
Further information can be found in chapter 4. Node and Node Name String Allocation of the reference documentation of class StringTree.
- Template Parameters
-
TChar | The character type of the key strings. This type is used with any interface method of StringTree that accepts a node name or path string. |
Definition at line 298 of file stringtree.hpp.
#include <stringtree.hpp>
|
template<typename TTree > |
static void | FreeNode (TTree &tree, typename TTree::baseNode &node) |
|
template<typename TTree > |
static void | InitializeNode (TTree &tree, typename TTree::Node &node) |
|
◆ CharacterType
template<typename TChar = character>
◆ NameStringType
template<typename TChar = character>
◆ FreeNode()
template<typename TChar = character>
template<typename TTree >
static void FreeNode |
( |
TTree & | tree, |
|
|
typename TTree::baseNode & | node ) |
|
inlinestatic |
This implementation does nothing.
- See also
- See description of this class and the "default implementation" StringTreeNamesDynamic.
- Parameters
-
tree | The instance of struct detail::StringTreeBase that invokes this method. Any member may be accessed, including nodeTable which contains the allocator that the tree uses for the allocation of nodes. |
node | The node that is to be removed. Allows access to the key and custom value data. While the parent and sibling nodes are likewise accessible, it is strictly forbidden to modify those. |
- Template Parameters
-
TTree | The type of the templated instantiation of struct detail::StringTreeBase that this method is invoked by. (Deduced by the compiler.) |
Definition at line 349 of file stringtree.hpp.
◆ InitializeNode()
template<typename TChar = character>
template<typename TTree >
static void InitializeNode |
( |
TTree & | tree, |
|
|
typename TTree::Node & | node ) |
|
inlinestatic |
This implementation copies the node's name to a piece of memory allocated in the allocator found in field nodeTable of the given tree.
- See also
- See description of this class and the "default implementation" StringTreeNamesDynamic.
- Parameters
-
tree | The instance of struct detail::StringTreeBase that invokes this method. Any member may be accessed, including nodeTable which contains the allocator that the tree uses for the allocation of nodes. |
node | The node that was just created. Allows access to the key and custom value data. While the parent and sibling nodes are likewise accessible, it is strictly forbidden to modify those. |
- Template Parameters
-
TTree | The type of the templated instantiation of struct detail::StringTreeBase that this method is invoked by. (Deduced by the compiler.) |
Definition at line 326 of file stringtree.hpp.
The documentation for this struct was generated from the following file: