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()
option(ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
endif()
if(ENABLE_DRAFTS)
option (ENABLE_RADIX_TREE "Use radix tree implementation to manage subscriptions" ON)
add_definitions(-DZMQ_BUILD_DRAFT_API)
set(pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")
else()
option (ENABLE_RADIX_TREE "Use radix tree implementation to manage subscriptions" OFF)
set(pkg_config_defines "")
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)
if(WITH_MILITANT)
add_definitions(-DZMQ_ACT_MILITANT)
......
......@@ -34,7 +34,7 @@
#include "session_base.hpp"
#include "dist.hpp"
#include "fq.hpp"
#ifdef ZMQ_BUILD_DRAFT_API
#ifdef ZMQ_USE_RADIX_TREE
#include "radix_tree.hpp"
#else
#include "trie.hpp"
......@@ -82,7 +82,7 @@ class xsub_t : public socket_base_t
dist_t _dist;
// The repository of subscriptions.
#ifdef ZMQ_BUILD_DRAFT_API
#ifdef ZMQ_USE_RADIX_TREE
radix_tree _subscriptions;
#else
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