summaryrefslogtreecommitdiff
path: root/src/trie.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trie.hpp')
-rw-r--r--src/trie.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/trie.hpp b/src/trie.hpp
index dbf1cb1..a2b55c6 100644
--- a/src/trie.hpp
+++ b/src/trie.hpp
@@ -35,12 +35,28 @@ namespace zmq
trie_t ();
~trie_t ();
- void add (unsigned char *prefix_, size_t size_);
+ // Add key to the trie. Returns true if this is a new item in the trie
+ // rather than a duplicate.
+ bool add (unsigned char *prefix_, size_t size_);
+
+ // Remove key from the trie. Returns true if the item is actually
+ // removed from the trie.
bool rm (unsigned char *prefix_, size_t size_);
+
+ // Check whether particular key is in the trie.
bool check (unsigned char *data_, size_t size_);
+ // Apply the function supplied to each subscription in the trie.
+ void apply (void (*func_) (unsigned char *data_, size_t size_,
+ void *arg_), void *arg_);
+
private:
+ void apply_helper (
+ unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_,
+ void (*func_) (unsigned char *data_, size_t size_, void *arg_),
+ void *arg_);
+
uint32_t refcnt;
unsigned char min;
unsigned short count;