Framework_Component_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Framework_Component_T.h
00006  *
00007  *  Framework_Component_T.h,v 1.6 2005/10/28 16:14:52 ossama Exp
00008  *
00009  *  @author Don Hinton <dhinton@ieee.org>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_FRAMEWORK_COMPONENT_T_H
00014 #define ACE_FRAMEWORK_COMPONENT_T_H
00015 #include /**/ "ace/pre.h"
00016 #include "ace/Framework_Component.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 # pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00023 
00024 /**
00025  * @class ACE_Framework_Component_T
00026  *
00027  * @brief This class inherits the interface of the abstract
00028  * ACE_Framework_Component class and is instantiated with the
00029  * implementation of the concrete component class <class Concrete>.
00030  *
00031  * This design is similar to the Adapter and Decorator patterns
00032  * from the ``Gang of Four'' book.  Note that <class Concrete>
00033  * need not inherit from a common class since ACE_Framework_Component
00034  * provides the uniform virtual interface!  (implementation based on
00035  * ACE_Dumpable_Adapter in <ace/Dump_T.h>.
00036  */
00037 template <class Concrete>
00038 class ACE_Framework_Component_T : public ACE_Framework_Component
00039 {
00040 public:
00041   // = Initialization and termination methods.
00042 
00043   /// Constructor.
00044   ACE_Framework_Component_T (Concrete *concrete);
00045 
00046   /// Destructor.
00047   ~ACE_Framework_Component_T (void);
00048 
00049   /// Close the contained singleton.
00050   void close_singleton (void);
00051 };
00052 
00053 ACE_END_VERSIONED_NAMESPACE_DECL
00054 
00055 // This macro should be called in the instance() method
00056 // of the Concrete class that will be managed.  Along
00057 // with the appropriate template instantiation.
00058 #define ACE_REGISTER_FRAMEWORK_COMPONENT(CLASS, INSTANCE) \
00059         ACE_Framework_Repository::instance ()->register_component \
00060           (new ACE_Framework_Component_T<CLASS> (INSTANCE));
00061 
00062 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00063 #include "ace/Framework_Component_T.cpp"
00064 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00065 
00066 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00067 #pragma implementation ("Framework_Component_T.cpp")
00068 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00069 
00070 #include /**/ "ace/post.h"
00071 #endif /* ACE_FRAMEWORK_COMPONENT_T_H */

Generated on Thu Nov 9 09:41:51 2006 for ACE by doxygen 1.3.6