Removed ACE_HAS_BSTRING, not used
[ACE_TAO.git] / ACE / ace / Dump_T.h
blobd20fae85074cfcd68e089c346d8c029c7c6a237e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Dump_T.h
7 * @author Doug Schmidt
8 */
9 //=============================================================================
12 #ifndef ACE_DUMP_T_H
13 #define ACE_DUMP_T_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Dump.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
25 * @class ACE_Dumpable_Adapter
27 * @brief
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
40 public:
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;
51 private:
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
62 #else
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 \
68 ((void *) this);
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 */