diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
commit | a5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch) | |
tree | bcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/Dump_T.h | |
download | ATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz |
Initial revision
Diffstat (limited to 'ace/Dump_T.h')
-rw-r--r-- | ace/Dump_T.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/ace/Dump_T.h b/ace/Dump_T.h new file mode 100644 index 00000000000..f1031796341 --- /dev/null +++ b/ace/Dump_T.h @@ -0,0 +1,61 @@ +/* -*- C++ -*- */ +// $Id$ + + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Dump.h +// +// = AUTHOR +// Doug Schmidt +// +// ============================================================================ + +#if !defined (ACE_DUMP_T_H) +#define ACE_DUMP_T_H + +#include "ace/Dump.h" + +template <class Concrete> +class ACE_Dumpable_Adapter : public ACE_Dumpable + // = TITLE + // This class inherits the interface of the abstract ACE_Dumpable + // class and is instantiated with the implementation of the + // concrete component class <class Concrete>. + // + // = DESCRIPTION + // This design is similar to the Adapter and Decorator patterns + // from the ``Gang of Four'' book. Note that <class Concrete> + // need not inherit from a common class since ACE_Dumpable + // provides the uniform virtual interface! +{ +public: + // = Initialization and termination methods. + ACE_Dumpable_Adapter (const Concrete *t); + ~ACE_Dumpable_Adapter (void); + + virtual void dump (void) const; + // Concrete dump method (simply delegates to the <dump> method of + // <class Concrete>). + + Concrete *operator->() const; + // Delegate to methods in the Concrete class. + +private: + const Concrete *this_; + // Pointer to <this> of <class Concrete>. +}; + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Dump_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Dump_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_DUMP_T_H */ |