summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.with-connections
blob: 97b425d6dfaba7088217813194d6fe986a7d7095 (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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
// $Id$
//
// ****              Code generated by the                 ****
// ****  Component Integrated ACE ORB (CIAO) CIDL Compiler ****
// CIAO has been developed by:
//       Center for Distributed Object Computing
//       Washington University
//       St. Louis, MO
//       USA
//       http://www.cs.wustl.edu/~schmidt/doc-center.html
// CIDL Compiler has been developed by:
//       Institute for Software Integrated Systems
//       Vanderbilt University
//       Nashville, TN
//       USA
//       http://www.isis.vanderbilt.edu/
//
// Information about CIAO is available at:
//    http://www.dre.vanderbilt.edu/CIAO

#ifndef CIAO_GLUE_SESSION_SENDER_SVNT_H
#define CIAO_GLUE_SESSION_SENDER_SVNT_H

#include /**/ "ace/pre.h"

#include "SenderEC.h"

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

#include "ciao/Container_Base.h"
#include "ciao/Swapping_Container.h"
#include "ciao/Servant_Impl_T.h"
#include "ciao/Context_Impl_T.h"
#include "ciao/Home_Servant_Impl_T.h"
#include "ciao/Home_Servant_Impl_Base.h"
#include "ciao/Swapping_Servant_Home_Impl_T.h"
#include "ace/Active_Map_Manager_T.h"

#include "SenderS.h"

namespace Sender_Impl
{
  namespace CIAO_GLUE_Hello
  {
    template <typename T>
    class ReadMessage_Servant_T
    : public virtual POA_Hello::ReadMessage,
    public virtual PortableServer::RefCountServantBase
    {
      public:
      ReadMessage_Servant_T (
      ::Hello::CCM_ReadMessage_ptr executor,
      ::Components::CCMContext_ptr ctx);

      virtual ~ReadMessage_Servant_T (void);

      virtual char *
      get_message (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));


      // Get component implementation.
      virtual CORBA::Object_ptr
      _get_component (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));


      protected:
      // Facet executor.
      ::Hello::CCM_ReadMessage_var executor_;

      // Context object.
      ::Components::CCMContext_var ctx_;
    };

    typedef SENDER_SVNT_Export ReadMessage_Servant_T<int> ReadMessage_Servant;
  }

  namespace CIAO_GLUE_Hello
  {
    class Sender_Servant;

    class SENDER_SVNT_Export Sender_Context
      : public virtual CIAO::Context_Impl<
          ::Hello::CCM_Sender_Context,
          Sender_Servant,
          ::Hello::Sender,
          ::Hello::Sender_var
        >
    {
      public:
      // We will allow the servant glue code we generate to access our state.
      friend class Sender_Servant;

      /// Hack for VC6.
      typedef CIAO::Context_Impl<
          ::Hello::CCM_Sender_Context,
          Sender_Servant,
          ::Hello::Sender,
          ::Hello::Sender_var
        > ctx_svnt_base;

      Sender_Context (
      ::Components::CCMHome_ptr home,
      ::CIAO::Session_Container *c,
      Sender_Servant *sv);

      virtual ~Sender_Context (void);

      // Operations for Sender receptacles and event sources,
      // defined in ::Hello::CCM_Sender_Context.

      virtual void
      push_click_out (
      ::Hello::TimeOut *ev
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      virtual ::Components::ConsumerDescriptions *
      get_registered_consumer (const char *publisher_name
                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      // CIAO-specific.

      static Sender_Context *
      _narrow (
      ::Components::SessionContext_ptr p
      ACE_ENV_ARG_DECL_WITH_DEFAULTS);

      protected:
      // Methods that manage this component's connections and consumers.

      /*
      virtual ::Components::ConsumerDescriptions *
      get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
        ACE_THROW_SPEC ((CORBA::SystemException));
      */

      virtual ::Components::Cookie *
      subscribe_click_out (
      ::Hello::TimeOutConsumer_ptr c
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::ExceededConnectionLimit));

      virtual ::Hello::TimeOutConsumer_ptr
      unsubscribe_click_out (
      ::Components::Cookie *ck
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidConnection));

      protected:
      ACE_Active_Map_Manager<
      ::Hello::TimeOutConsumer_var>
      ciao_publishes_click_out_map_;
    };
  }

  namespace CIAO_GLUE_Hello
  {
    class SENDER_SVNT_Export Sender_Servant
      : public virtual CIAO::Servant_Impl<
          POA_Hello::Sender,
          ::Hello::CCM_Sender,
          ::Hello::CCM_Sender_var,
          Sender_Context
        >
    {
      public:
      /// Hack for VC6.
      typedef CIAO::Servant_Impl<
          POA_Hello::Sender,
          ::Hello::CCM_Sender,
          ::Hello::CCM_Sender_var,
          Sender_Context
        > comp_svnt_base;

      Sender_Servant (
      ::Hello::CCM_Sender_ptr executor,
      ::Components::CCMHome_ptr home,
      ::CIAO::Home_Servant_Impl_Base *home_servant,
      ::CIAO::Session_Container *c);

      virtual ~Sender_Servant (void);

      virtual void
      set_attributes (
      const ::Components::ConfigValues &descr
      ACE_ENV_ARG_DECL);

      // Supported operations.

      virtual void
      start (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      // Public port operations.

      virtual ::Hello::ReadMessage_ptr
      provide_push_message (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      virtual ::Components::Cookie *
      subscribe_click_out (
      ::Hello::TimeOutConsumer_ptr c
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::ExceededConnectionLimit));

      virtual ::Hello::TimeOutConsumer_ptr
      unsubscribe_click_out (
      ::Components::Cookie *ck
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidConnection));

      // Component attribute operations.

      virtual char *
      local_message (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      virtual void
      local_message (
      const char *
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      /*
      virtual ::Components::ConsumerDescriptions *
      get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
        ACE_THROW_SPEC ((CORBA::SystemException));
      */

      // Operations for Receptacles interface.

      virtual ::Components::Cookie *
      connect (
      const char *name,
      CORBA::Object_ptr connection
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidName,
      ::Components::InvalidConnection,
      ::Components::AlreadyConnected,
      ::Components::ExceededConnectionLimit));

      virtual CORBA::Object_ptr
      disconnect (
      const char *name,
      ::Components::Cookie *ck
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidName,
      ::Components::InvalidConnection,
      ::Components::CookieRequired,
      ::Components::NoConnection));

      // Operations for Events interface.

      virtual ::Components::Cookie *
      subscribe (
      const char *publisher_name,
      ::Components::EventConsumerBase_ptr subscriber
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidName,
      ::Components::InvalidConnection,
      ::Components::ExceededConnectionLimit));

      virtual ::Components::EventConsumerBase_ptr
      unsubscribe (
      const char *publisher_name,
      ::Components::Cookie *ck
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidName,
      ::Components::InvalidConnection));

      virtual void
      connect_consumer (
      const char *emitter_name,
      ::Components::EventConsumerBase_ptr consumer
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException,
      ::Components::InvalidName,
      ::Components::AlreadyConnected,
      ::Components::InvalidConnection));

      // CIAO specific operations on the servant 
      CORBA::Object_ptr
      get_facet_executor (const char *name
      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((
      ::CORBA::SystemException));

      private:

      ::Hello::ReadMessage_var
      provide_push_message_;

      private:

      void
      populate_port_tables (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

      ::CORBA::Object_ptr
      provide_push_message_i (
      ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));
    };
  }

  namespace CIAO_GLUE_Hello
  {
    class SENDER_SVNT_Export SenderHome_Servant
      : public virtual CIAO::Swapping_Servant_Home_Impl<
          POA_Hello::SenderHome,
          ::Hello::CCM_SenderHome,
          ::Hello::CCM_SenderHome_var,
          ::Hello::Sender,
          ::Hello::Sender_var,
          ::Hello::CCM_Sender,
          ::Hello::CCM_Sender_var,
          Sender_Servant
        >
    {
      public:
      /// Hack for VC6.
      typedef CIAO::Swapping_Servant_Home_Impl<
          POA_Hello::SenderHome,
          ::Hello::CCM_SenderHome,
          ::Hello::CCM_SenderHome_var,
          ::Hello::Sender,
          ::Hello::Sender_var,
          ::Hello::CCM_Sender,
          ::Hello::CCM_Sender_var,
          Sender_Servant
        > home_svnt_base;

      SenderHome_Servant (
      ::Hello::CCM_SenderHome_ptr exe,
      ::CIAO::Session_Container *c);

      virtual ~SenderHome_Servant (void);

      // Home operations.

      // Home factory and finder operations.

      // Attribute operations.
    };

    extern "C" SENDER_SVNT_Export ::PortableServer::Servant
    createSenderHome_Servant (
    ::Components::HomeExecutorBase_ptr p,
    CIAO::Session_Container *c
    ACE_ENV_ARG_DECL_WITH_DEFAULTS);
  }
}

#include /**/ "ace/post.h"

#endif /* CIAO_GLUE_SESSION_SENDER_SVNT_H */