Commit 25e069d1 authored by Bill Torpey's avatar Bill Torpey Committed by Luca Boccassi

Add specific option to select radix tree implementation for subscriptions (#3304)

* Add specific option to select radix tree implementation for subscriptions (defaults to ON if draft API enabled).
parent d60ed2d6
...@@ -114,12 +114,19 @@ else() ...@@ -114,12 +114,19 @@ else()
option(ENABLE_DRAFTS "Build and install draft classes and methods" OFF) option(ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
endif() endif()
if(ENABLE_DRAFTS) if(ENABLE_DRAFTS)
option (ENABLE_RADIX_TREE "Use radix tree implementation to manage subscriptions" ON)
add_definitions(-DZMQ_BUILD_DRAFT_API) add_definitions(-DZMQ_BUILD_DRAFT_API)
set(pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1") set(pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")
else() else()
option (ENABLE_RADIX_TREE "Use radix tree implementation to manage subscriptions" OFF)
set(pkg_config_defines "") set(pkg_config_defines "")
endif() endif()
if (ENABLE_RADIX_TREE)
message(STATUS "Using radix tree implementation to manage subscriptions")
add_definitions(-DZMQ_USE_RADIX_TREE)
endif()
option(WITH_MILITANT "Enable militant assertions" OFF) option(WITH_MILITANT "Enable militant assertions" OFF)
if(WITH_MILITANT) if(WITH_MILITANT)
add_definitions(-DZMQ_ACT_MILITANT) add_definitions(-DZMQ_ACT_MILITANT)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "session_base.hpp" #include "session_base.hpp"
#include "dist.hpp" #include "dist.hpp"
#include "fq.hpp" #include "fq.hpp"
#ifdef ZMQ_BUILD_DRAFT_API #ifdef ZMQ_USE_RADIX_TREE
#include "radix_tree.hpp" #include "radix_tree.hpp"
#else #else
#include "trie.hpp" #include "trie.hpp"
...@@ -82,7 +82,7 @@ class xsub_t : public socket_base_t ...@@ -82,7 +82,7 @@ class xsub_t : public socket_base_t
dist_t _dist; dist_t _dist;
// The repository of subscriptions. // The repository of subscriptions.
#ifdef ZMQ_BUILD_DRAFT_API #ifdef ZMQ_USE_RADIX_TREE
radix_tree _subscriptions; radix_tree _subscriptions;
#else #else
trie_t _subscriptions; trie_t _subscriptions;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment