diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/ciao/Port_Activator_T.h | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-DS-main.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/ciao/Port_Activator_T.h')
-rw-r--r-- | modules/CIAO/ciao/Port_Activator_T.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/modules/CIAO/ciao/Port_Activator_T.h b/modules/CIAO/ciao/Port_Activator_T.h new file mode 100644 index 00000000000..bf159c89b4e --- /dev/null +++ b/modules/CIAO/ciao/Port_Activator_T.h @@ -0,0 +1,82 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Port_Activator_T.h + * + * $Id$ + * + * @authors Bala Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_PORT_ACTIVATOR_T_H +#define CIAO_PORT_ACTIVATOR_T_H +#include /**/ "ace/pre.h" + +#include "ciao/Port_Activator.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CIAO +{ + /** + * @class Port_Activator_T + * + * @brief Concrete class that implements the strategy for creating + * the right type of servant for the ports in question. + * + * This class is parametrized by the servant type for the port, the + * executor type for the port, the context for the component and the + * component servant which instantiated this class within the + * container. + */ + template <typename SERV, + typename EXEC, + typename CONTEXT, + typename COMP_SERV> + class Port_Activator_T : public virtual Port_Activator + { + public: + typedef SERV SERVANT; + + Port_Activator_T (const char *oid, + const char *name, + Port_Activator::Type t, + EXEC *e, + CONTEXT *c, + COMP_SERV *cs); + + /// Template method from the base class, please see the base class + /// documentation for details. + PortableServer::Servant activate ( + const PortableServer::ObjectId &oid); + + void deactivate ( + const PortableServer::Servant servant); + + private: + /// The executor + EXEC *executor_; + + /// Context classes + CONTEXT *context_; + + /// COmponent servant which created <this> + COMP_SERV *comp_serv_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Port_Activator_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Port_Activator_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" +#endif /*CIAO_SERVANT_ACTIVATOR_T_H*/ |