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/ObjectImpl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'qpid/cpp/src/qmf/ObjectImpl.h') diff --git a/qpid/cpp/src/qmf/ObjectImpl.h b/qpid/cpp/src/qmf/ObjectImpl.h index 4ac5a31b54..565e9a2704 100644 --- a/qpid/cpp/src/qmf/ObjectImpl.h +++ b/qpid/cpp/src/qmf/ObjectImpl.h @@ -33,27 +33,29 @@ namespace qmf { class BrokerProxyImpl; + typedef boost::shared_ptr ObjectPtr; + struct ObjectImpl { - typedef boost::shared_ptr Ptr; typedef boost::shared_ptr ValuePtr; - Object* envelope; const SchemaObjectClass* objectClass; BrokerProxyImpl* broker; - boost::shared_ptr objectId; + boost::shared_ptr objectId; uint64_t createTime; uint64_t destroyTime; uint64_t lastUpdatedTime; mutable std::map properties; mutable std::map statistics; - ObjectImpl(Object* e, const SchemaObjectClass* type); + ObjectImpl(const SchemaObjectClass* type); ObjectImpl(const SchemaObjectClass* type, BrokerProxyImpl* b, qpid::framing::Buffer& buffer, bool prop, bool stat, bool managed); + static Object* factory(const SchemaObjectClass* type, BrokerProxyImpl* b, qpid::framing::Buffer& buffer, + bool prop, bool stat, bool managed); ~ObjectImpl(); void destroy(); - const ObjectId* getObjectId() const { return objectId.get() ? objectId->envelope : 0; } - void setObjectId(ObjectId* oid) { objectId.reset(oid->impl); } + const ObjectId* getObjectId() const { return objectId.get(); } + void setObjectId(ObjectId* oid) { objectId.reset(oid); } const SchemaObjectClass* getClass() const { return objectClass; } Value* getValue(const std::string& key) const; void invokeMethod(const std::string& methodName, const Value* inArgs, void* context) const; -- cgit v1.2.1