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

Description:

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
class alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >

This public, inner class can be used to recursively iterate through the nodes of outer class StringTree.
The type does not apply to the concept of std::iterator_traits. The rationale for this is the fact that mechanics for sorting the child nodes are provided, which requires allocation of more resources than usual container iterators do. Therefore, objects of this type are not supposed to be temporary and created "on the fly", e.g., in C++ range based loops. Instead, instances should rather be created once and then re-used with later iterations.

The sorting of child nodes is optional and can be changed before each recursion. A built-in comparison function which works on node names (path names) allows choosing ascending and descending order and to ignore or be sensitive about the letter case. Besides this, custom comparison functions that take a combination of arbitrary node attributes, including a node's value of template type T can be established. See overloaded methods SetSorting for details on this topic.

Objects of this type can be initialized, respectively reset to distinct start nodes by providing objects of

  • type StringTree,
  • type StringTree::Cursor or
  • other objects of this type itself,

to overloaded methods Initialize.

The maximum depth of recursion may be limited with optional parameter depth found with each overloaded version of Initialize. During the iteration, the recursion can be individually selected per node visited. This is done by using either of the methods Next or NextSibling to proceed. Furthermore, method NextParentSibling allows skipping the rest of the current iteration branch.
The end of an iteration is detected with the method IsValid.

The children of a node can be iterated in a sorted fashion. To enable and disable sorting, various overloads of SetSorting exist. These methods may be invoked any time during the iteration. Whenever a recursion in iteration occurs, the most recent settings of sorting are respected for the list of children of the node that is processed with that recursion.

Finally, the generation of a string representing the actual path to the current iteration node, relative to the iteration's start node can be activated. See method SetPathGeneration for mor e information about this feature.

See also
For more information on how this class is used, see paragraph 2.2 Inner Class RecursiveIterator of the description of class StringTree.

Friends

class StringTree

Definition at line 1702 of file stringtree.inl.

Collaboration diagram for alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >:
[legend]

Inner Type Index:

struct  RecursionData
 Protected, internal struct used to store the data of recursive iterations. More...
 

Public Method Index:

 TRecursiveIterator ()=default
 Default constructor.
 
 TRecursiveIterator (const TRecursiveIterator &)=default
 Trivial copy constructor.
 
 TRecursiveIterator (TRecursiveIterator &&)=default
 Trivial default move constructor.
 
 ~TRecursiveIterator ()=default
 Destructor.
 
int CurrentDepth () const
 
const NameTypeCurrentPath () const
 
uinteger DeleteNode ()
 
AStringFullPath (AString &target, lang::CurrentData targetData=lang::CurrentData::Clear) const
 
void Initialize (cmCursor cursor, unsigned int depth=(std::numeric_limits< unsigned int >::max)())
 
void Initialize (cmTree &pTree, unsigned int depth=(std::numeric_limits< unsigned int >::max)())
 
void Initialize (const TRecursiveIterator &other, unsigned int depth=(std::numeric_limits< unsigned int >::max)())
 
void Invalidate ()
 
bool IsInvalid () const
 
bool IsValid () const
 
bool Next ()
 
bool NextParentSibling ()
 
bool NextSibling ()
 
cmCursor Node () const
 
TRecursiveIteratoroperator= (const TRecursiveIterator &)=default
 
TRecursiveIteratoroperator= (TRecursiveIterator &&)=default
 
int RequestedDepth () const
 
void SetPathGeneration (lang::Switch pathGeneration)
 
void SetSorting (bool(*customSorterFunction)(const Cursor &, const Cursor &))
 
void SetSorting (lang::SortOrder order=lang::SortOrder::Ascending, lang::Case sensitivity=lang::Case::Ignore)
 
void SetSorting (lang::Switch sorting)
 

Protected Type Index:

using cmCursor = std::conditional_t<!TConst, Cursor , ConstCursor>
 
using cmNode = std::conditional_t<!TConst, baseNode , const baseNode>
 
using cmNodeBase = std::conditional_t<!TConst, baseNodeBase, const baseNodeBase>
 
using cmTree = std::conditional_t<!TConst, StringTree , const StringTree>
 

Protected Field Index:

size_t actDepth = size_t(-1)
 
AString actPath
 
bool(* nextCustomSorter )(const cmCursor &, const cmCursor &) = nullptr
 A pointer to a user-defined comparison function.
 
bool nextIsSorting = false
 Denotes if the children are iterated in a sorting fashion or not.
 
bool nextSortingIsCaseSensitive = false
 The case sensitivity of the sort (used with built-in sorting by node name).
 
