From c8fa5fa308f6ad9be22612568ace703777fbb6d9 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Fri, 18 Sep 2009 20:15:15 +0000 Subject: Refactored the QMF engine to adhere to the following rules regarding the pimpl (Pointer to Implementation) pattern: 1) Impl classes have constructors matching the public constructors 2) Additional Impl constructors are accessed through a static factory function 3) All linkages to objects are to the public object 4) If a back-link (from Impl to public) is needed, the Impl class must be derived from boost::noncopyable 5) All public classes have non-default copy constructors that make a copy of the Impl class git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@816770 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qmf/ConsoleEngineImpl.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'qpid/cpp/src/qmf/ConsoleEngineImpl.h') diff --git a/qpid/cpp/src/qmf/ConsoleEngineImpl.h b/qpid/cpp/src/qmf/ConsoleEngineImpl.h index b95cb7523a..a78e8409b9 100644 --- a/qpid/cpp/src/qmf/ConsoleEngineImpl.h +++ b/qpid/cpp/src/qmf/ConsoleEngineImpl.h @@ -46,13 +46,14 @@ #include #include #include +#include namespace qmf { struct ConsoleEventImpl { typedef boost::shared_ptr Ptr; ConsoleEvent::EventKind kind; - boost::shared_ptr agent; + boost::shared_ptr agent; std::string name; boost::shared_ptr classKey; Object* object; @@ -66,9 +67,9 @@ namespace qmf { ConsoleEvent copy(); }; - class ConsoleEngineImpl { + class ConsoleEngineImpl : public boost::noncopyable { public: - ConsoleEngineImpl(ConsoleEngine* e, const ConsoleSettings& settings = ConsoleSettings()); + ConsoleEngineImpl(const ConsoleSettings& settings = ConsoleSettings()); ~ConsoleEngineImpl(); bool getEvent(ConsoleEvent& event) const; @@ -99,7 +100,6 @@ namespace qmf { private: friend class BrokerProxyImpl; - ConsoleEngine* envelope; const ConsoleSettings& settings; mutable qpid::sys::Mutex lock; std::deque eventQueue; @@ -110,22 +110,22 @@ namespace qmf { // class key pointers. The default behavior would be to compare the pointer // addresses themselves. struct KeyCompare { - bool operator()(const SchemaClassKeyImpl* left, const SchemaClassKeyImpl* right) const { + bool operator()(const SchemaClassKey* left, const SchemaClassKey* right) const { return *left < *right; } }; - typedef std::map ObjectClassList; - typedef std::map EventClassList; + typedef std::map ObjectClassList; + typedef std::map EventClassList; typedef std::map > PackageList; PackageList packages; void learnPackage(const std::string& packageName); - void learnClass(SchemaObjectClassImpl::Ptr cls); - void learnClass(SchemaEventClassImpl::Ptr cls); - bool haveClass(const SchemaClassKeyImpl& key) const; - SchemaObjectClassImpl::Ptr getSchema(const SchemaClassKeyImpl& key) const; + void learnClass(SchemaObjectClass* cls); + void learnClass(SchemaEventClass* cls); + bool haveClass(const SchemaClassKey* key) const; + SchemaObjectClass* getSchema(const SchemaClassKey* key) const; }; } -- cgit v1.2.1