summaryrefslogtreecommitdiff
path: root/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl
blob: 02747acbd91f6a249040ea10abcf5029de9ccb7f (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// $Id$ -*- C++ -*-

//    The generated filename for files using this template shoule be
//       [idl-basename]GS.i        GS --> GlueSession

// @@ Notice: [ciao module name] can expand to either CIAO_GLUE or
//    CIAO_GLUE_[module name] as defined in the header file.

/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/// @@@ Notice that all component and interface names need to be
/// fully qualified as we are creating a new namespace for the CIAO's
/// container glue code.
/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


//////////////////////////////////////////////////////////////////
// Component specific context implementation
//////////////////////////////////////////////////////////////////

ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Context::GPS_Context (::Components::CCMHome_ptr home,
                                               ::CIAO::Session_Container *c,
                                               CIAO_GLUE_HUDisplay::GPS_Servant *sv)
  : home_ (::Components::CCMHome::_duplicate (home)),
    container_ (c),
    servant_ (sv)
{
}

ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Context::~GPS_Context ()
{
}

// Operations for emits interfaces.

// Operations for ::Components::CCMContext
ACE_INLINE ::Components::Principal_ptr
CIAO_GLUE_HUDisplay::GPS_Context::get_caller_principal (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // @@ We don't support Security in CIAO yet.
  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}

ACE_INLINE ::Components::CCMHome_ptr
CIAO_GLUE_HUDisplay::GPS_Context::get_CCM_home (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return ::Components::CCMHome::_duplicate (this->home_.in ());
}

ACE_INLINE CORBA::Boolean
CIAO_GLUE_HUDisplay::GPS_Context::get_rollback_only (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   Components::IllegalState))
{
  // @@ We don't support Transaction in CIAO yet.
  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}

ACE_INLINE ::Components::Transaction::UserTransaction_ptr
CIAO_GLUE_HUDisplay::GPS_Context::get_user_transaction (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   Components::IllegalState))
{
  // @@ We don't support Transaction in CIAO yet.
  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}

ACE_INLINE CORBA::Boolean
CIAO_GLUE_HUDisplay::GPS_Context::is_caller_in_role (const char * role
                                                     ACE_ENV_ARG_DECL)
      ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_UNUSED_ARG (role);

  // @@ We don't support Transaction in CIAO yet.
  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}

ACE_INLINE void
CIAO_GLUE_HUDisplay::GPS_Context::set_rollback_only (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   Components::IllegalState))
{
  // @@ We don't support Transaction in CIAO yet.
  ACE_THROW (CORBA::NO_IMPLEMENT ());
}

//////////////////////////////////////////////////////////////////
// Component Servant Glue code implementation
//////////////////////////////////////////////////////////////////

ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Servant::GPS_Servant (HUDisplay::CCM_GPS_ptr exe,
                                               ::Components::CCMHome_ptr h,
                                               ::CIAO::Session_Container *c)
  : executor_ (HUDisplay::CCM_GPS::_duplicate (exe)),
    container_ (c)
{
  this->context_ = new CIAO_GLUE_HUDisplay::GPS_Context (h, c, this);

  ACE_TRY_NEW_ENV
    {
      Components::SessionComponent_var scom =
        Components::SessionComponent::_narrow (exe
                                               ACE_ENV_ARG_PARAMETER);
      ACE_TRY_CHECK;

      if (! CORBA::is_nil (scom.in ()))
        {
          scom->set_session_context (this->context_
                                     ACE_ENV_ARG_PARAMETER);
        }
    }
  ACE_CATCHANY
    {
      // @@ Ignore any exceptions?  What happens if
      // set_session_context throws an CCMException?
    }
  ACE_ENDTRY;
}

ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Servant::~GPS_Servant (void)
{
  this->context_->_remove_ref ();
}

//////////////////////////////////////////////////////////////////
// EventConsumer Glue Code implementation
// @@ We are assuming that these consumers are declared under the same
//    module as the component (thus, we are placing this glue code
//    here under the same namespace.  If they are not, we will
//    either be generating them in separate namespaces, or include
//    some other CIDL generated files to get the glue code
//    implementation.
//////////////////////////////////////////////////////////////////

// Constructor and destructor.
ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::tickConsumer_Refresh_Servant
  (HUDisplay::CCM_GPS_ptr executor,
   HUDisplay::CCM_GPS_Context_ptr c)
    : executor_ (HUDisplay::CCM_GPS::_duplicate (executor)),
      ctx_ (HUDisplay::CCM_GPS_Context::_duplicate (c))
{
}

ACE_INLINE
CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::~tickConsumer_Refresh_Servant ()
{
}

ACE_INLINE CORBA::Object_ptr
CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::_get_component (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER);
}

ACE_INLINE void
CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::push_tick
  (HUDisplay::tick_ptr evt
   ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  this->executor_->push_Refresh (evt
                                 ACE_ENV_ARG_PARAMETER);
}

// Operations for emits interfaces.

// Operations for publishes interfaces.
ACE_INLINE ::Components::Cookie_ptr
CIAO_GLUE_HUDisplay::GPS_Servant::subscribe_Ready (HUDisplay::tickConsumer_ptr c
                                                   ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   ::Components::ExceededConnectionLimit))
{
  return this->context_->subscribe_Ready (c
                                          ACE_ENV_ARG_PARAMETER);
}

ACE_INLINE HUDisplay::tickConsumer_ptr
CIAO_GLUE_HUDisplay::GPS_Servant::unsubscribe_Ready (::Components::Cookie_ptr ck
                                                     ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   ::Components::InvalidConnection))
{
  return this->context_->unsubscribe_Ready (ck
                                            ACE_ENV_ARG_PARAMETER);
}

//////////////////////////////////////////////////////////////////
// Component Home Glue code implementation
//////////////////////////////////////////////////////////////////

ACE_INLINE
CIAO_GLUE_HUDisplay::GPSHome_Servant::GPSHome_Servant (HUDisplay::CCM_GPSHome_ptr exe,
                                                       CIAO::Session_Container *c)
  : executor_ (HUDisplay::CCM_GPSHome::_duplicate (exe)),
    container_ (c)
{
}

ACE_INLINE
CIAO_GLUE_HUDisplay::GPSHome_Servant::~GPSHome_Servant (void)
{
}

// Operations for KeylessHome interface
ACE_INLINE ::Components::CCMObject_ptr
CIAO_GLUE_HUDisplay::GPSHome_Servant::create_component (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException,
                   Components::CreateFailure))
{
  // Simply forward to the create method.
  return this->create (ACE_ENV_SINGLE_ARG_PARAMETER);
}

// Operations for CCMHome interface
ACE_INLINE ::CORBA::IRObject_ptr
CIAO_GLUE_HUDisplay::GPSHome_Servant::get_component_def (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // @@ TO-DO.  Contact IfR?

  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}

ACE_INLINE CORBA::IRObject_ptr
CIAO_GLUE_HUDisplay::GPSHome_Servant::get_home_def (ACE_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // @@ TO-DO.  Contact IfR?

  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
}