3 //=============================================================================
9 //=============================================================================
14 #include /**/ "ace/pre.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 * @class ACE_Dumpable_Adapter
28 * This class inherits the interface of the abstract ACE_Dumpable
29 * class and is instantiated with the implementation of the
30 * concrete component class <class Concrete>.
32 * This design is similar to the Adapter and Decorator patterns
33 * from the ``Gang of Four'' book. Note that <class Concrete>
34 * need not inherit from a common class since ACE_Dumpable
35 * provides the uniform virtual interface!
37 template <class Concrete
>
38 class ACE_Dumpable_Adapter
: public ACE_Dumpable
41 ACE_Dumpable_Adapter (const Concrete
*t
);
42 ~ACE_Dumpable_Adapter (void);
44 /// Concrete dump method (simply delegates to the dump() method of
45 /// <class Concrete>).
46 virtual void dump (void) const;
48 /// Delegate to methods in the Concrete class.
49 Concrete
*operator->() const;
52 /// Pointer to @c this of <class Concrete>.
53 const Concrete
*this_
;
56 ACE_END_VERSIONED_NAMESPACE_DECL
58 // Some useful macros for conditionally compiling this feature...
59 #if defined (ACE_NDEBUG)
60 #define ACE_REGISTER_OBJECT(CLASS)
61 #define ACE_REMOVE_OBJECT
63 #define ACE_REGISTER_OBJECT(CLASS) \
64 ACE_ODB::instance ()->register_object \
65 (new ACE_Dumpable_Adapter<CLASS> (this));
66 #define ACE_REMOVE_OBJECT \
67 ACE_ODB::instance ()->remove_object \
69 #endif /* ACE_NDEBUG */
71 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
72 #include "ace/Dump_T.cpp"
73 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
75 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
76 #pragma implementation ("Dump_T.cpp")
77 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
79 #include /**/ "ace/post.h"
80 #endif /* ACE_DUMP_T_H */