ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst > Struct Template Reference

Description:

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
struct alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >

Base class for StringTree::Cursor

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

Definition at line 481 of file stringtreebase.inl.

Public Type Index:

using cmNode = std::conditional_t<!TConst, Node, const Node>
 Constant or mutable version of type Node, depending on template parameter TConst
 
using cmNodeBase = std::conditional_t<!TConst, NodeBase, const NodeBase>
 Constant or mutable version of type NodeBase, depending on template parameter TConst
 
using cmTree = std::conditional_t<!TConst, StringTreeBase, const StringTreeBase>
 Constant or mutable version of the base tree type, depending on template parameter TConst
 

Public Field Index:

cmNodenode
 The currently represented node of the tree.
 
cmTreetree
 The StringTree this object refers to.
 

Public Method Index:

 TCursorBase () noexcept
 Default constructor. Creates an invalid (uninitialized) object.
 
 TCursorBase (cmTree *pTree, cmNode *pNode) noexcept
 
 TCursorBase (const TCursorBase &) noexcept=default
 Trivial default copy constructor.
 
 TCursorBase (TCursorBase &&) noexcept=default
 Trivial default move constructor.
 
 ~TCursorBase () noexcept=default
 Trivial default destructor.
 
cmNodefollowPath (SubstringType &path) const
 
template<typename... TArgs, bool TRequires = !TConst>
requires TRequires
std::pair< cmNodeBase *, integerfollowPathCreate (const NameType &path, TArgs &&... args)
 
TCursorBaseoperator= (const TCursorBase &) noexcept=default
 
TCursorBaseoperator= (TCursorBase &&) noexcept=default
 

Type Definition Details:

◆ cmNode

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::cmNode = std::conditional_t<!TConst, Node, const Node>

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

Definition at line 490 of file stringtreebase.inl.

◆ cmNodeBase

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::cmNodeBase = std::conditional_t<!TConst, NodeBase, const NodeBase>

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

Definition at line 487 of file stringtreebase.inl.

◆ cmTree

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::cmTree = std::conditional_t<!TConst, StringTreeBase, const StringTreeBase>

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

Definition at line 484 of file stringtreebase.inl.

Field Details:

◆ node

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
cmNode* alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::node

The currently represented node of the tree.

Definition at line 497 of file stringtreebase.inl.

◆ tree

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
cmTree* alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::tree

The StringTree this object refers to.

Definition at line 494 of file stringtreebase.inl.

Constructor(s) / Destructor Details:

◆ TCursorBase() [1/2]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< 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 502 of file stringtreebase.inl.

◆ TCursorBase() [2/2]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::TCursorBase ( )
inlinenoexcept

Default constructor. Creates an invalid (uninitialized) object.

Definition at line 508 of file stringtreebase.inl.

Method Details:

◆ followPath()

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
cmNode * alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::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 547 of file stringtreebase.inl.

◆ followPathCreate()

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
template<typename... TArgs, bool TRequires = !TConst>
requires TRequires
std::pair< cmNodeBase *, integer > alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::followPathCreate ( 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 followPath.

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

Note
This method is only available if the template parameter TConst of this type is false.
Template Parameters
TRequiresDefaulted template parameter. Must not be specified.
TArgsTypes of variadic parameters given with parameter args.
Parameters
pathThe path to move along.
argsVariadic parameters to be forwarded to the constructor of each node that is created.
Returns
A std::pair containing a resulting Node* and the number of nodes created.

Definition at line 614 of file stringtreebase.inl.

◆ operator=() [1/2]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
TCursorBase & alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::operator= ( const TCursorBase< TConst > & )
defaultnoexcept

Trivial default copy assign operator.

Returns
A reference to this.

◆ operator=() [2/2]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<bool TConst>
TCursorBase & alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::TCursorBase< TConst >::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: