summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/ExchangeRegistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/ExchangeRegistry.h')
-rw-r--r--cpp/src/qpid/broker/ExchangeRegistry.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/cpp/src/qpid/broker/ExchangeRegistry.h b/cpp/src/qpid/broker/ExchangeRegistry.h
index 335f1ad0ab..fca5462e72 100644
--- a/cpp/src/qpid/broker/ExchangeRegistry.h
+++ b/cpp/src/qpid/broker/ExchangeRegistry.h
@@ -20,22 +20,21 @@
#include <map>
#include "qpid/broker/Exchange.h"
-#include "qpid/concurrent/Monitor.h"
+#include "qpid/concurrent/MonitorImpl.h"
namespace qpid {
namespace broker {
+ struct UnknownExchangeTypeException{};
+
class ExchangeRegistry{
- typedef std::map<string, Exchange*> ExchangeMap;
+ typedef std::map<string, Exchange::shared_ptr> ExchangeMap;
ExchangeMap exchanges;
- qpid::concurrent::Monitor* lock;
+ qpid::concurrent::MonitorImpl lock;
public:
- ExchangeRegistry();
- void declare(Exchange* exchange);
+ std::pair<Exchange::shared_ptr, bool> declare(const string& name, const string& type) throw(UnknownExchangeTypeException);
void destroy(const string& name);
- Exchange* get(const string& name);
- Exchange* getDefault();
- inline qpid::concurrent::Monitor* getLock(){ return lock; }
- ~ExchangeRegistry();
+ Exchange::shared_ptr get(const string& name);
+ Exchange::shared_ptr getDefault();
};
}
}