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

Description:

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

Base struct of StringTree providing internals.

Note
The separation of the internals of class StringTree to this type in namespace detail has no benefit on compilation speed or other positive "technical" effect, nor is it a matter of software design.
A user of derived class HashTable finds all interface methods and types in one place, which is not cluttered by the documentation of the internals found here. Otherwise, the separation is exclusively supporting source code organization.
See also
For a description of the template parameters and a general introduction to the topic, se the reference documentation of the derived derived main class StringTree.

Definition at line 23 of file stringtreebase.inl.

Inheritance diagram for alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >:
[legend]
Collaboration diagram for alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >:
[legend]

Inner Type Index:

struct  Node
 
struct  NodeBase
 
struct  NodeKey
 
union  RootNodeSpacer
 
struct  TCursorBase
 

Public Type Index:

using CharacterType = typename TNodeHandler::CharacterType
 
using ConstCursorBase = TCursorBase<true>
 The constant version of type StringTreeBase::TCursorBase<TConst>.
 
using CursorBase = TCursorBase<false>
 The mutable version of type StringTreeBase::TCursorBase<TConst>.
 
using NameStorageType = typename TNodeHandler::NameStringType
 
using NameType = const strings::TString<CharacterType>
 The string-type of node names and paths if provided externally for comparison.
 
using NodeList = lang::BidiListHook<NodeBase>
 Alias shortcut for a bidirectional list of Node elements.
 
using SharedRecyclerType = typename decltype(nodeTable)::SharedRecyclerType
 
using SubstringType = typename strings::TSubstring<CharacterType>
 

Public Field Index:

int dbgRootDataSet = 0
 
HashTable< TAllocator, typename NodeKey::ValueDescriptor, typename NodeKey::Hash, typename NodeKey::EqualTo, lang::Caching::Enabled, TRecycling > nodeTable
 
RootNodeSpacer root
 The root node.
 
CharacterType separator
 

Public Method Index:

 StringTreeBase (TAllocator &allocator, CharacterType pathSeparator)
 
template<typename TSharedRecycler = SharedRecyclerType>
requires ( !std::same_as<TSharedRecycler , void> )
 StringTreeBase (TAllocator &allocator, TSharedRecycler &pRecycler, CharacterType pathSeparator)
 
template<typename TSharedRecycler = SharedRecyclerType>
requires (!std::same_as<TSharedRecycler, void>)
 StringTreeBase (TSharedRecycler &pRecycler, CharacterType pathSeparator)
 
bool checkChildName (const NameType &name) const
 
TAllocator & GetAllocator () noexcept
 

Type Definition Details:

◆ CharacterType

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::CharacterType = typename TNodeHandler::CharacterType

The character type of node names and paths strings. This is defined using character type definition CharacterType of template type TNodeHandler.

Definition at line 37 of file stringtreebase.inl.

◆ ConstCursorBase

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::ConstCursorBase = TCursorBase<true>

The constant version of type StringTreeBase::TCursorBase<TConst>.

Definition at line 672 of file stringtreebase.inl.

◆ CursorBase

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::CursorBase = TCursorBase<false>

The mutable version of type StringTreeBase::TCursorBase<TConst>.

Definition at line 669 of file stringtreebase.inl.

◆ NameStorageType

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::NameStorageType = typename TNodeHandler::NameStringType

The string-type of node names and paths. This is defined by NameStringType of template type TNodeHandler.

Definition at line 44 of file stringtreebase.inl.

◆ NameType

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::NameType = const strings::TString<CharacterType>

The string-type of node names and paths if provided externally for comparison.

Definition at line 40 of file stringtreebase.inl.

◆ NodeList

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::NodeList = lang::BidiListHook<NodeBase>

Alias shortcut for a bidirectional list of Node elements.

Definition at line 32 of file stringtreebase.inl.

◆ SharedRecyclerType

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::SharedRecyclerType = typename decltype(nodeTable)::SharedRecyclerType

This type definition may be used to define an externally managed shared recycler, which can be passed to the alternative constructor of this class when template parameter TRecycling equals Shared.

See also
Chapter 4.3 Shared Recycling of the Programmer's Manual for this ALib Module.

Definition at line 471 of file stringtreebase.inl.

◆ SubstringType

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
using alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::SubstringType = typename strings::TSubstring<CharacterType>

The substring-type of paths. This is defined using character type definition CharacterType of template type TNodeHandler.

Definition at line 48 of file stringtreebase.inl.

Field Details:

◆ dbgRootDataSet

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
int alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::dbgRootDataSet = 0

Flag available only in debug-compilations to detect access to root node's value without prior use of method ConstructRootValue. Also, the destructor issues a warning, in case the root node's value was not deleted with DestructRootValue.

Definition at line 448 of file stringtreebase.inl.

◆ nodeTable

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
HashTable< TAllocator, typename NodeKey::ValueDescriptor, typename NodeKey::Hash, typename NodeKey::EqualTo, lang::Caching::Enabled, TRecycling > alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::nodeTable

Hash set which contains all children of all nodes. This is used to find children of nodes by their parent/name combination.

Definition at line 463 of file stringtreebase.inl.

◆ root

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
RootNodeSpacer alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::root

The root node.

Definition at line 441 of file stringtreebase.inl.

◆ separator

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
CharacterType alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::separator

The separator character to use with path strings. This is set once with construction.

Definition at line 454 of file stringtreebase.inl.

Constructor(s) / Destructor Details:

◆ StringTreeBase() [1/3]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::StringTreeBase ( TAllocator & allocator,
CharacterType pathSeparator )
inline

Constructor.

Parameters
allocatorThe monotonic allocator to use.
pathSeparatorThe separation character used with path strings.

Definition at line 682 of file stringtreebase.inl.

◆ StringTreeBase() [2/3]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<typename TSharedRecycler = SharedRecyclerType>
requires ( !std::same_as<TSharedRecycler , void> )
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::StringTreeBase ( TAllocator & allocator,
TSharedRecycler & pRecycler,
CharacterType pathSeparator )
inline

Constructor taking a shared recycler.

Parameters
allocatorThe monotonic allocator to use.
pRecyclerThe shared recycler.
pathSeparatorThe separation character used with path strings.

Definition at line 695 of file stringtreebase.inl.

◆ StringTreeBase() [3/3]

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
template<typename TSharedRecycler = SharedRecyclerType>
requires (!std::same_as<TSharedRecycler, void>)
alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::StringTreeBase ( TSharedRecycler & pRecycler,
CharacterType pathSeparator )
inline

Constructor taking a shared recycler.

Parameters
pRecyclerThe shared recycler.
pathSeparatorThe separation character used with path strings.
Template Parameters
TSharedRecyclerUsed to select this constructor. Deduced by the compiler.

Definition at line 708 of file stringtreebase.inl.

Method Details:

◆ checkChildName()

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
bool alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::checkChildName ( const NameType & name) const
inline

Simple helper method which checks a node name for not being "." or ".." and for not containing a separator character. In debug-compilations, if it does, a warning is raised.

Parameters
nameThe child name to check.
Returns
true if the name is legal, false otherwise.

Definition at line 722 of file stringtreebase.inl.

◆ GetAllocator()

template<typename TAllocator, typename T, typename TNodeHandler, Recycling TRecycling>
TAllocator & alib::containers::detail::StringTreeBase< TAllocator, T, TNodeHandler, TRecycling >::GetAllocator ( )
inlinenoexcept
Returns
Returns the allocator received with construction.

Definition at line 714 of file stringtreebase.inl.


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