The Pedigree Project  0.1
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
RadixTree< T >::Node Class Reference
+ Collaboration diagram for RadixTree< T >::Node:

Public Types

enum  MatchType { ExactMatch, NoMatch, PartialMatch, OverMatch }
 
typedef Vector< Node * > childlist_t
 

Public Member Functions

 Node (bool bCaseSensitive)
 
void returnAllChildren ()
 
Nodenext ()
 
Nodeprevious ()
 
NodefindChild (const char *cpKey) const
 
void addChild (Node *pNode)
 
void replaceChild (Node *pNodeOld, Node *pNodeNew)
 
void removeChild (Node *pChild)
 
MatchType matchKey (const char *cpKey, size_t &offset) const
 
NodegetFirstChild () const
 
void prependKey (const char *cpKey)
 
void setKey (const char *cpKey)
 
void setKey (const char *cpKey, size_t lengthHint)
 
const char * getKey () const
 
void setValue (const T &pV)
 
void removeValue ()
 
const T & getValue () const
 
void setParent (Node *pP)
 
NodegetParent () const
 
bool hasValue () const
 
void dump (void(*emit_line)(const char *s)) const
 

Public Attributes

String m_Key
 
value
 
childlist_t m_Children
 
Nodem_pParent
 
const bool m_bCaseSensitive
 
RadixTreem_pParentTree
 
bool m_bHasValue
 

Private Member Functions

 Node (const Node &)
 
Nodeoperator= (const Node &)
 
NodedoNext () const
 
NodegetNextSibling () const
 

Detailed Description

template<class T>
class RadixTree< T >::Node

Tree node.

Definition at line 49 of file RadixTree.h.

Member Enumeration Documentation

template<class T>
enum RadixTree::Node::MatchType
Enumerator
ExactMatch 

Key matched node key exactly.

NoMatch 

Key didn't match node key at all.

PartialMatch 

A subset of key matched the node key.

OverMatch 

Key matched node key, and had extra characters.

Definition at line 53 of file RadixTree.h.

Member Function Documentation

template<class T>
Node* RadixTree< T >::Node::next ( )
inline

Get the next data structure in the list

Returns
pointer to the next data structure in the list

Definition at line 75 of file RadixTree.h.

template<class T>
Node* RadixTree< T >::Node::previous ( )
inline

Get the previous data structure in the list

Returns
pointer to the previous data structure in the list
Note
Not implemented!

Definition at line 82 of file RadixTree.h.

Member Data Documentation

template<class T>
const bool RadixTree< T >::Node::m_bCaseSensitive

Controls case-sensitive matching.

Definition at line 160 of file RadixTree.h.

template<class T>
bool RadixTree< T >::Node::m_bHasValue

Do we have a value? Some nodes are intermediates caused by a split but don't yet have a value, and it is incorrect to return something for them.

Definition at line 169 of file RadixTree.h.

template<class T>
childlist_t RadixTree< T >::Node::m_Children

Array of 16 pointers to 16 nodes (256 total).

Definition at line 156 of file RadixTree.h.

Referenced by RadixTree< T >::cloneNode(), RadixTree< T >::Node::doNext(), and RadixTree< T >::remove().

template<class T>
String RadixTree< T >::Node::m_Key

Node key, zero terminated.

Definition at line 150 of file RadixTree.h.

Referenced by RadixTree< T >::cloneNode(), RadixTree< T >::insert(), RadixTree< T >::lookup(), and RadixTree< T >::remove().

template<class T>
Node* RadixTree< T >::Node::m_pParent

Parent node.

Definition at line 158 of file RadixTree.h.

Referenced by RadixTree< T >::Node::doNext().

template<class T>
RadixTree* RadixTree< T >::Node::m_pParentTree

Link back to the node's RadixTree instance.

Definition at line 163 of file RadixTree.h.

template<class T>
T RadixTree< T >::Node::value

Node value.

Note
Parting from coding standard because Iterator requires the member be called 'value'.

Definition at line 154 of file RadixTree.h.

Referenced by RadixTree< T >::cloneNode(), and RadixTree< T >::Node::doNext().


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