Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Member Functions
CPatriciaTree Class Reference

#include <PatriciaTree.h>

List of all members.

Public Types

typedef const unsigned char * TPatriciaKey

Public Member Functions

 CPatriciaTree (long keyBitsLen)
virtual ~CPatriciaTree ()
virtual Boolean InsertNode (TPatriciaKey key, CPatriciaNode *nodeData)
Boolean SeekNode (TPatriciaKey key, CPatriciaNode **outNodeData)
Boolean Traverse (NodeTraverseFunction traverseFcn, void *arg, void *refCon)
long GetNumNodes ()

Protected Member Functions

virtual int ReplaceNode (CPatriciaNode **nodeDataPtr, TPatriciaKey key, CPatriciaNode *replaceData)
virtual int FreeNode (CPatriciaNode *nodeData, TPatriciaKey key)

Protected Attributes

PatriciaTreeRef mTree
long mKeyBits

Static Private Member Functions

static int NodeReplaceCallback (void **nodeDataPtr, unsigned char *key, void *replaceData, void *refCon)
static int NodeFreeCallback (void *nodeData, unsigned char *key, void *refCon)

Detailed Description

Definition at line 57 of file PatriciaTree.h.


Member Typedef Documentation

typedef const unsigned char* CPatriciaTree::TPatriciaKey

Definition at line 61 of file PatriciaTree.h.


Constructor & Destructor Documentation

Definition at line 49 of file PatriciaTree.cpp.

:      mTree(nil)
,      mKeyBits(keyBitsLen)
{

       mTree = PatriciaInitTree(mKeyBits);
       ThrowErrIfNil(mTree, paramErr);
}

Here is the call graph for this function:

Definition at line 62 of file PatriciaTree.cpp.

{
       if (mTree)
       {
              PatriciaFreeTree(mTree, NodeFreeCallback, (void *)this);
       }
}

Here is the call graph for this function:


Member Function Documentation

int CPatriciaTree::FreeNode ( CPatriciaNode nodeData,
TPatriciaKey  key 
) [protected, virtual]

Definition at line 140 of file PatriciaTree.cpp.

{
       return 0;
}

Here is the caller graph for this function:

Definition at line 115 of file PatriciaTree.cpp.

{
       return (mTree) ? PatriciaGetNumNodes(mTree) : 0;
}

Here is the call graph for this function:

Boolean CPatriciaTree::InsertNode ( TPatriciaKey  key,
CPatriciaNode nodeData 
) [virtual]

Definition at line 80 of file PatriciaTree.cpp.

{
       int    result = PatriciaInsert(mTree, NodeReplaceCallback, key, (void *)nodeData, (void *)this);
       return (result == 1);
}

Here is the call graph for this function:

int CPatriciaTree::NodeFreeCallback ( void nodeData,
unsigned char *  key,
void refCon 
) [static, private]

Definition at line 167 of file PatriciaTree.cpp.

{
       CPatriciaTree*              theTree = reinterpret_cast<CPatriciaTree *>(refCon);
       Assert(theTree);
       return theTree->FreeNode(static_cast<CPatriciaNode *>(nodeData), key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CPatriciaTree::NodeReplaceCallback ( void **  nodeDataPtr,
unsigned char *  key,
void replaceData,
void refCon 
) [static, private]

Definition at line 154 of file PatriciaTree.cpp.

{
       CPatriciaTree*              theTree = reinterpret_cast<CPatriciaTree *>(refCon);
       Assert(theTree);
       return theTree->ReplaceNode((CPatriciaNode**)nodeDataPtr, key, static_cast<CPatriciaNode *>(replaceData));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CPatriciaTree::ReplaceNode ( CPatriciaNode **  nodeDataPtr,
TPatriciaKey  key,
CPatriciaNode replaceData 
) [protected, virtual]

Definition at line 129 of file PatriciaTree.cpp.

{
       return 0;
}

Here is the caller graph for this function:

Definition at line 91 of file PatriciaTree.cpp.

{
       int    result = PatriciaSearch(mTree, key, (void **)outNodeData);
       return (result == 1);
}

Here is the call graph for this function:

Boolean CPatriciaTree::Traverse ( NodeTraverseFunction  traverseFcn,
void arg,
void refCon 
)

Definition at line 103 of file PatriciaTree.cpp.

{
       int    result = PatriciaTraverse(mTree, traverseFcn, arg, refCon);
       return (result == 0);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 93 of file PatriciaTree.h.

Definition at line 92 of file PatriciaTree.h.


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