summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/tests/MultipleTemp/Connector/MultipleTemp_Connector_T.cpp
blob: 4b4f467b57222f79423431170b4b76ee9bee3dde (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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
#include "connectors/dds4ccm/impl/DDS_Base_Connector_T.h"
#include "ace/Reactor.h"

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::FooConnector_Connector_T(void)
  : push_consumer_t_ (),
    push_consumer_y_ (),
    reactor_ (0)
{
}


/**
  * Type registration both topics
 **/
template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::register_type (
  ::DDS::DomainParticipant_ptr participant,
  const char * /*typesupport_name*/)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::register_type");

  ::DDS::ReturnCode_t retcode_t = ::DDS::RETCODE_OK;
  ::DDS::ReturnCode_t retcode_y = ::DDS::RETCODE_OK;
#if (CIAO_DDS4CCM_NDDS==1)
  ::CIAO::NDDS::DDS_DomainParticipant_i *part =
    dynamic_cast< CIAO::NDDS::DDS_DomainParticipant_i * > (participant);
  if (!part)
    {
      DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
          "DDS_MultipleTemp_FooConnector_T::register_type - "
          "Unable to cast the DomainParticipant proxy to its internal "
          "representation.\n"));
      throw ::CORBA::INTERNAL ();
    }

  typedef ::CIAO::NDDS::DDS_TypeFactory_T <DDS_TYPE_T, SEQ_TYPE_T> dds_type_factory_t;
  typedef ::CIAO::NDDS::DDS_TypeFactory_T <DDS_TYPE_Y, SEQ_TYPE_Y> dds_type_factory_y;

  ::CIAO::NDDS::DDS_TypeFactory_i * factory_t = 0;
  ::CIAO::NDDS::DDS_TypeFactory_i * factory_y = 0;

  const char* typesupport_name_t = DDS_TYPE_T::type_support::get_type_name ();
  const char* typesupport_name_y = DDS_TYPE_Y::type_support::get_type_name ();


  ACE_NEW_THROW_EX (factory_t,
                    dds_type_factory_t (),
                    ::CORBA::NO_MEMORY ());
  ::CIAO::NDDS::DDS_TypeSupport_i::register_type (typesupport_name_t,
                                                  factory_t, participant);

  ACE_NEW_THROW_EX (factory_y,
                      dds_type_factory_y (),
                      ::CORBA::NO_MEMORY ());

  ::CIAO::NDDS::DDS_TypeSupport_i::register_type (typesupport_name_y,
                                                  factory_y, participant);

  retcode_t = DDS_TYPE_T::type_support::register_type(
    part->get_rti_entity (), typesupport_name_t);

  retcode_y = DDS_TYPE_Y::type_support::register_type(
      part->get_rti_entity (), typesupport_name_y);

#endif
  if ((retcode_t != ::DDS::RETCODE_OK)  && (retcode_y != ::DDS::RETCODE_OK))
    {
      DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
          "DDS_MultipleTemp_FooConnector_T::register_type - "
          "Error registering type T <%C> and type Y <%C>\n",
          ::CIAO::DDS4CCM::translate_retcode (retcode_t),::CIAO::DDS4CCM::translate_retcode (retcode_y)));
      throw ::CCM_DDS::InternalError (retcode_t, 0);
    }
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::unregister_type (
  ::DDS::DomainParticipant_ptr participant,
  const char * typesupport_name)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::unregister_type");
#if (CIAO_DDS4CCM_NDDS==1)
  ::CIAO::NDDS::DDS_TypeFactory_i * factory =
    ::CIAO::NDDS::DDS_TypeSupport_i::unregister_type (typesupport_name, participant);
  delete factory;
#else
  ACE_UNUSED_ARG (participant);
  ACE_UNUSED_ARG (typesupport_name);
