summaryrefslogtreecommitdiff
path: root/ciao/ComponentServer/CIAO_ComponentServer_Impl.h
blob: 354bc5a7af77020c1cb2036d0f6dea8b9ccbfce1 (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
82
// $Id$
/**
 * @file CIAO_ComponentServer_Impl.h
 * @author William R. Otte <wotte@dre.vanderbilt.edu>
 */

#ifndef CIAO_COMPONENTSERVER_IMPL_H_
#define CIAO_COMPONENTSERVER_IMPL_H_

#include "ciao/ComponentServer/CIAO_ComponentServerS.h"
#include "ciao/ComponentServer/CIAO_CS_ClientC.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/String_Base.h"
#include "ace/Unbounded_Set_Ex.h"

namespace CIAO
{
  namespace Deployment
  {
    class  CIAO_COMPONENTSERVER_SVNT_Export CIAO_ComponentServer_i
      : public virtual POA_CIAO::Deployment::ComponentServer
    {
    public:
      // Constructor
      CIAO_ComponentServer_i (const ACE_CString &uuid, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);

      // Destructor
      virtual ~CIAO_ComponentServer_i (void);

      virtual void shutdown (void);

      virtual ::Components::ConfigValues * configuration (void);

      virtual
      ::Components::Deployment::ServerActivator_ptr get_server_activator (void);

      virtual
      ::Components::Deployment::Container_ptr create_container (const ::Components::ConfigValues & config);

      virtual
      void remove_container (::Components::Deployment::Container_ptr cref);

      virtual
      ::Components::Deployment::Containers * get_containers (void);

      virtual
      void remove (void);

      void init (::Components::Deployment::ServerActivator_ptr sa,
                 Components::ConfigValues *cvs);

    private:
      ACE_CString uuid_;
      CORBA::ORB_var orb_;
      PortableServer::POA_var poa_;
      ::Components::Deployment::ServerActivator_var serv_act_;
      Components::ConfigValues_var config_values_;

      template<typename T>
      struct _is_equivalent
      {
        bool operator() (const T &a, const T &b) const
        {
          return a->_is_equivalent (const_cast <T&> (b));
        }
      };

      typedef ACE_Unbounded_Set_Ex <Container_var,
        _is_equivalent<Container_var> > CONTAINERS;

      CONTAINERS containers_;
      
      Components::Deployment::ComponentInstallation_var ci_;
    };
  }
}

#endif