diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-01-31 20:14:30 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-01-31 20:14:30 +0100 |
commit | 00b9a5dedeb47efd78aea59b579a4b5befba743a (patch) | |
tree | 6747cc7043ad87142874aa2a6264d01248844d3c /src/sub.hpp | |
parent | 70ea8e9d4b88a1ecb1c076eccc2e9bd872c2230c (diff) |
ZMQII-51: Implement O(1) topic matching
Diffstat (limited to 'src/sub.hpp')
-rw-r--r-- | src/sub.hpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/sub.hpp b/src/sub.hpp index 2044442..9e7d6cc 100644 --- a/src/sub.hpp +++ b/src/sub.hpp @@ -20,11 +20,9 @@ #ifndef __ZMQ_SUB_HPP_INCLUDED__ #define __ZMQ_SUB_HPP_INCLUDED__ -#include <set> -#include <string> - #include "../bindings/c/zmq.h" +#include "prefix_tree.hpp" #include "socket_base.hpp" #include "fq.hpp" @@ -59,13 +57,10 @@ namespace zmq bool match (zmq_msg_t *msg_); // Fair queueing object for inbound pipes. - fq_t fq; - - // Number of active * subscriptions. - int all_count; + fq_t fq; - typedef std::multiset <std::string> subscriptions_t; - subscriptions_t subscriptions; + // The repository of subscriptions. + prefix_tree_t subscriptions; // If true, 'message' contains a matching message to return on the // next recv call. |