Public Member Functions | Public Attributes

claw::trie< T, Comp >::trie_node Struct Reference

Node of our trie. Left subtree will be other suggestions for the current position, right subtree will be following items for the word seen from the root to here. More...

Inheritance diagram for claw::trie< T, Comp >::trie_node:
claw::binary_node< trie_node >

List of all members.

Public Member Functions

 trie_node (const T &val, unsigned int c=0)
 Trie node constructor.
 trie_node (const trie_node &that)
 Trie node copy constructor.

Public Attributes

value
 Value of the node.
unsigned int count
 Times we found the word from the root to this node. Zero if never seen.

Detailed Description

template<class T, class Comp = std::equal_to<T>>
struct claw::trie< T, Comp >::trie_node

Node of our trie. Left subtree will be other suggestions for the current position, right subtree will be following items for the word seen from the root to here.

Definition at line 73 of file trie.hpp.


Constructor & Destructor Documentation

template<class T , class Comp >
claw::trie< T, Comp >::trie_node::trie_node ( const T &  val,
unsigned int  c = 0 
)

Trie node constructor.

Parameters:
valValue of the node.
cCount for the node.
Postcondition:
(value==val) && (count==c)

Definition at line 44 of file trie.tpp.

  : claw::binary_node< typename claw::trie<T, Comp>::trie_node >(), value(val),
    count(0)
{

} // trie_node() [constructor]
template<class T , class Comp >
claw::trie< T, Comp >::trie_node::trie_node ( const trie_node that )

Trie node copy constructor.

Parameters:
thatNode to copy from.

Definition at line 58 of file trie.tpp.

  : claw::binary_node< typename claw::trie<T, Comp>::trie_node >(that), 
    value(that.value), count(that.count)
{ 

} // trie_node [copy constructor]

Member Data Documentation

template<class T, class Comp = std::equal_to<T>>
unsigned int claw::trie< T, Comp >::trie_node::count

Times we found the word from the root to this node. Zero if never seen.

Definition at line 81 of file trie.hpp.

Referenced by claw::trie< T, Comp >::count(), and claw::trie< T, Comp >::insert().

template<class T, class Comp = std::equal_to<T>>
T claw::trie< T, Comp >::trie_node::value

Value of the node.

Definition at line 76 of file trie.hpp.


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