#endif

}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
char *
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::topic_name_t (void)
{
  return CORBA::string_dup (this->topic_name_t_.in ());
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::topic_name_t (
  const char * topic_name_t)
{
  this->topic_name_t_ = topic_name_t;
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
::CCM_DDS::CCM_ContentFilterSetting *
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_t_filter_config(void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_t_filter_config");
  this->push_consumer_t_.set_component (this);
  return this->push_consumer_t_.get_filter_config ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
::CCM_DDS::QueryFilter *
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::push_consumer_t_filter (void)
{
  return this->push_consumer_t_.filter ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::push_consumer_t_filter (
  const ::CCM_DDS::QueryFilter &filter)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::push_consumer_t_filter");
  this->push_consumer_t_.filter (filter);
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_t_traits::data_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_t_data (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_t_data");
  this->push_consumer_t_.set_component (this);
  return this->push_consumer_t_.get_data ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_t_traits::data_control_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_t_data_control (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_t_data_control");
  this->push_consumer_t_.set_component (this);
  return this->push_consumer_t_.get_data_control ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_t_traits::dds_entity_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_t_dds_entity (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_t_dds_entity");
  this->push_consumer_t_.set_component (this);
  return this->push_consumer_t_.get_dds_entity ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::observable_t_traits::data_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_observable_t_data (void)
{
//  return CCM_TYPE::observable_t_traits::data_type::_nil();
  this->observable_t_.set_component (this);
  return this->observable_t_.get_data ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::observable_t_traits::dds_entity_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_observable_t_dds_entity (void)
{
  this->observable_t_.set_component (this);
  return this->observable_t_.get_dds_entity ();
}

// Y
template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
char *
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::topic_name_y (void)
{
  return CORBA::string_dup (this->topic_name_y_.in ());
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::topic_name_y (
  const char * topic_name_y)
{
  this->topic_name_y_ = topic_name_y;
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
::CCM_DDS::CCM_ContentFilterSetting*
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_y_filter_config(void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_y_filter_config");
  this->push_consumer_y_.set_component (this);
  return this->push_consumer_y_.get_filter_config ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
::CCM_DDS::QueryFilter *
 FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::push_consumer_y_filter (void)
{
  return this->push_consumer_y_.filter ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::push_consumer_y_filter (
  const ::CCM_DDS::QueryFilter &filter)
{
  this->push_consumer_y_.filter (filter);
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_y_traits::data_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_y_data (void)
{
  this->push_consumer_y_.set_component (this);
  return this->push_consumer_y_.get_data ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_y_traits::data_control_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_y_data_control (void)
{
  this->push_consumer_y_.set_component (this);
  return this->push_consumer_y_.get_data_control ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::push_consumer_y_traits::dds_entity_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_push_consumer_y_dds_entity (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_push_consumer_y_dds_entity");
  this->push_consumer_y_.set_component (this);
  return this->push_consumer_y_.get_dds_entity ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::observable_y_traits::data_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_observable_y_data (void)
{
  this->observable_y_.set_component (this);
  return this->observable_y_.get_data ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
typename CCM_TYPE::observable_y_traits::dds_entity_type::_ptr_type
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::get_observable_y_dds_entity (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::get_observable_y_dds_entity");
  this->observable_y_.set_component (this);
  return this->observable_y_.get_dds_entity ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::configuration_complete (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::configuration_complete");
  // Init default domain in Base_Connector
  BaseConnector::configuration_complete ();

  if (::CORBA::is_nil (this->domain_participant_.in ()))
    {
      ACE_ERROR ((LM_ERROR, "FooConnector_Connector_T::configuration complete init_domain - "
                   "Error domain_participant\n"));
       throw ::CORBA::INTERNAL ();
    }

  // Second argument can be removed if register_type is changed in (Topic)Base_Connector_T
  this->register_type (this->domain_participant_.in (),
                       "dummy_name");

  const char* typesupport_name_t = DDS_TYPE_T::type_support::get_type_name ();
  const char* typesupport_name_y = DDS_TYPE_Y::type_support::get_type_name ();

  // Create the topics needed
  this->init_topic (this->domain_participant_.in (),
                       this->topic_t_.inout () ,
                       this->topic_name_t_.in (),
                       typesupport_name_t);

  if (::CORBA::is_nil (this->topic_t_.in ()))
     {
       ACE_ERROR ((LM_ERROR, "FooConnector_Connector_T*** configuration complete init_topic - "
                  "Error creating topic for t\n"));
       throw ::CORBA::INTERNAL ();
     }

  this->init_topic (this->domain_participant_.in (),
                         this->topic_y_.inout () ,
                         this->topic_name_y_.in (),
                         typesupport_name_y);

  if (::CORBA::is_nil (this->topic_y_.in ()))
      {
        ACE_ERROR ((LM_ERROR, "FooConnector_Connector_T*** configuration complete init_topic - "
                   "Error creating topic for y\n"));
        throw ::CORBA::INTERNAL ();
      }

  // Init the subscriber and publisher
  this->init_subscriber (this->domain_participant_.in (),
                         this->subscriber_t_.inout ());
  this->init_publisher (this->domain_participant_.in (),
                        this->publisher_t_.inout ());
  this->init_subscriber (this->domain_participant_.in (),
                         this->subscriber_y_.inout ());
  this->init_publisher (this->domain_participant_.in (),
                      this->publisher_y_.inout ());

  this->observable_t_.configuration_complete (
          this->topic_t_.in (),
          this->publisher_t_.in (),
          this->qos_profile_);
  this->observable_y_.configuration_complete (
           this->topic_y_.in (),
           this->publisher_y_.in (),
           this->qos_profile_);

  this->dl_t_ = this->context_->get_connection_push_consumer_t_data_listener ();
  this->dl_y_ = this->context_->get_connection_push_consumer_y_data_listener ();

  this->push_consumer_t_psl =
     this->context_->get_connection_push_consumer_t_status ();

  this->push_consumer_y_psl =
     this->context_->get_connection_push_consumer_y_status ();


  this->push_consumer_t_.configuration_complete (
                                      this->topic_t_.in (),
                                      this->subscriber_t_.in (),
                                      this->qos_profile_);
  this->push_consumer_y_.configuration_complete (
                                       this->topic_y_.in (),
                                       this->subscriber_y_.in (),
                                       this->qos_profile_);
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::ccm_activate (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::ccm_activate");
  BaseConnector::ccm_activate ();
  ACE_Reactor* reactor = 0;

  this->activate_subscriber (reactor,
                             this->subscriber_t_.in (),
                             this->subscriber_t_listener_.inout ());
  this->activate_publisher (reactor,
                            this->publisher_t_.in (),
                            this->publisher_t_listener_.inout ());

  this->activate_topic ( reactor,
                         this->topic_t_.in (),
                         this->topiclistener_t_.inout ());
  this->activate_topic (reactor,
                        this->topic_y_.in (),
                        this->topiclistener_y_.inout ());

  this->push_consumer_t_.activate (this->dl_t_.in (),
                                    push_consumer_t_psl.in (),
                                    this->reactor_);

  this->push_consumer_y_.activate (this->dl_y_.in (),
                                          push_consumer_y_psl.in (),
                                          this->reactor_);
  this->observable_t_.activate ();
  this->observable_y_.activate ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::ccm_passivate (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::ccm_passivate");

  if (ACE_OS::strlen (this->topic_name_t_) != 0)
    {
      this->observable_t_.passivate ();
      this->push_consumer_t_.passivate ();
    }
  if (ACE_OS::strlen (this->topic_name_y_) != 0)
    {
      this->observable_y_.passivate ();
      this->push_consumer_y_.passivate ();
    }

  ::DDS::TopicListener_var topiclistener_t =
     this->topiclistener_t_._retn ();
   if (! CORBA::is_nil (topiclistener_t.in ()))
     {
       this->passivate_topic (this->topic_t_.in (),
                              topiclistener_t.in ());
     }

   ::DDS::TopicListener_var topiclistener_y =
       this->topiclistener_y_._retn ();
   if (! CORBA::is_nil (topiclistener_y.in ()))
     {
       this->passivate_topic (this->topic_y_.in (),
                              topiclistener_y.in ());
     }

  ::DDS::SubscriberListener_var subscriber_t_listener =
    this->subscriber_t_listener_._retn ();
  if (!::CORBA::is_nil (subscriber_t_listener.in ()))
    {
      this->passivate_subscriber (this->subscriber_t_.in (),
                                    subscriber_t_listener.in ());
    }

  ::DDS::PublisherListener_var publisher_t_listener =
    this->publisher_t_listener_._retn ();
  if (!::CORBA::is_nil (publisher_t_listener.in ()))
    {
      this->passivate_publisher (this->publisher_t_.in (),
                                   publisher_t_listener.in ());
    }

  ::DDS::SubscriberListener_var subscriber_y_listener =
      this->subscriber_y_listener_._retn ();
  if (!::CORBA::is_nil (subscriber_y_listener.in ()))
    {
      this->passivate_subscriber (this->subscriber_y_.in (),
                                    subscriber_y_listener.in ());
    }

  ::DDS::PublisherListener_var publisher_y_listener =
      this->publisher_y_listener_._retn ();
  if (!::CORBA::is_nil (publisher_y_listener.in ()))
    {
      this->passivate_publisher (this->publisher_y_.in (),
                                   publisher_y_listener.in ());
    }

  BaseConnector::ccm_passivate ();
}

template <typename CCM_TYPE, typename DDS_TYPE_T, bool FIXED_T, typename SEQ_TYPE_T, typename DDS_TYPE_Y, bool FIXED_Y, typename SEQ_TYPE_Y>
void
FooConnector_Connector_T<CCM_TYPE, DDS_TYPE_T, FIXED_T, SEQ_TYPE_T, DDS_TYPE_Y, FIXED_Y, SEQ_TYPE_Y>::ccm_remove (void)
{
  DDS4CCM_TRACE ("FooConnector_Connector_T::ccm_remove");

  if (ACE_OS::strlen (this->topic_name_t_) != 0)
    {
      this->observable_t_.remove (this->publisher_t_.in ());
      this->push_consumer_t_.remove (this->subscriber_t_.in ());

    }

  if (ACE_OS::strlen (this->topic_name_y_) != 0)
    {
      this->observable_y_.remove (this->publisher_y_.in ());
      this->push_consumer_y_.remove (this->subscriber_y_.in ());
    }

  ::DDS::Topic_var topic_t = this->topic_t_._retn ();
  if (! CORBA::is_nil (topic_t.in ()))
    {
      this->remove_topic (this->domain_participant_.in (),
                          topic_t.in ());
    }

  ::DDS::Topic_var topic_y = this->topic_y_._retn ();
  if (! CORBA::is_nil (topic_y.in ()))
    {
      this->remove_topic (this->domain_participant_.in (),
                          topic_y.in ());
    }

  const char* typesupport_name_t = DDS_TYPE_T::type_support::get_type_name ();
  this->unregister_type (this->domain_participant_.in (),
                        typesupport_name_t);
  const char* typesupport_name_y = DDS_TYPE_Y::type_support::get_type_name ();
  this->unregister_type (this->domain_participant_.in (),
                        typesupport_name_y);

  ::DDS::Publisher_var publisher_t = this->publisher_t_._retn ();
  if (!::CORBA::is_nil (publisher_t.in ()))
    {
      this->remove_publisher (this->domain_participant_.in (),
                              publisher_t.in ());
    }

  ::DDS::Subscriber_var subscriber_t = this->subscriber_t_._retn ();
  if (!::CORBA::is_nil (subscriber_t.in ()))
    {
       this->remove_subscriber (this->domain_participant_.in (),
                                   subscriber_t.in ());
    }

  ::DDS::Publisher_var publisher_y = this->publisher_y_._retn ();
  if (!::CORBA::is_nil (publisher_y.in ()))
    {
      this->remove_publisher (this->domain_participant_.in (),
                                 publisher_y.in ());
    }
  ::DDS::Subscriber_var subscriber_y = this->subscriber_y_._retn ();
  if (!::CORBA::is_nil (subscriber_y.in ()))
    {
      this->remove_subscriber (this->domain_participant_.in (),
                                  subscriber_y.in ());
    }

  BaseConnector::ccm_remove ();
 }