BDE 4.39.x Production Release
Loading...
Searching...
No Matches
ball::CategoryManager_RadixTree_Node< t_VALUE > Class Template Reference

#include <ball_categorymanager_radixtree.h>

Detailed Description

template<class t_VALUE>
class ball::CategoryManager_RadixTree_Node< t_VALUE >

This class template represents a node in the radix tree. Each node stores a prefix string, an optional value, and child nodes mapped with their prefix-part starting character. As the second underscore in the class name indicates, this is a component-local class not intended for use outside of

See ball_categorymanager_radixtree

Public Types

typedef bsl::map< char, CategoryManager_RadixTree_NodeChildren
 
typedef bsl::allocator allocator_type
 

Public Member Functions

 CategoryManager_RadixTree_Node (const bsl::string_view &prefix, const allocator_type &allocator=allocator_type())
 
 CategoryManager_RadixTree_Node (const CategoryManager_RadixTree_Node &original)
 
 CategoryManager_RadixTree_Node (const CategoryManager_RadixTree_Node &original, const allocator_type &allocator)
 
 CategoryManager_RadixTree_Node (bslmf::MovableRef< CategoryManager_RadixTree_Node > original) BSLS_KEYWORD_NOEXCEPT
 
 CategoryManager_RadixTree_Node (bslmf::MovableRef< CategoryManager_RadixTree_Node > original, const allocator_type &allocator)
 
CategoryManager_RadixTree_Nodeoperator= (const CategoryManager_RadixTree_Node &rhs)
 
CategoryManager_RadixTree_Nodeoperator= (bslmf::MovableRef< CategoryManager_RadixTree_Node > rhs)
 
Childrenchildren ()
 
bsl::stringprefix ()
 
void swap (CategoryManager_RadixTree_Node &other)
 
bsl::optional< t_VALUE > & value ()
 
const Childrenchildren () const
 
const bsl::stringprefix () const
 
const bsl::optional< t_VALUE > & value () const
 
allocator_type get_allocator () const
 

Member Typedef Documentation

◆ allocator_type

template<class t_VALUE >
typedef bsl::allocator ball::CategoryManager_RadixTree_Node< t_VALUE >::allocator_type

◆ Children

template<class t_VALUE >
typedef bsl::map<char, CategoryManager_RadixTree_Node> ball::CategoryManager_RadixTree_Node< t_VALUE >::Children

Child nodes mapped by the starting their starting character of their prefix-part.

Constructor & Destructor Documentation

◆ CategoryManager_RadixTree_Node() [1/5]

template<class t_VALUE >
ball::CategoryManager_RadixTree_Node< t_VALUE >::CategoryManager_RadixTree_Node ( const bsl::string_view prefix,
const allocator_type allocator = allocator_type() 
)
inlineexplicit

Create a CategoryManager_RadixTree_Node object with the specified prefix and no value. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

◆ CategoryManager_RadixTree_Node() [2/5]

template<class t_VALUE >
ball::CategoryManager_RadixTree_Node< t_VALUE >::CategoryManager_RadixTree_Node ( const CategoryManager_RadixTree_Node< t_VALUE > &  original)
inline

Create a CategoryManager_RadixTree_Node object having the same value as the specified original object. Use the default allocator to supply memory for this object.

◆ CategoryManager_RadixTree_Node() [3/5]

template<class t_VALUE >
ball::CategoryManager_RadixTree_Node< t_VALUE >::CategoryManager_RadixTree_Node ( const CategoryManager_RadixTree_Node< t_VALUE > &  original,
const allocator_type allocator 
)
inline

Create a CategoryManager_RadixTree_Node object having the same value as the specified original object, and use the specified allocator to supply memory for this new object.

◆ CategoryManager_RadixTree_Node() [4/5]

template<class t_VALUE >
ball::CategoryManager_RadixTree_Node< t_VALUE >::CategoryManager_RadixTree_Node ( bslmf::MovableRef< CategoryManager_RadixTree_Node< t_VALUE > >  original)
inline

