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 ()
 
Node * next ()
 
Node * previous ()
 
Node * findChild (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
 
Node * getFirstChild () const
 
void prependKey (const String &cpKey)
 
void setKey (const char *cpKey)
 
void setKey (const char *cpKey, size_t lengthHint)
 
void setKey (const String &cpKey)
 
const char * getKey () const
 
const String & getKeyStr () const
 
void setValue (const T &pV)
 
void removeValue ()
 
const T & getValue () const
 
void setParent (Node *pP)
 
Node * getParent () const
 
bool hasValue () const
 
void dump (void(*emit_line)(const char *s)) const
 

Public Attributes

String m_Key
 
T value
 
childlist_t m_Children
 
Node * m_pParent
 
const bool m_bCaseSensitive
 
RadixTree * m_pParentTree
 
bool m_bHasValue
 

Private Member Functions

 Node (const Node &)
 
Node & operator= (const Node &)
 
Node * doNext () const
 
Node * getNextSibling () const
 

Detailed Description

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

Tree node.

Definition at line 49 of file RadixTree.h.

Member Typedef Documentation

◆ childlist_t

template<class T >
typedef Vector<Node*> RadixTree< T >::Node::childlist_t

Definition at line 51 of file RadixTree.h.

Member Enumeration Documentation

◆ MatchType

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 52 of file RadixTree.h.

Constructor & Destructor Documentation

◆ Node()

template<class T >
RadixTree< T >::Node::Node ( bool  bCaseSensitive)
inline

Definition at line 59 of file RadixTree.h.

Member Function Documentation

◆ getKey()

template<class T >
const char * RadixTree< T >::Node::getKey ( ) const
inline

Definition at line 116 of file RadixTree.h.

◆ getKeyStr()

template<class T >
const String & RadixTree< T >::Node::getKeyStr ( ) const
inline

Definition at line 119 of file RadixTree.h.

◆ getParent()

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

Definition at line 136 of file RadixTree.h.

◆ getValue()

template<class T >
const T & RadixTree< T >::Node::getValue ( ) const
inline

Definition at line 130 of file RadixTree.h.

◆ hasValue()

template<class T >
bool RadixTree< T >::Node::hasValue ( ) const
inline

Definition at line 139 of file RadixTree.h.

◆ next()

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.

Referenced by RadixTree< T >::erase().

+ Here is the caller graph for this function:

◆ previous()

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 81 of file RadixTree.h.

◆ removeValue()

template<class T >
void RadixTree< T >::Node::removeValue ( )
inline

Definition at line 126 of file RadixTree.h.

◆ setParent()

template<class T >
void RadixTree< T >::Node::setParent ( Node *  pP)
inline

Definition at line 133 of file RadixTree.h.

◆ setValue()

template<class T >
void RadixTree< T >::Node::setValue ( const T &  pV)
inline

Definition at line 122 of file RadixTree.h.

Member Data Documentation

◆ m_bCaseSensitive

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

Controls case-sensitive matching.

Definition at line 156 of file RadixTree.h.

◆ m_bHasValue

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 165 of file RadixTree.h.

Referenced by RadixTree< T >::returnNode().

◆ m_Children

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

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

Definition at line 152 of file RadixTree.h.

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

◆ m_Key

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

◆ m_pParent

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

Parent node.

Definition at line 154 of file RadixTree.h.

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

◆ m_pParentTree

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

Link back to the node's RadixTree instance.

Definition at line 159 of file RadixTree.h.

Referenced by RadixTree< T >::getNewNode().

◆ value

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 150 of file RadixTree.h.

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


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