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 
) [inline]

Trie node constructor.

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

Definition at line 44 of file trie.tpp.

00046   : claw::binary_node< typename claw::trie<T, Comp>::trie_node >(), value(val),
00047     count(0)
00048 {
00049 
00050 } // trie_node() [constructor]

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

Trie node copy constructor.

Parameters:
that Node to copy from.

Definition at line 58 of file trie.tpp.

00059   : claw::binary_node< typename claw::trie<T, Comp>::trie_node >(that), 
00060     value(that.value), count(that.count)
00061 { 
00062 
00063 } // 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:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1