diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-07-28 03:23:49 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-07-28 03:23:49 +0000 |
commit | 18e02a5b6da498a3a6880ee43a77df841ca57079 (patch) | |
tree | 3912bd8bf338887fbb695b6cf09c17fdf6837436 /cpp/src | |
parent | 6bee7da9ede9546ed2bf0eb5dea031f36b56c5ba (diff) | |
download | qpid-python-18e02a5b6da498a3a6880ee43a77df841ca57079.tar.gz |
Add a default constructor to LinkRegistry so that you don't need
a broker to create one for the store tests
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@798383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/LinkRegistry.cpp | 17 | ||||
-rw-r--r-- | cpp/src/qpid/broker/LinkRegistry.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/LinkRegistry.cpp b/cpp/src/qpid/broker/LinkRegistry.cpp index fce3a88cd1..10e5359493 100644 --- a/cpp/src/qpid/broker/LinkRegistry.cpp +++ b/cpp/src/qpid/broker/LinkRegistry.cpp @@ -36,8 +36,21 @@ namespace _qmf = qmf::org::apache::qpid::broker; #define LINK_MAINT_INTERVAL 2 -LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), parent(0), store(0), passive(false), passiveChanged(false), - realm(broker ? broker->getOptions().realm : "") +// TODO: This constructor is only used by the store unit tests - +// That probably indicates that LinkRegistry isn't correctly +// factored: The persistence element and maintenance element +// should be factored separately +LinkRegistry::LinkRegistry () : + broker(0), + parent(0), store(0), passive(false), passiveChanged(false), + realm("") +{ +} + +LinkRegistry::LinkRegistry (Broker* _broker) : + broker(_broker), + parent(0), store(0), passive(false), passiveChanged(false), + realm("") { timer.add (intrusive_ptr<TimerTask> (new Periodic(*this))); } diff --git a/cpp/src/qpid/broker/LinkRegistry.h b/cpp/src/qpid/broker/LinkRegistry.h index bfdf0d491b..8d1a252f54 100644 --- a/cpp/src/qpid/broker/LinkRegistry.h +++ b/cpp/src/qpid/broker/LinkRegistry.h @@ -75,6 +75,7 @@ namespace broker { static std::string createKey(const TcpAddress& address); public: + LinkRegistry (); // Only used in store tests LinkRegistry (Broker* _broker); std::pair<boost::shared_ptr<Link>, bool> declare(std::string& host, |