ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
StringTree< T, TNodeMaintainer, TRecycling >::TCursor< TConst > Class Template Reference

Description:

template<typename T, typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
class alib::monomem::StringTree< T, TNodeMaintainer, TRecycling >::TCursor< TConst >

This public, inner class provides the main interface into outer class StringTree. The class should be considered being similar to a simple pointer or to a lightweight iterator type, which refers to a tree and a current node.
The class's interface allows the access to a node's name and value and to insert and remove child nodes.

Instances of this class can be received with methods Root and RecursiveIterator::Node.

The default constructor creates an invalid object, which has to be initialized by assigning a valid object prior to its first use.

See also
For more information on how this class is used, see paragraph 2.1 Inner Class Cursor of the description of class StringTree.
Template Parameters
TConstIf true, internal fields representing the StringTree and the current Node become const and methods which are not declared const become unavailable.

Friends

class StringTree

Definition at line 685 of file stringtree.hpp.

#include <stringtree.hpp>

Inheritance diagram for StringTree< T, TNodeMaintainer, TRecycling >::TCursor< TConst >:
[legend]
Collaboration diagram for StringTree< T, TNodeMaintainer, TRecycling >::TCursor< TConst >:
[legend]

Public Type Index:

using TStringTree = ATMP_IF_T_F(!TConst, StringTree, const StringTree)
 

Public Method Index:

 TCursor () noexcept=default
 
 TCursor (const TCursor &src) noexcept
 
 TCursor (TCursor &&src) noexcept
 
 TCursor (TStringTree &pTree, uinteger exportValue) noexcept
 
 ~TCursor () noexcept=default
 
AStringAssemblePath (AString &targetString, const TCursor &parent, lang::CurrentData targetData=lang::CurrentData::Clear) const
 
AStringAssemblePath (AString &targetString, lang::CurrentData targetData=lang::CurrentData::Clear) const
 
TCursor Child (const NameType &name) const
 
TCursor Clone () const
 
uinteger CountChildren () const
 
template<bool TCheck = true, typename... TArgs>
TCursor CreateChild (const NameType &childName, TArgs &&... args) const
 
template<typename... TArgs>
std::pair< TCursor, bool > CreateChildIfNotExistent (const NameType &name, TArgs &&... args)
 
template<typename... TArgs>
std::pair< TCursor, integerCreatePathIfNotExistent (const NameType &path, TArgs &&... args)
 
uinteger Delete ()
 
bool DeleteChild (const NameType &childName) const
 
void DeleteChild (TCursor &child) const
 
uinteger DeleteChildren () const
 
int Depth () const
 
uinteger Export () const
 
TCursor FirstChild () const
 
bool GoToChild (const NameType &name)
 
template<typename... TArgs>
bool GoToCreateChildIfNotExistent (const NameType &name, TArgs &&... args)
 
template<typename... TArgs>
integer GoToCreatedPathIfNotExistent (const NameType &path, TArgs &&... args)
 
bool GoToFirstChild ()
 
bool GoToLastChild ()
 
bool GoToNextSibling ()
 
TCursorGoToParent ()
 
bool GoToPreviousSibling ()
 
TCursorGoToRoot ()
 
SubstringType GoToTraversedPath (const NameType &path)
 
bool HasChildren () const
 
bool HasNextSibling () const
 
bool HasPreviousSibling () const
 
bool IsInvalid () const
 
bool IsRoot () const
 
bool IsValid () const
 
TCursor LastChild () const
 
const NameTypeName () const
 
TCursor NextSibling () const
 
 operator TCursor<!TConst > ()
 
bool operator!= (const TCursor &other) const
 
TCursoroperator= (const TCursor &) noexcept=default
 
TCursoroperator= (TCursor &&) noexcept=default
 
bool operator== (const TCursor &other) const
 
TCursor Parent () const
 
TCursor PreviousSibling () const
 
TCursor Root () const
 
std::pair< TCursor, SubstringTypeTraversePath (const NameType &path) const
 
StringTreeTree ()
 
const StringTreeTree () const
 
T & Value ()
 
const T & Value () const
 

Type Definition Details:

◆ cmCursor

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
using cmCursor = ATMP_IF_T_F(!TConst, baseCursor, baseConstCursor)
protected

Constant or mutable version of the base cursor type, depending on template parameter TConst

Definition at line 702 of file stringtree.hpp.

◆ cmNode

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
using cmNode = ATMP_IF_T_F(!TConst, baseNodeBase, const baseNodeBase)
protected

Constant or mutable version of the base node type, depending on template parameter TConst

Definition at line 698 of file stringtree.hpp.

◆ cmTree

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
using cmTree = ATMP_IF_T_F(!TConst, basetree, const basetree)
protected

Constant or mutable version of the base tree type, depending on template parameter TConst

Definition at line 694 of file stringtree.hpp.

◆ TStringTree

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
using TStringTree = ATMP_IF_T_F(!TConst, StringTree, const StringTree)

Constant or mutable version of the outer string tree type, depending on template parameter TConst

Definition at line 718 of file stringtree.hpp.

Constructor(s) / Destructor Details::

◆ TCursor() [1/5]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor ( cmTree * pTree,
cmNode * pNode )
inlineprotectednoexcept

Internal constructor

Parameters
pTreeThe StringTree we work on.
pNodeThe node to refer to.

Definition at line 711 of file stringtree.hpp.

◆ TCursor() [2/5]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor ( )
defaultnoexcept

Public constructor. Creates an invalid cursor. The only way to make a default-constructed instance valid is by (copy-) assigning another instance.

◆ TCursor() [3/5]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor ( TStringTree & pTree,
uinteger exportValue )
inlinenoexcept

Public constructor taking an export value. TODO(240312 10:46): This method is needed for APath but should be valuable in general. What is missing here is const/mutable treatment.

Parameters
pTreeThe tree to use.
exportValueA previously exported value.

Definition at line 731 of file stringtree.hpp.

◆ TCursor() [4/5]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor ( const TCursor< TConst > & src)
inlinenoexcept

Copy constructor.

Parameters
srcThe cursor to copy.

Definition at line 736 of file stringtree.hpp.

◆ TCursor() [5/5]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor ( TCursor< TConst > && src)
inlinenoexcept

Move constructor.

Parameters
srcThe cursor to move.

Definition at line 742 of file stringtree.hpp.

◆ ~TCursor()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
~TCursor ( )
defaultnoexcept

Trivial default destructor.

Method Details:

◆ AssemblePath() [1/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
AString & AssemblePath ( AString & targetString,
const TCursor< TConst > & parent,
lang::CurrentData targetData = lang::CurrentData::Clear ) const
inline

Same as AssemblePath but accepts a parent node to stop at, instead of the root node. The path created is a relative path from the parent to the represented node, hence it does not include the parent' name and also does not start with the separation character. The latter is true even if the given targetParent represents the root node. In this case the path is a relative path from the root node '/' to the child.

If the given parent is not found within the list of parent nodes, then an absolute path from the tree's root to the represented node is returned.

Parameters
targetStringThe string buffer to append the path to.
parentDenotes the parent node to start a relative path from.
targetDataDenotes whether target should be cleared prior to appending the path. Defaults to CurrentData::Clear.
Returns
The given AString to allow concatenated operations on it.

Definition at line 1430 of file stringtree.hpp.

Here is the call graph for this function:

◆ AssemblePath() [2/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
AString & AssemblePath ( AString & targetString,
lang::CurrentData targetData = lang::CurrentData::Clear ) const
inline

Writes the absolute path to the represented node (including the represented node's name) to the given AString.
If this node represents the root node, then nothing is written but a single separation character.

While the implementation of this method is as efficient as possible (to avoid insertions at the beginning of the target string while moving to the destination/root node, internally a local node-stack is created first, which then is traversed top-down), still in many situations, it is recommended to search for other ways to keep track of the current path of a node and modify and re-use such path. For this, class StringTree::RecursiveIterator , optionally allows to maintain a string representing the current path with every iteration.

See also
Overloaded version AssemblePath(AString&,TCursor<TConst>&,lang::CurrentData), which allows to create a relative path from a parent node to this node.
Parameters
targetStringThe string buffer to append the path to.
targetDataDenotes whether target should be cleared prior to appending the path. Defaults to CurrentData::Clear.
Returns
The given AString to allow concatenated operations on it.

Definition at line 1401 of file stringtree.hpp.

Here is the call graph for this function:

◆ Child()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor Child ( const NameType & name) const
inline

Searches a child with the given name and returns a cursor to it. If no child with this name exists, the returned cursor is invalid

The given name is not considered a path and is not checked for being "." or ".." or if it contains a separator character. Children with such name can not exist and hence can't be found. However, in debug builds, an ALIB_WARNING is reported.

Parameters
nameThe name of the child to search.
Returns
A cursor representing the last child of the node represented by this cursor.

Definition at line 1024 of file stringtree.hpp.

Here is the call graph for this function:

◆ Clone()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor Clone ( ) const
inline

Creates a cursor value representing the same node like this pointer.

Returns
A clone of this cursor.

Definition at line 829 of file stringtree.hpp.

Here is the call graph for this function:

◆ CountChildren()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
uinteger CountChildren ( ) const
inline

Returns the number of direct children of the represented node.
Note that this method runs in constant time.

Returns
The number of direct children of the represented node.

Definition at line 1349 of file stringtree.hpp.

Here is the call graph for this function:

◆ CreateChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
template<bool TCheck = true, typename... TArgs>
TCursor CreateChild ( const NameType & childName,
TArgs &&... args ) const
inline

Creates and returns a child node. If a node already exists, nothing is done and nullptr is returned as this is considered an error.

If the child name is illegal (equal to "." or ".." or contains a separation character), an ALib warning is raised and an invalid cursor is returned.

Template parameter TCheck may be used to suppress the search for an existing child with the same name, as well as the check for correctness of the given child name. This tremendously improves the execution performance of this method.

Attention
Setting template parameter TCheck to false and inserting child nodes with the same name, sets a StringTree to an undefined state.
Template Parameters
TCheckIf false, no check for an existing child with the same name is performed.
TArgsTypes of variadic parameters given with parameter args .
Parameters
childNameThe name of the child
argsVariadic parameters to be forwarded to constructor of custom type T of the child created.
Returns
A new cursor object representing the created child node. If the given childName was invalid or the child existed already, the returned object is invalid.

Definition at line 1472 of file stringtree.hpp.

Here is the call graph for this function:

◆ CreateChildIfNotExistent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
template<typename... TArgs>
std::pair< TCursor, bool > CreateChildIfNotExistent ( const NameType & name,
TArgs &&... args )
inline

Moves this cursor to the child with given name . If no child with this name exists, one will be created.

If the given childName is invalid (equals to "." or ".." or contains the separation character), then still true is returned, but this cursor becomes invalid. In addition, with debug builds, an ALIB_WARNING is reported.

Template Parameters
TArgsTypes of variadic parameters given with parameter args .
Parameters
nameThe name of the desired child.
argsVariadic parameters to be forwarded to constructor of custom type T in the case a child is created.
Returns
A pair of a cursor pointing to the child and a boolean that equals false if the child was found, and true if a child was created. If the given name was invalid, the returned cursor will be invalid while the boolean still indicates "not found" (aka true).

Definition at line 1079 of file stringtree.hpp.

Here is the call graph for this function:

◆ CreatePathIfNotExistent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
template<typename... TArgs>
std::pair< TCursor, integer > CreatePathIfNotExistent ( const NameType & path,
TArgs &&... args )
inline

Follows the given path and creates non-existing children along the way.

Child names "." and ".." are allowed and respected same as documented with method TraversePath.

New child nodes are constructed by forwarding the given args . Existing children remain untouched.

Template Parameters
TArgsTypes of variadic parameters given with parameter args .
Parameters
pathThe path to move along.
argsVariadic parameters to be forwarded to constructor of each node that is created.
Returns
A std::pair containing a resulting Cursor and the number of nodes created.

Definition at line 1205 of file stringtree.hpp.

Here is the call graph for this function:

◆ Delete()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
uinteger Delete ( )
inline

Deletes the branch that this cursor refers to from the tree. If this cursor does not represent the root node, then after the operation, it refers to the parent of the current node.
If the represented node is the root node, only the children are deleted and this object remains representing the root node. Note that in this case any explicitly set custom value of the root node is not deleted. For this, exclusively methods ConstructRootValue and DeleteRootValue are to be used.

Note
If this method is invoked on an object returned by method RecursiveIterator::Node, the invoking iterator becomes invalid.
To avoid this, method RecursiveIterator::DeleteNode is to be used.
Returns
The total number of nodes deleted. Can be zero, in case this object represents the root node and this node has no children.

Definition at line 1592 of file stringtree.hpp.

Here is the call graph for this function:

◆ DeleteChild() [1/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool DeleteChild ( const NameType & childName) const
inline

Searches and deletes the child named childName from the node that this object refers to. This object itself is not changed.

See also
Overloaded version of this method that accepts a cursor referring to the child in question.
Parameters
childNameThe name of the desired child.
Returns
true if the child existed and was deleted, false otherwise.

Definition at line 1514 of file stringtree.hpp.

Here is the call graph for this function:

◆ DeleteChild() [2/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
void DeleteChild ( TCursor< TConst > & child) const
inline

Deletes the child represented by the given cursor child from the node that this cursor refers to. After the invocation the given child refers to its next sibling. If no such sibling exists, child becomes invalid. This cursor itself is not changed.

Note
This method is handy to implement forward iterations through children of a parent node with the aim to delete certain child nodes. No corresponding version of this method exists that moves the given child pointer to its previous sibling. For reverse iterations, a clone of the child argument has to be passed. However, any overhead caused by such temporary object creation will be optimized out by modern C++ compilers.
Parameters
childDeletes the child represented by the given node.

Definition at line 1551 of file stringtree.hpp.

Here is the call graph for this function:

◆ DeleteChildren()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
uinteger DeleteChildren ( ) const
inline

Deletes the children of the node that this cursor refers to. This object itself is not changed.

Returns
The number of children that were deleted.

Definition at line 1568 of file stringtree.hpp.

Here is the call graph for this function:

◆ Depth()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
int Depth ( ) const
inline

Determines the depth of the node represented by this object. This is done by counting the iterations needed to reach the root node of the tree.

Returns
The distance from this node to the root node.

Definition at line 1328 of file stringtree.hpp.

Here is the call graph for this function:

◆ Export()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
uinteger Export ( ) const
inline

TODO(240312 10:50): This was needed for APath. Refer to the new corresponding constructor...

Returns
todo.

Definition at line 789 of file stringtree.hpp.

◆ FirstChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor FirstChild ( ) const
inline

Returns a cursor object that represents the first child of the node represented. If the represented node has no children, an invalid cursor is returned.

Returns
A cursor representing the first child of the node this cursor points to.

Definition at line 955 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool GoToChild ( const NameType & name)
inline

Searches a child with the given name and moves this cursor to it. If no child with this name exists, the cursor does not change and false is returned.

The given name is not considered a path and is not checked for being "." or ".." or if it contains a separator character. Children with such name can not exist and hence can't be found. However, in debug builds, an ALIB_WARNING is reported.

Parameters
nameThe name of the child to search.
Returns
true if the child existed and this object changed, false otherwise.

Definition at line 1046 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToCreateChildIfNotExistent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
template<typename... TArgs>
bool GoToCreateChildIfNotExistent ( const NameType & name,
TArgs &&... args )
inline

Moves this cursor to the child with given name . If no child with this name exists, one will be created.

If the given childName is invalid (equals to "." or ".." or contains the separation character), then still true is returned, but this cursor becomes invalid. In addition, with debug builds, an ALIB_WARNING is reported.

Template Parameters
TArgsTypes of variadic parameters given with parameter args .
Parameters
nameThe name of the desired child.
argsVariadic parameters to be forwarded to constructor of custom type T in the case a child is created.
Returns
false if the child was found, and true if one was created or the given child name was invalid.

Definition at line 1110 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToCreatedPathIfNotExistent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
template<typename... TArgs>
integer GoToCreatedPathIfNotExistent ( const NameType & path,
TArgs &&... args )
inline

Follows the given path and creates non-existing children along the way.

Child names "." and ".." are allowed and respected same as in TraversePath.

New child nodes are constructed by forwarding the given args . Existing children remain untouched.

Template Parameters
TArgsTypes of variadic parameters given with parameter args .
Parameters
pathThe path to move along.
argsVariadic parameters to be forwarded to constructor of each node that is created.
Returns
The number of nodes created.

Definition at line 1233 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToFirstChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool GoToFirstChild ( )
inline

Moves this cursor to the first child of its represented node. If the represented node has no children, this cursor becomes invalid.

Returns
true if the cursor was moved, false if the represented node has no children.

Definition at line 968 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToLastChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool GoToLastChild ( )
inline

Moves this cursor to the last child of its represented node. If the represented node has no children, this cursor becomes invalid.

Returns
true if the cursor was moved, false if the represented node has no children.

Definition at line 1000 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToNextSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool GoToNextSibling ( )
inline

Moves this cursor to the next sibling of the represented node. If the node has no next sibling, this cursor becomes invalid. The latter is always true if this is the root node of the tree.

Returns
true if this cursor was moved, false if the represented node has no next sibling.

Definition at line 903 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToParent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor & GoToParent ( )
inline

Moves this cursor to the parent of the current node. If this is the root node, this object becomes invalid.

Returns
*this to allow concatenated calls

Definition at line 873 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToPreviousSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool GoToPreviousSibling ( )
inline

Moves this cursor to the previous sibling of the represented node. If the node has no previous sibling, this cursor becomes invalid. The latter is always true if this is the root node of the tree.

Returns
true if this cursor was moved, false if the represented node has no previous sibling.

Definition at line 937 of file stringtree.hpp.

Here is the call graph for this function:

◆ GoToRoot()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor & GoToRoot ( )
inline

Moves this cursor to the root node of the tree.

Returns
A reference to this object

Definition at line 844 of file stringtree.hpp.

◆ GoToTraversedPath()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
SubstringType GoToTraversedPath ( const NameType & path)
inline

Same as TraversePath, but moves this cursor instead of returning one.

Parameters
pathThe path to move this cursor along.
Returns
The unconsumed portion of the path. An empty Substring if the path existed.

Definition at line 1180 of file stringtree.hpp.

Here is the call graph for this function:

◆ HasChildren()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool HasChildren ( ) const
inline

Returns true if the represented node has at least one direct child.

Returns
true if the current node has children, false otherwise.

Definition at line 1338 of file stringtree.hpp.

Here is the call graph for this function:

◆ HasNextSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool HasNextSibling ( ) const
inline

Evaluates if the node represented by this object has a next sibling in its parent's list of children.

Returns
true if a next sibling to this object's represented node exists, false otherwise.

Definition at line 1361 of file stringtree.hpp.

Here is the call graph for this function:

◆ HasPreviousSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool HasPreviousSibling ( ) const
inline

Evaluates if the node represented by this object has a previous sibling in its parent's list of children.

Returns
true if a previous sibling to this object's represented node exists, false otherwise.

Definition at line 1373 of file stringtree.hpp.

Here is the call graph for this function:

◆ IsInvalid()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool IsInvalid ( ) const
inline

Returns the opposite of IsValid.

Returns
true if this is an invalid cursor that must not be used, false otherwise.

Definition at line 819 of file stringtree.hpp.

Here is the call graph for this function:

◆ IsRoot()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool IsRoot ( ) const
inline

Returns true if this cursor represents the root node of the StringTree, false otherwise.

Returns
true if this object represents the root node, false otherwise.

Definition at line 1317 of file stringtree.hpp.

Here is the call graph for this function:

◆ IsValid()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool IsValid ( ) const
inline

Determines if this is a valid object. Cursors may become invalid with transition methods like GoToParent, GoToFirstChild or GoToNextSibling. An invalid object may be turned into a valid one by either

  • assigning a valid object (copy assignment), or
  • invoking method GoToRoot, or
  • invoking method GoToTraversedPath using absolute path addressing.

Note that the latter is not applicable to a default-constructed objects (which are also invalid) as with such no StringTree is assigned.

Returns
true if this is a valid cursor. If invalid, false is returned and this object must not be used.

Definition at line 808 of file stringtree.hpp.

◆ LastChild()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor LastChild ( ) const
inline

Returns a cursor value that represents the last child of the node represented. If the represented node has no children, an invalid cursor is returned.

Returns
A cursor representing the last child of the node represented by this cursor.

Definition at line 987 of file stringtree.hpp.

Here is the call graph for this function:

◆ Name()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
const NameType & Name ( ) const
inline

Returns the name of the represented node. Note that the concatenated names of recursive child nodes, separated by TSeparator constitute a path.

Returns
A constant reference to the name of the represented node.

Definition at line 1253 of file stringtree.hpp.

Here is the call graph for this function:

◆ NextSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor NextSibling ( ) const
inline

Returns a cursor value that represents the next sibling of the node represented this cursor. If the node has no next sibling, an invalid cursor is returned.

Returns
A cursor object representing the next sibling of the node represented by this object.

Definition at line 889 of file stringtree.hpp.

Here is the call graph for this function:

◆ operator TCursor<!TConst >()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
operator TCursor<!TConst > ( )
inline

Conversion operator from TCursor<TConst> to TCursor<!TConst>. For const to mutable, this will fail as intended.

Returns
A constant iterator, if this is a mutable. Otherwise compilation will duly fail.

Definition at line 763 of file stringtree.hpp.

◆ operator!=()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool operator!= ( const TCursor< TConst > & other) const
inline

Comparison operator.

Parameters
otherThe object to compare ourselves to.
Returns
false if this and given cursor are equal, true otherwise.

Definition at line 779 of file stringtree.hpp.

◆ operator=() [1/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor & operator= ( const TCursor< TConst > & )
defaultnoexcept

Trivial default copy assign operator.

Returns
A reference to this.

◆ operator=() [2/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor & operator= ( TCursor< TConst > && )
defaultnoexcept

Trivial default move assign operator.

Returns
A reference to this.

◆ operator==()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
bool operator== ( const TCursor< TConst > & other) const
inline

Comparison operator.

Parameters
otherThe object to compare ourselves to.
Returns
true if this and given cursor are equal, false otherwise.

Definition at line 769 of file stringtree.hpp.

◆ Parent()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor Parent ( ) const
inline

Creates a cursor value representing the parent node of the node represented by this object.

If this object represents the root node of the tree, the returned cursor is invalid.

Returns
A cursor pointing to the parent node of the node represented by this cursor.

Definition at line 860 of file stringtree.hpp.

Here is the call graph for this function:

◆ PreviousSibling()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor PreviousSibling ( ) const
inline

Returns a cursor value that represents the previous sibling of the node represented this cursor. If the node has no previous sibling, an invalid cursor is returned.

Returns
A cursor object representing the previous sibling of the node represented by this object.

Definition at line 923 of file stringtree.hpp.

Here is the call graph for this function:

◆ Root()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
TCursor Root ( ) const
inline

Returns a cursor to the root node of the tree.

Returns
A cursor representing the root node of the tree this pointer represents.

Definition at line 837 of file stringtree.hpp.

Here is the call graph for this function:

◆ TraversePath()

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
std::pair< TCursor, SubstringType > TraversePath ( const NameType & path) const
inline

Follows the given path from the currently represented node to the target node.

The method supports absolute and relative path addressing: If path begins with a separation character, then the transition starts with the root node of the StringTree. Furthermore, child name "." is ignored and just skipped while a name of ".." addresses the parent node during the transition. Repeated separation characters are ignored.
If, while processing the path string, the root node is found an the next path element is "..", this element is ignored and processing continues. As a sample, assuming that nodes /a and /b exist, the paths:

 /a/../b

and

 /a/../../b

both evaluate to

 /b

Relative paths must not be used on invalid cursors. Doing so is undefined behavior and raises an ALib assertion in debug-compilations.

If a child along the path does not exist, the traversal is ended and the remaining portion of the path is returned.

Note
If parameter path is a temporary object, the resulting Substring must not be used, as it refers to the given string's buffer. In any case, its length can still be compared to 0 to evaluate success of the traversal.
Parameters
pathThe path to follow, starting with the node this pointer represents.
Returns
A pair of a cursor pointing to last child not of the existing portion of the given path , and a substring that contains the non-existing portion of a path, or is empty if the complete path existed.

Definition at line 1165 of file stringtree.hpp.

Here is the call graph for this function:

◆ Tree() [1/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
StringTree & Tree ( )
inline

Returns the three that this pointer is created of.

Returns
The tree that this object refers to.

Definition at line 1264 of file stringtree.hpp.

◆ Tree() [2/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
const StringTree & Tree ( ) const
inline

Returns the three that this pointer is created of.

Returns
The tree that this object refers to.

Definition at line 1276 of file stringtree.hpp.

◆ Value() [1/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
T & Value ( )

Retrieves a reference to the templated value of type T stored in the represented node.

Note
This method is only available if template parameter TConst is false.
Returns
The current node's value.

◆ Value() [2/2]

template<typename T , typename TNodeMaintainer = StringTreeNamesDynamic<character>, typename TRecycling = Recycling::Private>
template<bool TConst>
const T & Value ( ) const
inline

Retrieves a constant reference to the templated value of type T stored in the represented node.

Returns
The current node's value.

Definition at line 1304 of file stringtree.hpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: