The node type contained in the object trie. More...
#include <ObjectTrie.hpp>
Static Public Member Functions | |
static ObjectAdder | child (T &&value) |
Add a child of the child being added. More... | |
template<typename ... ObjectAdderT> | |
static ObjectAdder | child (T &&value, ObjectAdderT &&... childAdder) |
Add a child of the child being added, plus descendants of the child. More... | |
Public Member Functions | |
template<typename ... ObjectAdderT> | |
ObjectTrieNode< T > & | add (T &&value, ObjectAdderT &&... childAdder) |
Append a list of children to the node. More... | |
ObjectTrieNode< T > & | add (std::vector< ObjectAdder > &&childAdders) |
Append a vector of children to the node. More... | |
ObjectTrieNode< T > & | add (T &&value) |
Append a child containing the supplied data. More... | |
ObjectTrieNode< T > & | add (const T &value) |
Append a child containing the supplied data. More... | |
ObjectTrieNode< T > & | addAndReturnChild (const T &value) |
Append a child containing a copy of the supplied data. More... | |
ObjectTrieNode< T > & | addAndReturnChild (T &&value) |
Append a child containing the supplied data. More... | |
ObjectTrieNode< T > & | addOrReplace (T &&value) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
ObjectTrieNode< T > & | addOrReplace (const T &value) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT > | |
ObjectTrieNode< T > & | addOrReplace (T &&value, CompareT compare) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT > | |
ObjectTrieNode< T > & | addOrReplace (const T &value, CompareT compare) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT , typename ReplaceT , ReplaceT replace> | |
ObjectTrieNode< T > & | addOrReplace (T &&value, CompareT compare) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT , typename ReplaceT > | |
ObjectTrieNode< T > & | addOrReplace (const T &value, CompareT compare, ReplaceT replace) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (const T &value) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (T &&value) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT > | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (const T &value, CompareT compare) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT > | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (T &&value, CompareT compare) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT , typename ReplaceT > | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (const T &value, CompareT compare, ReplaceT replace) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
template<typename CompareT , typename ReplaceT > | |
ObjectTrieNode< T > & | addOrReplaceAndReturnChild (T &&value, CompareT compare, ReplaceT replace) |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it. More... | |
ObjectTrieNode< T > * | begin () |
Get a depth iterator positioned at the beginning of the trie. More... | |
const ObjectTrieNode< T > * | begin () const |
Get a const depth iterator positioned at the beginning of the trie. More... | |
size_t | count () const |
Get the number of children in the node. More... | |
bool | empty () const |
Returns true if the trie node is empty. More... | |
ObjectTrieNode< T > * | end () |
Get an iterator positioned at the end of the vector of children. More... | |
const ObjectTrieNode< T > * | end () const |
Get a const iterator positioned at the end of the vector of children. More... | |
ObjectTrieNode< T > * | find (const T &value) |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
const ObjectTrieNode< T > * | find (const T &value) const |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
template<typename CompareT > | |
ObjectTrieNode< T > * | find (const T &value, CompareT compare) |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
template<typename CompareT > | |
const ObjectTrieNode< T > * | find (const T &value, CompareT compare) const |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
template<typename U , typename CompareT > | |
ObjectTrieNode< T > * | find (const U &value, CompareT compare) |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
template<typename U , typename CompareT > | |
const ObjectTrieNode< T > * | find (const U &value, CompareT compare) const |
Locates the first child matching the supplied value or return nullptr if not found. More... | |
ObjectTrieNode< T > & | findOrAddChild (const T &value) |
Locates the first child matching the supplied value or creates a one. More... | |
ObjectTrieNode< T > & | findOrAddChild (T &&value) |
Locates the first child matching the supplied value or creates a one. More... | |
template<typename U , typename CompareT > | |
ObjectTrieNode< T > & | findOrAddChild (const U &value, CompareT compare) |
Locates the first child matching the supplied value or creates one. More... | |
template<typename U , typename CompareT , typename Create > | |
ObjectTrieNode< T > & | findOrAddChild (const U &value, CompareT compare, Create create) |
Locates the first child matching the supplied value or creates one. More... | |
ObjectTrieNode< T > & | operator[] (size_t index) |
Get a reference to the specified child. More... | |
const ObjectTrieNode< T > & | operator[] (size_t index) const |
Get a const reference to the specified child. More... | |
Public Attributes | |
T | value |
The publicly accessible data contained in the node. More... | |
The node type contained in the object trie.
The data type stored in nodes must have a default constructor.
Nodes are exposed by the trie via the root() method, and from within the node type itself via the getChild() method.
Node manipulation is not exposed outside of the trie implementation.
|
inline |
Append a list of children to the node.
|
inline |
Append a vector of children to the node.
|
inline |
Append a child containing the supplied data.
The data is moved into the new value.
value | the value that will be added |
|
inline |
Append a child containing the supplied data.
The data is copied into the new value.
value | the value that will be added |
|
inline |
Append a child containing a copy of the supplied data.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The data is copied into the new value.
value | the value that will be added |
|
inline |
Append a child containing the supplied data.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The data is moved into the new value.
value | the value that will be added |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The operator == method is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
value | the value that will be added or will replace |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The operator == method is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
value | the value that will be added or will replace |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The supplied comparator is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
CompareT | the type of the comparison function |
value | the value that will be added or will replace |
compare | the comparison function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The supplied comparator is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
CompareT | the type of the comparison function |
value | the value that will be added or will replace |
compare | the comparison function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The supplied comparator is used to compare values.
The supplied replacer is used to perform assignment of the values when a match is found.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
CompareT | the type of the comparison function |
ReplaceT | the type of the replacer function |
replace | the replacer function |
value | the value that will be added or will replace |
compare | the comparison function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
The supplied comparator is used to compare values.
The supplied replacer is used to perform assignment of the values when a match is found.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
CompareT | the type of the comparison function |
ReplaceT | the type of the replacer function |
value | the value that will be added or will replace |
compare | the comparison function |
replace | the replacer function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The operator == method is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
value | the value that will be added or will replace |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The operator == method is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
value | the value that will be added or will replace |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The supplied comparator is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
CompareT | the type of the comparison function |
value | the value that will be added or will replace |
compare | the comparison function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The supplied comparator is used to compare values.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
CompareT | the type of the comparison function |
value | the value that will be added or will replace |
compare | the comparison function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The supplied comparator is used to compare values.
The supplied replacer is used to perform assignment of the values when a match is found.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is copied into the new or existing value.
CompareT | the type of the comparison function |
ReplaceT | the type of the replacer function |
value | the value that will be added or will replace |
compare | the comparison function |
replace | the replacer function |
|
inline |
Append a child containing the supplied data if a child equal to the supplied value is not present, otherwise replace it.
This is an alternative form of the add() method, that returns the newly created child instead of the current node.
The supplied comparator is used to compare values.
The supplied replacer is used to perform assignment of the values when a match is found.
The operator = method is used to assign the supplied value to the existing one when a matching value is is found.
The data is moved into the new or existing value.
CompareT | the type of the comparison function |
ReplaceT | the type of the replacer function |
value | the value that will be added or will replace |
compare | the comparison function |
replace | the replacer function |
|
inline |
Get a depth iterator positioned at the beginning of the trie.
|
inline |
Get a const depth iterator positioned at the beginning of the trie.
|
inlinestatic |
Add a child of the child being added.
|
inlinestatic |
Add a child of the child being added, plus descendants of the child.
|
inline |
Get the number of children in the node.
|
inline |
Returns true if the trie node is empty.
|
inline |
Get an iterator positioned at the end of the vector of children.
|
inline |
Get a const iterator positioned at the end of the vector of children.
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
value | the value to compare |
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
value | the value to compare |
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
The supplied comparator is used to determine equality (true == equal).
CompareT | the type of the comparison function |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
The supplied comparator is used to determine equality (true == equal).
CompareT | the type of the comparison function |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
The supplied comparator is used to determine equality (true == equal).
U | the type of the value to compare |
CompareT | the type of the comparison function |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Locates the first child matching the supplied value or return nullptr if not found.
The supplied comparator is used to determine equality (true == equal).
U | the type of the value to compare |
CompareT | the type of the comparison function |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Locates the first child matching the supplied value or creates a one.
The supplied value will be copied if no match was found and a new node is created.
value | the value to compare and copy if a new node is created |
|
inline |
Locates the first child matching the supplied value or creates a one.
The supplied value will be moved if no match was found and a new node is created.
value | the value to compare and move if a new node is created |
|
inline |
Locates the first child matching the supplied value or creates one.
A new value will be created from the supplied value if no match was found and a new node is created.
U | the type of the value to compare |
CompareT | the type of the comparison function |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Locates the first child matching the supplied value or creates one.
A new value will be created from the supplied value via the create function if no match was found and a new node is created.
U | the type of the value to compare |
CompareT | the type of the comparison function |
Create | the function used to create a new value |
value | the value to compare |
compare | the comparison function between type U and type T |
|
inline |
Get a reference to the specified child.
|
inline |
Get a const reference to the specified child.
T value |
The publicly accessible data contained in the node.