Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Dump_T.h
blob92b57addce6e59e59536bfda01f52abf26e3f54b
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Dump_T.h
7 * $Id: Dump_T.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Doug Schmidt
11 //=============================================================================
14 #ifndef ACE_DUMP_T_H
15 #define ACE_DUMP_T_H
16 #include /**/ "ace/pre.h"
18 #include "ace/Dump.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
27 * @class ACE_Dumpable_Adapter
29 * @brief This class inherits the interface of the abstract ACE_Dumpable
30 * class and is instantiated with the implementation of the
31 * concrete component class <class Concrete>.
33 * This design is similar to the Adapter and Decorator patterns
34 * from the ``Gang of Four'' book. Note that <class Concrete>
35 * need not inherit from a common class since ACE_Dumpable
36 * provides the uniform virtual interface!
38 template <class Concrete>
39 class ACE_Dumpable_Adapter : public ACE_Dumpable
41 public:
42 // = Initialization and termination methods.
43 ACE_Dumpable_Adapter (const Concrete *t);
44 ~ACE_Dumpable_Adapter (void);
46 /// Concrete dump method (simply delegates to the <dump> method of
47 /// <class Concrete>).
48 virtual void dump (void) const;
50 /// Delegate to methods in the Concrete class.
51 Concrete *operator->() const;
53 private:
54 /// Pointer to @c this of <class Concrete>.
55 const Concrete *this_;
58 ACE_END_VERSIONED_NAMESPACE_DECL
60 // Some useful macros for conditionally compiling this feature...
61 #if defined (ACE_NDEBUG)
62 #define ACE_REGISTER_OBJECT(CLASS)
63 #define ACE_REMOVE_OBJECT
64 #else
65 #define ACE_REGISTER_OBJECT(CLASS) \
66 ACE_ODB::instance ()->register_object \
67 (new ACE_Dumpable_Adapter<CLASS> (this));
68 #define ACE_REMOVE_OBJECT \
69 ACE_ODB::instance ()->remove_object \
70 ((void *) this);
71 #endif /* ACE_NDEBUG */
73 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
74 #include "ace/Dump_T.cpp"
75 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
77 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
78 #pragma implementation ("Dump_T.cpp")
79 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
81 #include /**/ "ace/post.h"
82 #endif /* ACE_DUMP_T_H */