bool nextSortingIsDescending = false
 The sort order (used with built-in sorting by node name).
 
cmNodenode
 The pointer to the actual node.
 
unsigned int recursionDepth =(std::numeric_limits<unsigned int>::max)()
 The requested depth of iteration recursion.
 
std::vector< RecursionDatastack
 
cmTreetree = nullptr
 The StringTree this iterator belongs to.
 

Protected Method Index:

void initialize (cmTree *pTree, cmNode *newnode, unsigned int depth)
 
bool next (int skipMode)
 
void recursion ()
 

Type Definition Details:

◆ cmCursor

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
using alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::cmCursor = std::conditional_t<!TConst, Cursor , ConstCursor>
protected

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

Definition at line 1727 of file stringtree.inl.

◆ cmNode

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
using alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::cmNode = std::conditional_t<!TConst, baseNode , const baseNode>
protected

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

Definition at line 1723 of file stringtree.inl.

◆ cmNodeBase

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
using alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::cmNodeBase = std::conditional_t<!TConst, baseNodeBase, const baseNodeBase>
protected

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

Definition at line 1719 of file stringtree.inl.

◆ cmTree

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
using alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::cmTree = std::conditional_t<!TConst, StringTree , const StringTree>
protected

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

Definition at line 1715 of file stringtree.inl.

Field Details:

◆ actDepth

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
size_t alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::actDepth = size_t(-1)
protected

The current depth of the iteration (and usage but not size of field stack). set to -1 to if iteration is finished, respectively this iterator was not initialized.

Definition at line 1819 of file stringtree.inl.

◆ actPath

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
AString alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::actPath
protected

The path to the actual node (excluding the name of the actual node). If this object is nulled, no paths are generated.

Definition at line 1823 of file stringtree.inl.

◆ nextCustomSorter

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool(* alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::nextCustomSorter) (const cmCursor &, const cmCursor &) = nullptr
protected

A pointer to a user-defined comparison function.

Definition at line 1829 of file stringtree.inl.

◆ nextIsSorting

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::nextIsSorting = false
protected

Denotes if the children are iterated in a sorting fashion or not.

Definition at line 1832 of file stringtree.inl.

◆ nextSortingIsCaseSensitive

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::nextSortingIsCaseSensitive = false
protected

The case sensitivity of the sort (used with built-in sorting by node name).

Definition at line 1838 of file stringtree.inl.

◆ nextSortingIsDescending

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::nextSortingIsDescending = false
protected

The sort order (used with built-in sorting by node name).

Definition at line 1835 of file stringtree.inl.

◆ node

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
cmNode* alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::node
protected

The pointer to the actual node.

Definition at line 1808 of file stringtree.inl.

◆ recursionDepth

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
unsigned int alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::recursionDepth =(std::numeric_limits<unsigned int>::max)()
protected

The requested depth of iteration recursion.

Definition at line 1826 of file stringtree.inl.

◆ stack

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
std::vector<RecursionData> alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::stack
protected

A stack holding the recursive list of unsorted or sorted children and the hook to the current child. Implemented as a vector in combination with member actDepth, to reuse allocated storage space during iteration and when this iterator is re-used (freshly initialized).

Definition at line 1814 of file stringtree.inl.

◆ tree

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
cmTree* alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::tree = nullptr
protected

The StringTree this iterator belongs to.

Definition at line 1805 of file stringtree.inl.

Method Details:

◆ CurrentDepth()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
int alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::CurrentDepth ( ) const
inline

Returns the depth of the current iteration. This is value is available to the algorithm which means this method executes in constant time.

To get the absolute depth of the current node, method TCursor::Depth may be used.

Returns
The distance of the current node and the node of the start of the iteration.

Definition at line 2105 of file stringtree.inl.

◆ CurrentPath()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
const NameType & alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::CurrentPath ( ) const
inline

Retrieves the current path of walking as a string representation. The path returned is relative to the start node and does not contain a leading separator character. Also, it does not contain the name of the current node, which can be received by invoking method TCursor::Name on the cursor returned by method Node.

Note that this method can be used only if path generation was activated before the current iteration. Activation is performed with method SetPathGeneration.

Returns
The path of the current node.

Definition at line 2057 of file stringtree.inl.

◆ DeleteNode()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
uinteger alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::DeleteNode ( )
inline

Deletes the node that this iterator currently refers to from the tree. After the operation, the iterator is moved forward to the next sibling of the current node, respectively of the first sibling found in the recursion stack.

Note
This method constitutes a legal alternative to method TCursor::Delete, which is forbidden to be invoked on the node returned by method Node as this would invalidate this iterator.

