From 00b9a5dedeb47efd78aea59b579a4b5befba743a Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 31 Jan 2010 20:14:30 +0100 Subject: ZMQII-51: Implement O(1) topic matching --- src/sub.hpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/sub.hpp') 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 -#include - #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 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. -- cgit v1.2.3