Create a CategoryManager_RadixTree_Node object having the same value as the specified original object by moving (in amortized constant time) the contents of original to the newly-created object. The allocator associated with original is propagated for use in the newly-created object. original is left in a valid but unspecified state.

◆ CategoryManager_RadixTree_Node() [5/5]

template<class t_VALUE >
ball::CategoryManager_RadixTree_Node< t_VALUE >::CategoryManager_RadixTree_Node ( bslmf::MovableRef< CategoryManager_RadixTree_Node< t_VALUE > >  original,
const allocator_type allocator 
)
inline

Create a CategoryManager_RadixTree_Node object having the same value as the specified original object, and use the specified allocator to supply memory for this new object. The contents of original are moved (in amortized constant time) to the newly-created object if allocator == original.get_allocator(), and are move-inserted (in linear time) using allocator otherwise. original is left in a valid but unspecified state.

Member Function Documentation

◆ children() [1/2]

template<class t_VALUE >
CategoryManager_RadixTree_Node< t_VALUE >::Children & ball::CategoryManager_RadixTree_Node< t_VALUE >::children ( )
inline

Return a reference providing modifiable access to the child nodes of this node.

◆ children() [2/2]

template<class t_VALUE >
const CategoryManager_RadixTree_Node< t_VALUE >::Children & ball::CategoryManager_RadixTree_Node< t_VALUE >::children ( ) const
inline

Return a reference providing non-modifiable access to the child nodes of this node.

◆ get_allocator()

template<class t_VALUE >
CategoryManager_RadixTree_Node< t_VALUE >::allocator_type ball::CategoryManager_RadixTree_Node< t_VALUE >::get_allocator ( ) const
inline

Return the allocator used by this object to supply memory.

◆ operator=() [1/2]

template<class t_VALUE >
CategoryManager_RadixTree_Node< t_VALUE > & ball::CategoryManager_RadixTree_Node< t_VALUE >::operator= ( bslmf::MovableRef< CategoryManager_RadixTree_Node< t_VALUE > >  rhs)
inline

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. The contents of rhs are moved (in amortized constant time) to this object if get_allocator() == rhs.get_allocator(); otherwise, all elements in this object are either destroyed or move-assigned to, and each additional element in rhs is move-inserted into this object. rhs is left in a valid but unspecified state.

◆ operator=() [2/2]

template<class t_VALUE >
CategoryManager_RadixTree_Node< t_VALUE > & ball::CategoryManager_RadixTree_Node< t_VALUE >::operator= ( const CategoryManager_RadixTree_Node< t_VALUE > &  rhs)
inline

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

◆ prefix() [1/2]

template<class t_VALUE >
bsl::string & ball::CategoryManager_RadixTree_Node< t_VALUE >::prefix ( )
inline

Return a reference providing modifiable access to the prefix string of this node.

Note
Note that only a part of the prefix is stored in a node; the full key is obtained by concatenating the prefixes of all nodes.

◆ prefix() [2/2]

template<class t_VALUE >
const bsl::string & ball::CategoryManager_RadixTree_Node< t_VALUE >::prefix ( ) const
inline

Return a reference providing non-modifiable access to the prefix string of this node.

◆ swap()

template<class t_VALUE >
void ball::CategoryManager_RadixTree_Node< t_VALUE >::swap ( CategoryManager_RadixTree_Node< t_VALUE > &  other)

Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee if the two objects were created with the same allocator; otherwise, it provides the strong guarantee.

◆ value() [1/2]

template<class t_VALUE >
bsl::optional< t_VALUE > & ball::CategoryManager_RadixTree_Node< t_VALUE >::value ( )
inline

Return a reference providing modifiable access to the optional value of this node.

◆ value() [2/2]

template<class t_VALUE >
const bsl::optional< t_VALUE > & ball::CategoryManager_RadixTree_Node< t_VALUE >::value ( ) const
inline

Return a reference providing non-modifiable access to the optional value of this node.


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