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

Description:

template<typename T, typename TNodeMaintainer, typename TRecycling>
template<bool TConst>
struct alib::monomem::detail::StringTreeBase< T, TNodeMaintainer, TRecycling >::TCursorBase< TConst >

Base class for StringTree::Cursor

Template Parameters
TConstIf true, internal fields representing the StringTree and the current Node become const and method followPathCreate becomes unavailable.

Definition at line 560 of file stringtreebase.inl.

Public Type Index:

using cmNode = ATMP_IF_T_F(!TConst, NodeBase, const NodeBase )
 
using cmTree = ATMP_IF_T_F(!TConst, StringTreeBase, const StringTreeBase )
 

Public Field Index:

cmNodenode
 
cmTreetree
 

Public Method Index:

 TCursorBase () noexcept
 
 TCursorBase (cmTree *pTree, cmNode *pNode) noexcept
 
 TCursorBase (const TCursorBase &) noexcept=default
 
 TCursorBase (TCursorBase &&) noexcept=default
 
 ~TCursorBase () noexcept=default
 
cmNodefollowPath (SubstringType &path) const
 
template<typename... TArgs, bool TEnableIf = !TConst>
std::pair< cmNode *, integerfollowPathCreate (const NameType &path, TArgs &&... args)
 
TCursorBaseoperator= (const TCursorBase &) noexcept=default
 
TCursorBaseoperator= (TCursorBase &&) noexcept=default
 

Type Definition Details:

◆ cmNode

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
using cmNode = ATMP_IF_T_F(!TConst, NodeBase, const NodeBase )

Constant or mutable version of type NodeBase, depending on template parameter TConst

Definition at line 566 of file stringtreebase.inl.

◆ cmTree

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
using cmTree = ATMP_IF_T_F(!TConst, StringTreeBase, const StringTreeBase )

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

Definition at line 563 of file stringtreebase.inl.

Field Details:

◆ node

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
cmNode* node

The currently represented node of the tree.

Definition at line 573 of file stringtreebase.inl.

◆ tree

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
cmTree* tree

The StringTree this object refers to.

Definition at line 570 of file stringtreebase.inl.

Constructor(s) / Destructor Details::

◆ TCursorBase() [1/4]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase ( cmTree * pTree,
cmNode * pNode )
inlinenoexcept

Constructor initializing both fields tree and node.

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

Definition at line 580 of file stringtreebase.inl.

◆ TCursorBase() [2/4]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase ( )
inlinenoexcept

Default constructor. Creates an invalid (uninitialized) object.

Definition at line 586 of file stringtreebase.inl.

◆ TCursorBase() [3/4]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase ( const TCursorBase< TConst > & )
defaultnoexcept

Trivial default copy constructor.

◆ TCursorBase() [4/4]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase ( TCursorBase< TConst > && )
defaultnoexcept

Trivial default move constructor.

◆ ~TCursorBase()

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
~TCursorBase ( )
defaultnoexcept

Trivial default destructor.

Method Details:

◆ followPath()

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
cmNode * followPath ( SubstringType & path) const
inline

Finds a child node along the path given, but does not create new nodes. Incomplete results may occur if a child along the path was not found. In this case, parameter path contains the remaining path, excluding a leading separator.

A leading slash (aka TSeparator ) allows absolute path addressing, which means the root of node is searched if a leading separator is found.

Besides normal child names, this method accepts

  • multiple separator characters (ignored)
  • child name "." (ignored)
  • child name ".." for parent node
Parameters
[in,out]pathCreation path. Provided as reference and consumed as far as the path exits.
Returns
The node found

Definition at line 627 of file stringtreebase.inl.

Here is the call graph for this function:

◆ followPathCreate()

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
template<typename... TArgs, bool TEnableIf = !TConst>
std::pair< cmNode *, integer > followPathCreate ( const NameType & path,
TArgs &&... args )

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

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

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

Note
This method is only available if template parameter TConst is false.
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 Node* and the number of nodes created.

◆ operator=() [1/2]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase & operator= ( const TCursorBase< TConst > & )
defaultnoexcept

Trivial default copy assign operator.

Returns
A reference to this.

◆ operator=() [2/2]

template<typename T , typename TNodeMaintainer , typename TRecycling >
template<bool TConst>
TCursorBase & operator= ( TCursorBase< TConst > && )
defaultnoexcept

Trivial default move assign operator.

Returns
A reference to this.

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