HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_RadixTree< T > Class Template Reference

A simple radix tree implementation. More...

#include <NET_RadixTree.h>

Classes

class  Node
 

Public Types

using NodeT = UT_SharedPtr< Node >
 

Public Member Functions

void insert (const UT_StringHolder &name, const T &data, bool allow_partial=false)
 Insert a node. More...
 
NodeT find (const UT_StringHolder &prefix) const
 Find the node based on the provided prefix. More...
 
SYS_NO_DISCARD_RESULT NodeT match (const UT_StringHolder &prefix) const
 
SYS_NO_DISCARD_RESULT bool contains (const UT_StringHolder &prefix) const
 Check if the tree contains the provided string. More...
 
void debug (UT_WorkBuffer &wbuf)
 Write out the tree into the work buffer. This is pretty printed. More...
 
void clear ()
 Clear out the tree. More...
 

Detailed Description

template<typename T>
class NET_RadixTree< T >

A simple radix tree implementation.

Definition at line 32 of file NET_RadixTree.h.

Member Typedef Documentation

template<typename T>
using NET_RadixTree< T >::NodeT = UT_SharedPtr<Node>

Definition at line 37 of file NET_RadixTree.h.

Member Function Documentation

template<typename T>
void NET_RadixTree< T >::clear ( )
inline

Clear out the tree.

Definition at line 329 of file NET_RadixTree.h.

template<typename T>
SYS_NO_DISCARD_RESULT bool NET_RadixTree< T >::contains ( const UT_StringHolder prefix) const
inline

Check if the tree contains the provided string.

Definition at line 310 of file NET_RadixTree.h.

template<typename T>
void NET_RadixTree< T >::debug ( UT_WorkBuffer wbuf)
inline

Write out the tree into the work buffer. This is pretty printed.

Definition at line 318 of file NET_RadixTree.h.

template<typename T>
NodeT NET_RadixTree< T >::find ( const UT_StringHolder prefix) const
inline

Find the node based on the provided prefix.

Definition at line 257 of file NET_RadixTree.h.

template<typename T>
void NET_RadixTree< T >::insert ( const UT_StringHolder name,
const T data,
bool  allow_partial = false 
)
inline

Insert a node.

Definition at line 247 of file NET_RadixTree.h.

template<typename T>
SYS_NO_DISCARD_RESULT NodeT NET_RadixTree< T >::match ( const UT_StringHolder prefix) const
inline

Find the node that fully matches the prefix or partially matches based on the tree node being setup for it. Basically this method only returns a viable node if it "fully" matches the prefix. Use find() if you want find any node that will either partially match or fully match the prefix.

Definition at line 299 of file NET_RadixTree.h.


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