summaryrefslogtreecommitdiff
path: root/modules/CIAO/tests/IDL_Test/Double_Inherited_Component/ComponentC_exec.cpp
blob: d99674377610ae8762f29548d9d73108dbb0a224 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// -*- C++ -*-
// $Id$

#include "ComponentC_exec.h"
#include "ciao/Logger/Log_Macros.h"

namespace CIAO_connector_test_C_Impl
{
  //============================================================
  // Pulse generator
  //============================================================

  ComponentC_exec_i::ComponentC_exec_i  (void)
    : topic_name_c_ (""),
      topic_name_b_ (""),
      topic_name_a_ (""),
      topic_name_c_has_been_set_ (false),
      topic_name_b_has_been_set_ (false),
      topic_name_a_has_been_set_ (false)
  {
  }

  ComponentC_exec_i::~ComponentC_exec_i  (void)
  {
  }

  // Port operations.
  void
  ComponentC_exec_i::topic_name_c (const char * topic_name)
  {
    this->topic_name_c_ = topic_name;
    this->topic_name_c_has_been_set_ = true;
  }
  char *
  ComponentC_exec_i::topic_name_c (void)
  {
    return CORBA::string_dup (this->topic_name_c_.in ());
  }

  void
  ComponentC_exec_i::topic_name_b (const char * topic_name)
  {
    this->topic_name_b_ = topic_name;
    this->topic_name_b_has_been_set_ = true;
  }
  char *
  ComponentC_exec_i::topic_name_b (void)
  {
    return CORBA::string_dup (this->topic_name_b_.in ());
  }

  void
  ComponentC_exec_i::topic_name_a (const char * topic_name)
  {
    this->topic_name_a_ = topic_name;
    this->topic_name_a_has_been_set_ = true;
  }
  char *
  ComponentC_exec_i::topic_name_a (void)
  {
    return CORBA::string_dup (this->topic_name_a_.in ());
  }
  // Operations from Components::SessionComponent.
  void
  ComponentC_exec_i::set_session_context (
    ::Components::SessionContext_ptr ctx)
  {
    this->context_ =
      ::connector_test::CCM_C_Context::_narrow (ctx);

    if ( ::CORBA::is_nil (this->context_.in ()))
      {
        throw ::CORBA::INTERNAL ();
      }
  }

  void
  ComponentC_exec_i::configuration_complete (void)
  {
  }

  void
  ComponentC_exec_i::ccm_activate (void)
  {
  }

  void
  ComponentC_exec_i::ccm_passivate (void)
  {
  }

  void
  ComponentC_exec_i::ccm_remove (void)
  {
    if (!this->topic_name_c_has_been_set_)
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Topic name C has not been set\n")));
    if (!this->topic_name_b_has_been_set_)
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Topic name B has not been set\n")));
    if (!this->topic_name_a_has_been_set_)
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Topic name A has not been set\n")));
  }

  extern "C" INHERITED_COMPONENTS_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_ComponentC_Impl (void)
  {
    ::Components::EnterpriseComponent_ptr retval =
      ::Components::EnterpriseComponent::_nil ();

    ACE_NEW_NORETURN (
      retval,
      ComponentC_exec_i );

    return retval;
  }
}