Methods TCursor::DeleteChild and TCursor::DeleteChildren are allowed with this iterator type. Consequently, no replacement method for those is given with this class.

Returns
The total number of nodes deleted.

Definition at line 2147 of file stringtree.inl.

◆ FullPath()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
AString & alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::FullPath ( AString & target,
lang::CurrentData targetData = lang::CurrentData::Clear ) const
inline

Writes the results of CurrentPath and TCursor::Name, separated by the separator character TSeparator.

Note that this method can be used only if path generation was activated before the current iteration. Activation is performed with method SetPathGeneration.

Parameters
targetThe target to append the path to.
targetDataDenotes whether target should be cleared before appending the path. Defaults to CurrentData::Clear.
Returns
The given string to allow concatenated operations

Definition at line 2074 of file stringtree.inl.

◆ Initialize() [1/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Initialize ( cmCursor cursor,
unsigned int depth = (std::numeric_limits<unsigned int>::max)() )
inline

Resets this iterator to the first child of the node that the given cursor object represents. If the cursor is invalid, the root node of the tree it represents is used.

If the given node has no children, this iterator is marked invalid when this method returns.

Optional parameter depth allows limiting the recursion depth.

Parameters
cursorThe cursor to define the branch of the tree to iterate.
depthSets the recursion depth. A depth of 0 iterates only the direct children of the node represented by cursor. Defaults to std::numeric_limits<unsigned int>::max() for "unlimited" recursion.

Definition at line 1912 of file stringtree.inl.

◆ Initialize() [2/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Initialize ( cmTree & pTree,
unsigned int depth = (std::numeric_limits<unsigned int>::max)() )
inline

Resets this iterator to work with the given StringTree. Initializes recursive iteration to the tree's root node. Optionally, a recursion depth can be set.

Parameters
pTreeThe StringTree to use.
depthSets the recursion depth. A depth of 0 iterates only the direct children of the root node. Defaults to std::numeric_limits<unsigned int>::max() for "unlimited" recursion.

Definition at line 1891 of file stringtree.inl.

◆ Initialize() [3/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Initialize ( const TRecursiveIterator< TConst > & other,
unsigned int depth = (std::numeric_limits<unsigned int>::max)() )
inline

Resets this iterator to the first child of the node that the given other iterator currently refers to. The given iterator has to be in a valid state. Optionally, a recursion depth can be set.

Parameters
otherThe iterator whose current node becomes the start node for this iterator.
depthSets the recursion depth. A depth of 0 iterates only the direct children of the node represented by other. Defaults to std::numeric_limits<unsigned int>::max() for "unlimited" recursion.

Definition at line 1931 of file stringtree.inl.

◆ initialize()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::initialize ( cmTree * pTree,
cmNode * newnode,
unsigned int depth )
inlineprotected

Resets this iterator to represent to the given node of the given tree.

Parameters
pTreeThe tree to iterate on.
newnodeThe new node to start the iteration from.
depthThe requested recursion depth.

Definition at line 2163 of file stringtree.inl.

◆ Invalidate()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Invalidate ( )
inline

Invalidates this object. After invoking this method, this iterator cannot be used further, until one of the overloaded methods Initialize is invoked. After the invocation, method IsValid will return false.

Definition at line 1940 of file stringtree.inl.

◆ IsInvalid()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::IsInvalid ( ) const
inline

The negation of IsValid.

Returns
false if this is a valid iterator. If invalid, true is returned and the iterator must not be evaluated before being initialized.

Definition at line 1961 of file stringtree.inl.

◆ IsValid()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::IsValid ( ) const
inline

Determines if this is a valid. RecursiveIterator instances may become invalid after invocations of one of the methods Next, NextSibling or NextParentSibling (at the end of the iteration) and become valid with the invocation of one of the overloaded methods Initialize.

Returns
true if this is a valid iterator. If invalid, false is returned and the iterator must not be evaluated before being initialized.

Definition at line 1952 of file stringtree.inl.

◆ Next()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Next ( )
inline

Iterates to the first child of the current node. If no such child exists, to the next sibling node. If also no sibling exists, iteration continues with the next available node of a previous recursion level.

Returns
true if a next node was found, false otherwise. If false is returned, this iterator is invalid after the call.

Definition at line 2026 of file stringtree.inl.

◆ next()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::next ( int skipMode)
inlineprotected

Goes to the next node. This method is used with interface methods Next, NextSibling and NextParentSibling, as well as with DeleteNode}.

Parameters
skipMode0 iterates to the first child (if available), 1 iterates to the next sibling (if available) and 2 to the next available sibling of the parent, respectively the current recursion stack.
Returns
true if this iterator is valid (a next node was found), false otherwise.

Definition at line 2260 of file stringtree.inl.

◆ NextParentSibling()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::NextParentSibling ( )
inline

Skips the remaining siblings of the current recursion level and continues with the next available sibling of a previous level.

Returns
true if a next node was found, false otherwise. If false is returned, this iterator is invalid after the call.

Definition at line 2043 of file stringtree.inl.

◆ NextSibling()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
bool alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::NextSibling ( )
inline

Omits recursion on the current node's children, even if the current depth is lower than RequestedDepth.

If no sibling exists, iteration continues with the next available node of a previous recursion level.

Returns
true if a next node was found, false otherwise. If false is returned, this iterator is invalid after the call.

Definition at line 2036 of file stringtree.inl.

◆ Node()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
cmCursor alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::Node ( ) const
inline

Returns the current node, encapsulated in a cursor object.

Note
It is not allowed to use method TCursor::Delete on the node returned by this method. As a replacement, use method DeleteNode implemented in this class.
However, methods TCursor::DeleteChild and TCursor::DeleteChildren are allowed to be invoked and therefore have no replacement in this class.
Returns
An instance of the public node interface pointing to the currently referenced tree node.

Definition at line 2123 of file stringtree.inl.

◆ operator=() [1/2]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
TRecursiveIterator & alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::operator= ( const TRecursiveIterator< TConst > & )
default

Trivial default copy assign operator.

Returns
A reference to this.

◆ operator=() [2/2]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
TRecursiveIterator & alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::operator= ( TRecursiveIterator< TConst > && )
default

Trivial default move assign operator.

Returns
A reference to this.

◆ recursion()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::recursion ( )
inlineprotected

Sets this iterator to point to the first child of the actual node. If sorting is enabled, copies all children from the map to a vector and sorts them there.

Definition at line 2188 of file stringtree.inl.

◆ RequestedDepth()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
int alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::RequestedDepth ( ) const
inline

Returns the requested maximum depth of iteration, set with Initialize.

See also
For the current iteration depth, use CurrentDepth.
Returns
The distance of the current node and the node of the start of the iteration.

Definition at line 2096 of file stringtree.inl.

◆ SetPathGeneration()

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::SetPathGeneration ( lang::Switch pathGeneration)
inline

With this method, the assembly of a string representing the path from the node used to initialize this iterator to the actual node, is activated or deactivated.
If activated, the path to the current node can be received using overloaded methods CurrentPath and FullPath.

The invocation of the method invalidates this iterator. Note that the path generation can be enabled and disabled with the optional parameter of the overloaded Initialize methods.

Parameters
pathGenerationDenotes whether the path should be generated or not.

Definition at line 1875 of file stringtree.inl.

◆ SetSorting() [1/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::SetSorting ( bool(* customSorterFunction )(const Cursor &, const Cursor &))
inline

Sets the sorting of children by their template value, using the given callback function.

See also
For more details on sorting see method SetSorting(lang::Switch sorting).
Parameters
customSorterFunctionA custom comparison method used for sorting the children of nodes.

Definition at line 2014 of file stringtree.inl.

◆ SetSorting() [2/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::SetSorting ( lang::SortOrder order = lang::SortOrder::Ascending,
lang::Case sensitivity = lang::Case::Ignore )
inline

Sets the sorting of children by their path name, using the built-in comparison methods, which in turn use method String::Equals.

See also
For more details on sorting see method SetSorting(lang::Switch sorting).
Parameters
orderThe sort order. Defaults to SortOrder::Ascending.
sensitivityThe case sensitivity when comparing path names. Defaults to Case::Ignore.

Definition at line 1997 of file stringtree.inl.

◆ SetSorting() [3/3]

template<typename TAllocator, typename T, typename TNodeHandler = StringTreeNamesDynamic<character>, Recycling TRecycling = Recycling::Private>
template<bool TConst>
void alib::containers::StringTree< TAllocator, T, TNodeHandler, TRecycling >::TRecursiveIterator< TConst >::SetSorting ( lang::Switch sorting)
inline

Allows switching sorting on or off. If switched on, sorting is performed by the node names in ascending order.

This and the overloaded versions of this method may be invoked at any time, even on invalid iterators and those that are not initialized. All that the methods do is store the given parameters for future use. Such a use happens whenever a recursive iteration over a list of child nodes is started. At that moment the current configuration of sorting is applied to the list of direct children.

Parameters
sortingThe switch value.

Definition at line 1978 of file stringtree.inl.


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