summaryrefslogtreecommitdiff
path: root/trunk/CIAO/ciao/Port_Activator_T.h
blob: cb6635a6baabdf238d1c1187eaa781a2dd65ad46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// -*- 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*/