libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
zmq::trie_t Class Reference

#include <trie.hpp>

Collaboration diagram for zmq::trie_t:

Public Member Functions

 trie_t ()
 
 ~trie_t ()
 
bool add (unsigned char *prefix_, size_t size_)
 
void apply (void(*func_)(unsigned char *data_, size_t size_, void *arg_), void *arg_)
 
bool check (unsigned char *data_, size_t size_)
 
bool rm (unsigned char *prefix_, size_t size_)
 

Private Member Functions

 trie_t (const trie_t &)
 
void apply_helper (unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void(*func_)(unsigned char *data_, size_t size_, void *arg_), void *arg_)
 
bool is_redundant () const
 
const trie_toperator= (const trie_t &)
 

Private Attributes

unsigned short count
 
unsigned short live_nodes
 
unsigned char min
 
union {
   class trie_t *   node
 
   class trie_t **   table
 
next
 
uint32_t refcnt
 

Detailed Description

Definition at line 40 of file trie.hpp.

Constructor & Destructor Documentation

zmq::trie_t::trie_t ( )

Definition at line 45 of file trie.cpp.

zmq::trie_t::~trie_t ( )

Definition at line 53 of file trie.cpp.

References count, LIBZMQ_DELETE, next, and zmq_assert.

zmq::trie_t::trie_t ( const trie_t )
private

Member Function Documentation

bool zmq::trie_t::add ( unsigned char *  prefix_,
size_t  size_ 
)

Definition at line 67 of file trie.cpp.

References alloc_assert, count, live_nodes, min, next, refcnt, and zmq_assert.

Referenced by zmq::xsub_t::xsend().

Here is the caller graph for this function:

void zmq::trie_t::apply ( void(*)(unsigned char *data_, size_t size_, void *arg_)  func_,
void *  arg_ 
)

Definition at line 298 of file trie.cpp.

References apply_helper().

Referenced by zmq::xsub_t::xattach_pipe(), and zmq::xsub_t::xhiccuped().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::trie_t::apply_helper ( unsigned char **  buff_,
size_t  buffsize_,
size_t  maxbuffsize_,
void(*)(unsigned char *data_, size_t size_, void *arg_)  func_,
void *  arg_ 
)
private

Definition at line 306 of file trie.cpp.

References count, min, next, refcnt, and zmq_assert.

Referenced by apply().

Here is the caller graph for this function:

bool zmq::trie_t::check ( unsigned char *  data_,
size_t  size_ 
)

Definition at line 264 of file trie.cpp.

References count, min, next, node, refcnt, and table.

Referenced by zmq::xsub_t::match().

Here is the caller graph for this function:

bool zmq::trie_t::is_redundant ( ) const
private

Definition at line 342 of file trie.cpp.

References live_nodes, and refcnt.

Referenced by rm().

Here is the caller graph for this function:

const trie_t& zmq::trie_t::operator= ( const trie_t )
private
bool zmq::trie_t::rm ( unsigned char *  prefix_,
size_t  size_ 
)

Definition at line 146 of file trie.cpp.

References alloc_assert, count, is_redundant(), LIBZMQ_DELETE, live_nodes, min, next, node, refcnt, rm(), and zmq_assert.

Referenced by rm(), and zmq::xsub_t::xsend().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

unsigned short zmq::trie_t::count
private

Definition at line 72 of file trie.hpp.

Referenced by add(), apply_helper(), check(), rm(), and ~trie_t().

unsigned short zmq::trie_t::live_nodes
private

Definition at line 73 of file trie.hpp.

Referenced by add(), is_redundant(), and rm().

unsigned char zmq::trie_t::min
private

Definition at line 71 of file trie.hpp.

Referenced by add(), apply_helper(), check(), and rm().

union { ... } zmq::trie_t::next

Referenced by add(), apply_helper(), check(), rm(), and ~trie_t().

class trie_t* zmq::trie_t::node

Definition at line 75 of file trie.hpp.

Referenced by check(), and rm().

uint32_t zmq::trie_t::refcnt
private

Definition at line 70 of file trie.hpp.

Referenced by add(), apply_helper(), check(), is_redundant(), and rm().

class trie_t** zmq::trie_t::table

Definition at line 76 of file trie.hpp.

Referenced by check().