ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Types | Inner Classes | Public Fields | Public Methods | List of all members
StringTreeBase< T, TNodeMaintainer, TRecycling > Struct Template Reference
Inheritance diagram for StringTreeBase< T, TNodeMaintainer, TRecycling >:
[legend]
Collaboration diagram for StringTreeBase< T, TNodeMaintainer, TRecycling >:
[legend]

Class Description

template<typename T, typename TNodeMaintainer, typename TRecycling>
struct aworx::lib::monomem::detail::StringTreeBase< T, TNodeMaintainer, 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.
Template Parameters
TSee template parameters of derived public type.
TNodeMaintainerSee template parameters of derived public type.
TRecyclingSee template parameters of derived public type.

Definition at line 70 of file stringtreebase.inl.

Public Types

using CharacterType = typename TNodeMaintainer::CharacterType
 
using NameType = typename TNodeMaintainer::NameStringType
 
using NodeList = lib::detail::BidiListHelper< Node >
 
using SubstringType = typename strings::TSubstring< CharacterType >
 
using TSharedRecycler = typename decltype(nodeTable)::TSharedRecycler
 
using ValueType = typename strings::TString< typename TNodeMaintainer::CharacterType >
 

Inner Classes

struct  Node
 
struct  NodeKey
 
struct  NodePtrBase
 

Public Fields

monomem::HashTable< Node, Node, NodeKey, void, typename NodeKey::Hash, typename NodeKey::EqualTo, typename NodeKey::Access, Caching::Enabled, TRecycling > nodeTable
 
Node root
 
CharacterType separator
 

Public Methods

template<typename... TArgs>
 StringTreeBase (MonoAllocator *allocator, CharacterType pathSeparator, TArgs &&... args)
 
template<typename... TArgs>
 StringTreeBase (MonoAllocator *allocator, TSharedRecycler &pRecycler, CharacterType pathSeparator, TArgs &&... args)
 
bool checkChildName (const NameType &name)
 

Member Typedef Documentation

◆ CharacterType

using CharacterType = typename TNodeMaintainer::CharacterType

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

Definition at line 86 of file stringtreebase.inl.

◆ NameType

using NameType = typename TNodeMaintainer::NameStringType

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

Definition at line 90 of file stringtreebase.inl.

◆ NodeList

Alias shortcut for a bidirectional list of Node elements.

Definition at line 78 of file stringtreebase.inl.

◆ SubstringType

The sub-string type of paths. This is defined using character type definition CharacterType of template type TNodeMaintainer.

Definition at line 94 of file stringtreebase.inl.

◆ TSharedRecycler

using TSharedRecycler = typename decltype(nodeTable)::TSharedRecycler

The recycler type. See StringTree::TSharedRecycler which exposes this type publicly.

Definition at line 449 of file stringtreebase.inl.

◆ ValueType

using ValueType = typename strings::TString<typename TNodeMaintainer::CharacterType>

The string type of node names and paths.

Definition at line 81 of file stringtreebase.inl.

Constructor & Destructor Documentation

◆ StringTreeBase() [1/2]

StringTreeBase ( MonoAllocator allocator,
CharacterType  pathSeparator,
TArgs &&...  args 
)
inline

Constructor.

Template Parameters
TArgsTypes of variadic parameters given with parameter args.
Parameters
allocatorThe monotonic allocator to use.
pathSeparatorThe separation character used with path strings.
argsVariadic parameters to be forwarded to constructor of custom type T of this tree's root node.

Definition at line 650 of file stringtreebase.inl.

◆ StringTreeBase() [2/2]

StringTreeBase ( MonoAllocator allocator,
TSharedRecycler pRecycler,
CharacterType  pathSeparator,
TArgs &&...  args 
)
inline

Constructor taking a shared recycler.

Template Parameters
TArgsTypes of variadic parameters given with parameter args.
Parameters
allocatorThe monotonic allocator to use.
pRecyclerThe shared recycler.
pathSeparatorThe separation character used with path strings.
argsVariadic parameters to be forwarded to constructor of custom type T of this tree's root node.

Definition at line 672 of file stringtreebase.inl.

Member Function Documentation

◆ checkChildName()

bool checkChildName ( const NameType name)
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, an ALib warning is raised.

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

Definition at line 687 of file stringtreebase.inl.

Member Data Documentation

◆ nodeTable

monomem::HashTable<Node, Node, NodeKey, void, typename NodeKey::Hash, typename NodeKey::EqualTo, typename NodeKey::Access, Caching::Enabled, TRecycling > nodeTable

The child node hash set. This is used to find children of nodes by name. The set contains all children of all nodes.

Definition at line 445 of file stringtreebase.inl.

◆ root

Node root

The root node.

Definition at line 425 of file stringtreebase.inl.

◆ separator

CharacterType separator

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

Definition at line 431 of file stringtreebase.inl.


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