OpenDDS  Snapshot(2023/04/28-20:55)
DCPS_IR_Domain.cpp
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #include "DcpsInfo_pch.h"
7 
8 #include "DCPS_IR_Domain.h"
9 
10 #include "DCPS_IR_Participant.h"
13 
17 #include <dds/DCPS/PublisherImpl.h>
18 #include <dds/DCPS/GuidUtils.h>
21 #include <dds/DCPS/DCPS_Utils.h>
22 #ifndef DDS_HAS_MINIMUM_BIT
25 #endif
26 
27 #include <dds/DCPS/InfoRepoDiscovery/InfoC.h>
28 
29 #include <tao/debug.h>
30 
31 #include <algorithm>
32 #include <sstream>
33 
34 
36 
38 
40  : id_(id),
41  participantIdGenerator_(generator),
42  useBIT_(false)
43 {
44 }
45 
47 {
48 }
49 
52 {
53  return this->participants_;
54 }
55 
57 {
58  DCPS_IR_Participant_Map::const_iterator where = participants_.find(id);
59 
60  if (where != participants_.end()) {
61  return where->second;
62 
63  } else {
64  return DCPS_IR_Participant_rch();
65  }
66 }
67 
68 
70 {
72  return p ? p.in() : 0;
73 }
74 
76 {
77  OpenDDS::DCPS::GUID_t participantId = participant->get_id();
78  OpenDDS::DCPS::RepoIdConverter converter(participantId);
79 
80  DCPS_IR_Participant_Map::iterator where
81  = this->participants_.find(participantId);
82 
83  if (where == this->participants_.end()) {
84  this->participants_.insert(
85  DCPS_IR_Participant_Map::value_type(participantId, participant));
86 
87  // Publish the BIT information
88  publish_participant_bit(participant.in());
89 
92  ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_participant: ")
93  ACE_TEXT("added participant %C in domain %d ")
94  ACE_TEXT("at 0x%x.\n"),
95  std::string(converter).c_str(),
96  id_,
97  participant.in()));
98  }
99 
100  } else {
103  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_participant: ")
104  ACE_TEXT("attempt to add already existing participant %C in domain %d.\n"),
105  std::string(converter).c_str(),
106  id_));
107  }
108 
109  return 1;
110  }
111 
112  return 0;
113 }
114 
116  CORBA::Boolean notify_lost)
117 {
118  DCPS_IR_Participant_Map::iterator where
119  = this->participants_.find(participantId);
120 
121  if (where != this->participants_.end()) {
122  // Extract the participant from the map.
123  DCPS_IR_Participant_rch participant = where->second;
124 
125  // make sure the participant has cleaned up all publications,
126  // subscriptions, and any topic references
127  participant->remove_all_dependents(notify_lost);
128 
129  // Then remove it from the map.
130  this->participants_.erase(where);
131 
133  OpenDDS::DCPS::RepoIdConverter converter(participantId);
135  ACE_TEXT("(%P|%t) DCPS_IR_Domain::remove_participant: ")
136  ACE_TEXT("removed participant %C at 0x%x from domain %d.\n"),
137  std::string(converter).c_str(),
138  participant.in(),
139  id_));
140  }
141 
142  dispose_participant_bit(participant.get());
143  return 0;
144 
145  } else {
146  OpenDDS::DCPS::RepoIdConverter converter(participantId);
148  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::remove_participant: ")
149  ACE_TEXT("unable to find participant %C in domain %d.\n"),
150  std::string(converter).c_str(),
151  id_));
152  return 1;
153  }
154 }
155 
156 OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic(OpenDDS::DCPS::GUID_t_out topicId,
157  const char * topicName,
158  const char * dataTypeName,
159  const DDS::TopicQos & qos,
160  DCPS_IR_Participant* participantPtr)
161 {
162  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
163 
164  bool isBIT = OpenDDS::DCPS::topicIsBIT(topicName, dataTypeName);
165  OpenDDS::DCPS::GUID_t new_topic_id = participantPtr->get_next_topic_id(isBIT);
166  OpenDDS::DCPS::TopicStatus status = add_topic_i(new_topic_id, topicName
167  , dataTypeName
168  , qos, participantPtr, isBIT);
169 
170  if (status == OpenDDS::DCPS::CREATED) {
171  topicId = new_topic_id;
172  }
173 
174  return status;
175 }
176 
179  const char* topicName,
180  const char* dataTypeName,
181  const DDS::TopicQos & qos,
182  DCPS_IR_Participant* participantPtr)
183 {
184  OpenDDS::DCPS::GUID_t topic_id = topicId;
185  bool isBIT = OpenDDS::DCPS::topicIsBIT(topicName, dataTypeName);
186  OpenDDS::DCPS::TopicStatus status = add_topic_i(topic_id, topicName
187  , dataTypeName
188  , qos, participantPtr, isBIT);
189 
190  return status;
191 }
192 
194  const char * topicName,
195  const char * dataTypeName,
196  const DDS::TopicQos & qos,
197  DCPS_IR_Participant* participantPtr,
198  bool isBIT)
199 {
200  DCPS_IR_Topic_Description* description;
201  int descriptionLookup = find_topic_description(topicName, dataTypeName, description);
202 
203  if (1 == descriptionLookup) {
204  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
206 
207  } else if (-1 == descriptionLookup) {
208  using namespace OpenDDS::DCPS;
211  this,
212  topicName,
213  dataTypeName));
214  description = desc.get();
215  int descriptionAddition = add_topic_description(move(desc));
216 
217  if (0 != descriptionAddition) {
218  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
219 
220  if (2 == descriptionAddition) {
222 
223  } else {
225  }
226  }
227  }
228 
231  topicId,
232  qos,
233  this,
234  participantPtr,
235  description,
236  isBIT));
237 
239 
240  switch (description->add_topic(topic.get())) {
241  case 0: {
242  switch (participantPtr->add_topic_reference(topic.get())) {
243  case 0: {
245  OpenDDS::DCPS::RepoIdConverter converter(topicId);
247  ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_topic_i: ")
248  ACE_TEXT("Domain %d successfully added topic %C ")
249  ACE_TEXT("at 0x%x.\n"),
250  this->id_,
251  std::string(converter).c_str(),
252  topic.get()));
253  }
254 
255  topicStatus = OpenDDS::DCPS::CREATED;
256 
257  // Publish the BIT information
258  publish_topic_bit(topic.get());
259 
260  // Keep a reference to easily locate the topic by id.
261  this->idToTopicMap_[topicId] = move(topic);
262 
263  }
264  break;
265 
266  case 1:
267 
269  OpenDDS::DCPS::RepoIdConverter converter(topicId);
271  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_i: ")
272  ACE_TEXT("Domain %d declined to add duplicate topic %C at 0x%x.\n"),
273  this->id_,
274  std::string(converter).c_str(),
275  topic.get()));
276  }
277 
278  topicStatus = OpenDDS::DCPS::NOT_FOUND;
279  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
280  description->remove_topic(topic.get());
281  break;
282 
283  case -1: {
284  OpenDDS::DCPS::RepoIdConverter converter(topicId);
286  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic_i: ")
287  ACE_TEXT("Domain %d failed to add topic %C at 0x%x.\n"),
288  this->id_,
289  std::string(converter).c_str(),
290  topic.get()));
291  topicStatus = OpenDDS::DCPS::NOT_FOUND;
292  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
293  description->remove_topic(topic.get());
294  }
295  break;
296  }
297  }
298  break;
299 
300  case 1:
301 
303  OpenDDS::DCPS::RepoIdConverter converter(topicId);
304  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) WARNING: DCPS_IR_Domain::add_topic ")
305  ACE_TEXT("Unable to add topic 0x%x id %C to Topic Description\n"),
306  topic.get(),
307  std::string(converter).c_str()));
308  }
309 
310  topicStatus = OpenDDS::DCPS::NOT_FOUND;
311  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
312  break;
313 
314  case -1: {
315  OpenDDS::DCPS::RepoIdConverter converter(topicId);
316  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic ")
317  ACE_TEXT("Unable to add topic 0x%x id %C to Topic Description\n"),
318  topic.get(),
319  std::string(converter).c_str()));
320  topicStatus = OpenDDS::DCPS::NOT_FOUND;
321  topicId = OpenDDS::DCPS::GUID_UNKNOWN;
322  }
323  break;
324  }
325 
326  return topicStatus;
327 }
328 
330 DCPS_IR_Domain::find_topic(const char* topicName, DCPS_IR_Topic*& topic)
331 {
332  DCPS_IR_Topic_Description_Set::iterator which
333  = this->topicDescriptions_.find(topicName);
334 
335  if (which != this->topicDescriptions_.end()) {
336  // Extract the topic from the description.
337  topic = which->second->get_first_topic();
338 
340  OpenDDS::DCPS::GUID_t topicId = topic->get_id();
341  OpenDDS::DCPS::RepoIdConverter converter(topicId);
343  ACE_TEXT("(%P|%t) DCPS_IR_Domain::find_topic: ")
344  ACE_TEXT("located topic %C in domain %d.\n"),
345  std::string(converter).c_str(),
346  id_));
347  }
348 
349  return OpenDDS::DCPS::FOUND;
350 
351  } else {
352  // topic = 0;
354  }
355 }
356 
359 {
360  IdToTopicMap::const_iterator location = this->idToTopicMap_.find(id);
361 
362  if (location == this->idToTopicMap_.end()) {
363  return 0;
364  }
365 
366  return location->second.get();
367 }
368 
370  DCPS_IR_Topic*& topic)
371 {
372  DCPS_IR_Topic_Description* description = topic->get_topic_description();
373 
374  if (description->remove_topic(topic) != 0) {
375  // An unknown error means that the description may still
376  // have the topic in its topic set. We can't remove it.
377  // The system is an inconsistent state!
379  }
380 
381  if (description->get_number_topics() == 0) {
382  // Remove the topic description
383  if (remove_topic_description(description) != 0) {
384  // An unknown error means that the description may still
385  // have the topic in its topic set.
387  ACE_TEXT("(%P|%t) ERROR: Topic Description %C %C ")
388  ACE_TEXT("was not correctly removed from Domain %d"),
389  description->get_name(),
390  description->get_dataTypeName(),
391  id_));
392 
393  }
394  }
395 
396  // description variable is invalid after this point
397 
398  if (part->remove_topic_reference(topic->get_id(), topic) != 0) {
399  OpenDDS::DCPS::RepoIdConverter part_converter(part->get_id());
400  OpenDDS::DCPS::RepoIdConverter topic_converter(topic->get_id());
402  ACE_TEXT("(%P|%t) ERROR: Domain %d Topic %C ")
403  ACE_TEXT("was not correctly removed from Participant %C"),
404  id_,
405  std::string(topic_converter).c_str(),
406  std::string(part_converter).c_str()));
407  }
408 
409  // Dispose the BIT information
410  dispose_topic_bit(topic);
411 
412  topic->release(true);
413  topic = 0;
414  return OpenDDS::DCPS::REMOVED;
415 }
416 
417 int
419  const char* name,
420  const char* dataTypeName,
422 {
423  DCPS_IR_Topic_Description_Set::iterator which
424  = this->topicDescriptions_.find(name);
425 
426  if (which != this->topicDescriptions_.end()) {
427  if (0 == ACE_OS::strcmp(dataTypeName, which->second->get_dataTypeName())) {
430  ACE_TEXT("(%P|%t) DCPS_IR_Domain::find_topic_description: ")
431  ACE_TEXT("located topic description %C/%C in domain %d.\n"),
432  name,
433  dataTypeName,
434  id_));
435  }
436 
437  desc = which->second.get();
438  return 0;
439 
440  } else {
443  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::find_topic_description: ")
444  ACE_TEXT("searching for topic description %C/%C, ")
445  ACE_TEXT("located topic description %C/%C instead in domain %d.\n"),
446  name,
447  dataTypeName,
448  which->second->get_name(),
449  which->second->get_dataTypeName(),
450  id_));
451  }
452 
453  // desc = 0;
454  return 1;
455  }
456 
457  } else {
458  // desc = 0;
459  return -1;
460  }
461 }
462 
463 #if defined (DDS_HAS_MINIMUM_BIT)
464 int DCPS_IR_Domain::init_built_in_topics(bool /* federated */, bool /*persistent*/)
465 {
466  return 1;
467 }
468 #else
469 int DCPS_IR_Domain::init_built_in_topics(bool federated, bool persistent)
470 {
471  // Indicates that BIT subscriber and datareaders should not be created.
472  TheTransientKludge->enable();
473 
476  ACE_TEXT("(%P|%t) DCPS_IR_Domain::init_built_in_topics() ")
477  ACE_TEXT(" Initializing Built In Topics for domain %d\n"),
478  id_));
479  }
480 
481  try {
483 
485 
487  bitParticipantFactory_->create_participant(id_,
491 
492  if (CORBA::is_nil(bitParticipant_.in())) {
494  ACE_TEXT("(%P|%t) ERROR: ")
495  ACE_TEXT("Nil DomainParticipant in ")
496  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
497  1);
498  }
499 
500 
501  int transportResult = init_built_in_topics_transport(persistent);
502 
503  if (0 != transportResult) {
504  return transportResult;
505  }
506 
507  int topicsResult = init_built_in_topics_topics();
508 
509  if (0 != topicsResult) {
510  return topicsResult;
511  }
512 
513  int datawritersResult = init_built_in_topics_datawriters(federated);
514 
515  if (0 != datawritersResult) {
516  return datawritersResult;
517  }
518 
519  } catch (const CORBA::Exception& ex) {
520  ex._tao_print_exception("ERROR: Exception caught in DCPS_IR_Domain::init_built_in-topics()");
521  return 1;
522  }
523 
524  // enable the Built-In Topics
525  useBIT_ = true;
526  return 0;
527 }
528 #endif // !defined (DDS_HAS_MINIMUM_BIT)
529 
530 #if defined (DDS_HAS_MINIMUM_BIT)
532 {
533  return 1;
534 }
535 #else
537 {
540  ACE_TEXT("(%P|%t) DCPS_IR_Domain::reassociate_built_in_topic_pubs() ")
541  ACE_TEXT(" Re-associating Built In Topics for domain %d\n"),
542  id_));
543  }
544 
545  DCPS_IR_Participant_Map::iterator participantIter = participants_.begin();
546  DCPS_IR_Participant_Map::iterator end = participants_.end();
547  while (participantIter != end
548  && !participantIter->second->isBitPublisher() ) {
549  participantIter++;
550  }
551 
552  if (participantIter != end) {
553  for (DCPS_IR_Topic_Map::const_iterator topicIter
554  = participantIter->second->topics().begin();
555  topicIter != participantIter->second->topics().end();
556  ++topicIter) {
557  topicIter->second->reassociate_all_publications();
558  }
559  }
560 
561  return 0;
562 }
563 #endif // !defined (DDS_HAS_MINIMUM_BIT)
564 
566 {
567 #if !defined (DDS_HAS_MINIMUM_BIT)
568 
569  try {
570  DDS::TopicQos topic_qos;
571  bitParticipant_->get_default_topic_qos(topic_qos);
572 
573  // Participant topic
574  DDS::ParticipantBuiltinTopicDataTypeSupport_var
575  participantTypeSupport(new DDS::ParticipantBuiltinTopicDataTypeSupportImpl());
576 
577  if (DDS::RETCODE_OK !=
578  participantTypeSupport->register_type(bitParticipant_.in(),
581  ACE_TEXT("(%P|%t) ERROR: Failed to register the ParticipantBuiltinTopicDataTypeSupport.")));
582  return 1;
583  }
584 
588  topic_qos,
589  DDS::TopicListener::_nil(),
591 
594  ACE_TEXT("(%P|%t) ERROR: ")
595  ACE_TEXT("Nil %C Topic from ")
596  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
598  1);
599  }
600 
601  // Topic topic
602  DDS::TopicBuiltinTopicDataTypeSupport_var
603  topicTypeSupport(new DDS::TopicBuiltinTopicDataTypeSupportImpl());
604 
605  if (DDS::RETCODE_OK !=
606  topicTypeSupport->register_type(bitParticipant_.in(),
609  ACE_TEXT("(%P|%t) ERROR: Failed to register the TopicBuiltinTopicDataTypeSupport.")));
610  return 1;
611  }
612 
616  topic_qos,
617  DDS::TopicListener::_nil(),
619 
620  if (CORBA::is_nil(bitTopicTopic_.in())) {
622  ACE_TEXT("(%P|%t) ERROR: ")
623  ACE_TEXT("Nil %C Topic from ")
624  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
626  1);
627  }
628 
629  // Subscription topic
630  DDS::SubscriptionBuiltinTopicDataTypeSupport_var
631  subscriptionTypeSupport(new DDS::SubscriptionBuiltinTopicDataTypeSupportImpl());
632 
633  if (DDS::RETCODE_OK !=
634  subscriptionTypeSupport->register_type(bitParticipant_.in(),
637  ACE_TEXT("(%P|%t) ERROR: Failed to register the SubscriptionBuiltinTopicDataTypeSupport.")));
638  return 1;
639  }
640 
644  topic_qos,
645  DDS::TopicListener::_nil(),
647 
650  ACE_TEXT("(%P|%t) ERROR: ")
651  ACE_TEXT("Nil %C Topic from ")
652  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
654  1);
655  }
656 
657  // Publication topic
658  DDS::PublicationBuiltinTopicDataTypeSupport_var
659  publicationTypeSupport(new DDS::PublicationBuiltinTopicDataTypeSupportImpl());
660 
661  if (DDS::RETCODE_OK !=
662  publicationTypeSupport->register_type(bitParticipant_.in(),
665  ACE_TEXT("(%P|%t) ERROR: Failed to register the PublicationBuiltinTopicDataTypeSupport.")));
666  return 1;
667  }
668 
672  topic_qos,
673  DDS::TopicListener::_nil(),
675 
678  ACE_TEXT("(%P|%t) ERROR: ")
679  ACE_TEXT("Nil %C Topic from ")
680  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
682  1);
683  }
684 
685  } catch (const CORBA::Exception& ex) {
687  "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_topics:");
688  return 1;
689  }
690 
691  return 0;
692 
693 #else
694 
695  return 1;
696 #endif // !defined (DDS_HAS_MINIMUM_BIT)
697 }
698 
699 #if defined (DDS_HAS_MINIMUM_BIT)
700 int DCPS_IR_Domain::init_built_in_topics_datawriters(bool /* federated */)
701 {
702  return 1;
703 }
704 #else
706 {
707 
708  try {
709  DDS::DataWriter_var datawriter;
710 
711  DDS::DataWriterQos participantWriterQos;
712  bitPublisher_->get_default_datawriter_qos(participantWriterQos);
713  participantWriterQos.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
714 
715  if (federated) {
716  participantWriterQos.liveliness.lease_duration.nanosec = 0;
717  participantWriterQos.liveliness.lease_duration.sec
718  = TheServiceParticipant->federation_liveliness();
719  }
720 
721  // Participant DataWriter
722  datawriter =
723  bitPublisher_->create_datawriter(bitParticipantTopic_.in(),
724  participantWriterQos,
725  DDS::DataWriterListener::_nil(),
727 
729  DDS::ParticipantBuiltinTopicDataDataWriter::_narrow(datawriter.in());
730 
733  ACE_TEXT("(%P|%t) ERROR: ")
734  ACE_TEXT("Nil DomainParticipant DataWriter from ")
735  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
736  1);
737  }
738 
739  DDS::DataWriterQos dw_qos;
740  bitPublisher_->get_default_datawriter_qos(dw_qos);
742 
743  // Topic DataWriter
744  datawriter =
745  bitPublisher_->create_datawriter(bitTopicTopic_.in(),
746  dw_qos,
747  DDS::DataWriterListener::_nil(),
749 
751  DDS::TopicBuiltinTopicDataDataWriter::_narrow(datawriter.in());
752 
755  ACE_TEXT("(%P|%t) ERROR: ")
756  ACE_TEXT("Nil Topic DataWriter from ")
757  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
758  1);
759  }
760 
761  // Subscription DataWriter
762  datawriter =
763  bitPublisher_->create_datawriter(bitSubscriptionTopic_.in(),
764  dw_qos,
765  DDS::DataWriterListener::_nil(),
767 
769  DDS::SubscriptionBuiltinTopicDataDataWriter::_narrow(
770  datawriter.in());
771 
774  ACE_TEXT("(%P|%t) ERROR: ")
775  ACE_TEXT("Nil Subscription DataWriter from ")
776  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
777  1);
778  }
779 
780  // Publication DataWriter
781  datawriter =
782  bitPublisher_->create_datawriter(bitPublicationTopic_.in(),
783  dw_qos,
784  DDS::DataWriterListener::_nil(),
786 
788  DDS::PublicationBuiltinTopicDataDataWriter::_narrow(datawriter.in());
789 
792  ACE_TEXT("(%P|%t) ERROR: ")
793  ACE_TEXT("Nil Publication DataWriter from ")
794  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
795  1);
796  }
797 
798  } catch (const CORBA::Exception& ex) {
800  "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_datawriters:");
801  return 1;
802  }
803  return 0;
804 }
805 #endif // defined (DDS_HAS_MINIMUM_BIT)
806 
808 {
809 #if !defined (DDS_HAS_MINIMUM_BIT)
810 
811  try {
812  std::string config_name =
814  + std::string("InfoRepoBITTransportConfig");
817 
818  // Create the Publisher
819  bitPublisher_ =
820  bitParticipant_->create_publisher(PUBLISHER_QOS_DEFAULT,
821  DDS::PublisherListener::_nil(),
823 
824  if (CORBA::is_nil(bitPublisher_.in())) {
826  ACE_TEXT("(%P|%t) ERROR: ")
827  ACE_TEXT("Nil Publisher from ")
828  ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
829  1);
830  }
831 
832  // If persistence is active, do not have remote readers autodispose data
833  if (persistent) {
834  DDS::DataWriterQos qos;
835  bitPublisher_->get_default_datawriter_qos(qos);
837  bitPublisher_->set_default_datawriter_qos(qos);
838  }
839 
840  // Attach the Publisher with the TransportImpl.
842  bitPublisher_.in());
843 
844  } catch (const CORBA::Exception& ex) {
846  "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_transport:");
847  return 1;
848  }
849 
850  return 0;
851 #else
852  ACE_UNUSED_ARG (persistent);
853  return 1;
854 #endif // !defined (DDS_HAS_MINIMUM_BIT)
855 }
856 
858 {
859 #ifndef DDS_HAS_MINIMUM_BIT
860  if (useBIT_ && bitParticipant_) {
861  useBIT_ = false;
863 
864  // clean up the Built-in Topic objects
865  const DDS::ReturnCode_t entities_error = bitParticipant_->delete_contained_entities();
866  if (entities_error) {
867  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DCPS_IR_Domain::cleanup_built_in_topics: "
868  "failed to delete entities: %C\n",
869  retcode_to_string(entities_error)));
870  return 1;
871  }
872 
873  bitPublisher_ = 0;
879  bitTopicTopic_ = 0;
882 
883  const DDS::ReturnCode_t part_error =
884  bitParticipantFactory_->delete_participant(bitParticipant_);
885  if (part_error) {
886  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DCPS_IR_Domain::cleanup_built_in_topics: "
887  "failed to delete participant: %C\n",
888  retcode_to_string(part_error)));
889  return 1;
890  }
891  }
892 
893  return 0;
894 #else
895  return 1;
896 #endif
897 }
898 
900 {
901  using OpenDDS::DCPS::move;
902  DCPS_IR_Topic_Description* discard = 0;
903  DCPS_IR_Topic_Description* desc_ptr = desc.get();
904 
905  switch (this->find_topic_description(
906  desc->get_name(),
907  desc->get_dataTypeName(),
908  discard)) {
909  case -1:
910  this->topicDescriptions_[desc_ptr->get_name()] = move(desc);
911 
914  ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_topic_description: ")
915  ACE_TEXT("added Topic Description 0x%x in domain %d.\n"),
916  desc_ptr,
917  id_));
918  }
919 
920  return 0;
921 
922  case 0:
924  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_description: ")
925  ACE_TEXT("attempt to add existing Topic Description 0x%x to domain %d.\n"),
926  desc_ptr,
927  id_));
928  return 1;
929 
930  case 1:
932  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_description: ")
933  ACE_TEXT("attempt to add incompatible Topic Description 0x%x to domain %d.\n"),
934  desc_ptr,
935  id_));
936  return 2;
937 
938  default:
940  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic_description: ")
941  ACE_TEXT("unknown error adding Topic Description 0x%x to domain %d.\n"),
942  desc_ptr,
943  id_));
944  return 2;
945  }
946 }
947 
949 {
950  DCPS_IR_Topic_Description_Set::iterator where = topicDescriptions_.find(desc->get_name());
951 
952  if (where != this->topicDescriptions_.end()) {
953  this->topicDescriptions_.erase(where);
954  return 0;
955 
956  } else {
958  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::remove_topic_description: ")
959  ACE_TEXT("unable to remove Topic Description 0x%x from domain %d.\n"),
960  desc,
961  id_));
962  return -1;
963  }
964 }
965 
967 {
968  deadParticipants_.insert(participant);
969 }
970 
972 {
973  if (0 < deadParticipants_.size()) {
975  DCPS_IR_Participant_Set::iterator iter = deadParticipants_.begin();
976 
977  // repeat end() due to the value possibly changing from additional dead
978  // participants during notifications
979  while (iter != deadParticipants_.end()) {
980  dead = *iter;
981  ++iter;
982 
983  if (part_of_cleanup) {
984  // If part of cleanup, then this is expected, especially if this is
985  // part of a test that failed.
987  "(%P|%t) DCPS_IR_Domain::remove_dead_participants: "
988  "Removing dead participant 0x%x id %C\n",
989  dead.in(),
990  LogGuid(dead->get_id()).c_str()));
991  } else {
993  "(%P|%t) WARNING: DCPS_IR_Domain::remove_dead_participants: "
994  "Removing dead participant 0x%x id %C\n",
995  dead.in(),
996  LogGuid(dead->get_id()).c_str()));
997  }
998 
999  deadParticipants_.erase(dead);
1000  dead->set_alive(false);
1001  remove_participant(dead->get_id(), true);
1002  }
1003  }
1004 }
1005 
1007 {
1008  return id_;
1009 }
1010 
1013 {
1014  return this->participantIdGenerator_.next();
1015 }
1016 
1017 void
1019 {
1020  this->participantIdGenerator_.last(key);
1021 }
1022 
1024 {
1025 #if !defined (DDS_HAS_MINIMUM_BIT)
1026 
1027  if (useBIT_ && !participant->isBitPublisher()) {
1028  try {
1029  const DDS::DomainParticipantQos* participantQos = participant->get_qos();
1030 
1032  data.key = guid_to_bit_key(participant->get_id());
1033  data.user_data = participantQos->user_data;
1034 
1035  DDS::InstanceHandle_t handle = bitParticipantDataWriter_->register_instance(data);
1036 
1037  participant->set_handle(handle);
1038 
1041  "(%P|%t) DCPS_IR_Domain::publish_participant_bit: %C, handle %d.\n",
1043  }
1044 
1045  bitParticipantDataWriter_->write(data, handle);
1046 
1047  } catch (const CORBA::Exception& ex) {
1049  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_participant_bit:");
1050  }
1051  }
1052 
1053 #else
1054  ACE_UNUSED_ARG(participant);
1055 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1056 }
1057 
1059 {
1060 #if !defined (DDS_HAS_MINIMUM_BIT)
1061 
1062  if (useBIT_) {
1064  topic->get_topic_description();
1065  const char* name = desc->get_name();
1066  const char* type = desc->get_dataTypeName();
1067 
1068  if (!OpenDDS::DCPS::topicIsBIT(name, type)) {
1069  try {
1070  const DDS::TopicQos* topicQos = topic->get_topic_qos();
1071 
1073  data.key = guid_to_bit_key(topic->get_id());
1074  data.name = name;
1075  data.type_name = type;
1076  data.durability = topicQos->durability;
1077  data.durability_service = topicQos->durability_service;
1078  data.deadline = topicQos->deadline;
1079  data.latency_budget = topicQos->latency_budget;
1080  data.liveliness = topicQos->liveliness;
1081  data.reliability = topicQos->reliability;
1082  data.transport_priority = topicQos->transport_priority;
1083  data.lifespan = topicQos->lifespan;
1084  data.destination_order = topicQos->destination_order;
1085  data.history = topicQos->history;
1086  data.resource_limits = topicQos->resource_limits;
1087  data.ownership = topicQos->ownership;
1088  data.topic_data = topicQos->topic_data;
1089 
1090  DDS::InstanceHandle_t handle =
1091  bitTopicDataWriter_->register_instance(data);
1092 
1093  topic->set_handle(handle);
1094 
1097  "(%P|%t) DCPS_IR_Domain::publish_topic_bit: %C, handle %d.\n",
1099  }
1100 
1101  bitTopicDataWriter_->write(data, handle);
1102 
1103  } catch (const CORBA::Exception& ex) {
1105  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_topic_bit:");
1106  }
1107 
1108  } else {
1109  topic->set_bit_status(1);
1110  }
1111  }
1112 
1113 #else
1114  ACE_UNUSED_ARG(topic);
1115 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1116 }
1117 
1119 {
1120 
1121 #if !defined (DDS_HAS_MINIMUM_BIT)
1122 
1123  if (useBIT_) {
1125  subscription->get_topic_description();
1126  const char* name = desc->get_name();
1127  const char* type = desc->get_dataTypeName();
1128 
1129  if (!OpenDDS::DCPS::topicIsBIT(name, type)) {
1130  try {
1131  const DDS::DataReaderQos* readerQos = subscription->get_datareader_qos();
1132  const DDS::SubscriberQos* publisherQos = subscription->get_subscriber_qos();
1133 
1134  DCPS_IR_Topic* topic = subscription->get_topic();
1135  const DDS::TopicQos* topicQos = topic->get_topic_qos();
1136 
1138  data.key = guid_to_bit_key(subscription->get_id());
1139  data.participant_key = guid_to_bit_key(subscription->get_participant_id());
1140  data.topic_name = name;
1141  data.type_name = type;
1142  data.durability = readerQos->durability;
1143  data.deadline = readerQos->deadline;
1144  data.latency_budget = readerQos->latency_budget;
1145  data.liveliness = readerQos->liveliness;
1146  data.reliability = readerQos->reliability;
1147  data.ownership = readerQos->ownership;
1148  data.destination_order = readerQos->destination_order;
1149  data.user_data = readerQos->user_data;
1150  data.time_based_filter = readerQos->time_based_filter;
1151  data.presentation = publisherQos->presentation;
1152  data.partition = publisherQos->partition;
1153  data.topic_data = topicQos->topic_data;
1154  data.group_data = publisherQos->group_data;
1155 
1156  DDS::InstanceHandle_t handle
1157  = bitSubscriptionDataWriter_->register_instance(data);
1158 
1159  subscription->set_handle(handle);
1160 
1163  "(%P|%t) DCPS_IR_Domain::publish_subscription_bit: %C, handle %d.\n",
1165  }
1166 
1167  bitSubscriptionDataWriter_->write(data,
1168  handle);
1169 
1170  } catch (const CORBA::Exception& ex) {
1172  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_subscription_bit:");
1173  }
1174 
1175  } else {
1176  subscription->set_bit_status(1);
1177  }
1178  }
1179 
1180 #else
1181  ACE_UNUSED_ARG(subscription);
1182 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1183 
1184 }
1185 
1187 {
1188 #if !defined (DDS_HAS_MINIMUM_BIT)
1189 
1190  if (useBIT_) {
1191 
1193  publication->get_topic_description();
1194 
1195  const char* dataTypeName = desc->get_dataTypeName();
1196 
1197  bool isNotBIT =
1202 
1203  if (isNotBIT) {
1204  try {
1205  const DDS::DataWriterQos* writerQos = publication->get_datawriter_qos();
1206  const DDS::PublisherQos* publisherQos = publication->get_publisher_qos();
1207 
1208  DCPS_IR_Topic* topic = publication->get_topic();
1209  const DDS::TopicQos* topicQos = topic->get_topic_qos();
1210 
1212  data.key = guid_to_bit_key(publication->get_id());
1213  data.participant_key = guid_to_bit_key(publication->get_participant_id());
1214  data.topic_name = desc->get_name();
1215  data.type_name = desc->get_dataTypeName();
1216  data.durability = writerQos->durability;
1217  data.durability_service = writerQos->durability_service;
1218  data.deadline = writerQos->deadline;
1219  data.latency_budget = writerQos->latency_budget;
1220  data.liveliness = writerQos->liveliness;
1221  data.reliability = writerQos->reliability;
1222  data.lifespan = writerQos->lifespan;
1223  data.user_data = writerQos->user_data;
1224  data.ownership = writerQos->ownership;
1225  data.ownership_strength = writerQos->ownership_strength;
1226  data.destination_order = writerQos->destination_order;
1227  data.presentation = publisherQos->presentation;
1228  data.partition = publisherQos->partition;
1229  data.topic_data = topicQos->topic_data;
1230  data.group_data = publisherQos->group_data;
1231 
1232  DDS::InstanceHandle_t handle
1233  = bitPublicationDataWriter_->register_instance(data);
1234 
1235  publication->set_handle(handle);
1236 
1239  "(%P|%t) DCPS_IR_Domain::publish_publication_bit: %C, handle %d.\n",
1241  }
1242 
1243  DDS::ReturnCode_t status = bitPublicationDataWriter_->write(data, handle);
1244  if (status != DDS::RETCODE_OK) {
1246  "(%P|%t) DCPS_IR_Domain::publish_publication_bit: write() status of %d\n",
1247  status));
1248  }
1249 
1250  } catch (const CORBA::Exception& ex) {
1252  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_publication_bit:");
1253  }
1254 
1255  } else {
1256  publication->set_bit_status(1);
1257  }
1258  }
1259 
1260 #else
1261  ACE_UNUSED_ARG(publication);
1262 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1263 
1264 }
1265 
1267 {
1268 #if !defined (DDS_HAS_MINIMUM_BIT)
1269 
1270  if (useBIT_) {
1271  if (!participant->isBitPublisher()) {
1272  try {
1274  DDS::InstanceHandle_t handle = participant->get_handle();
1275 
1276  DDS::ReturnCode_t retGetKey
1277  = bitParticipantDataWriter_->get_key_value(key_data,
1278  handle);
1279 
1280  if (DDS::RETCODE_OK != retGetKey) {
1281  OpenDDS::DCPS::RepoIdConverter converter(participant->get_id());
1283  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_participant_bit ")
1284  ACE_TEXT("Unable to get_key_value for participant %C handle %d.\n"),
1285  std::string(converter).c_str(),
1286  handle));
1287  }
1288 
1289  DDS::ReturnCode_t retDispose =
1290  bitParticipantDataWriter_->dispose(key_data,
1291  handle);
1292 
1293  if (DDS::RETCODE_OK != retDispose) {
1294  OpenDDS::DCPS::RepoIdConverter converter(participant->get_id());
1296  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_participant_bit ")
1297  ACE_TEXT("Unable to dispose for participant %C handle %d.\n"),
1298  std::string(converter).c_str(),
1299  handle));
1300  }
1301 
1302  } catch (const CORBA::Exception& ex) {
1304  "ERROR: Exception caught in DCPS_IR_Domain::dispose_participant_bit:");
1305  }
1306  }
1307  }
1308 
1309 #else
1310  ACE_UNUSED_ARG(participant);
1311 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1312 }
1313 
1315 {
1316 #if !defined (DDS_HAS_MINIMUM_BIT)
1317 
1318  if (useBIT_) {
1319  if (!topic->is_bit()) {
1320  try {
1321  DDS::TopicBuiltinTopicData key_data;
1322  DDS::InstanceHandle_t handle = topic->get_handle();
1323 
1324  DDS::ReturnCode_t retGetKey
1325  = bitTopicDataWriter_->get_key_value(key_data,
1326  handle);
1327 
1328  if (DDS::RETCODE_OK != retGetKey) {
1330  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_topic_bit ")
1331  ACE_TEXT("Unable to get_key_value for topic ptr 0x%x handle %d. ")
1332  ACE_TEXT("Call returned %d.\n"),
1333  topic,
1334  handle,
1335  retGetKey));
1336  }
1337 
1338  DDS::ReturnCode_t retDispose =
1339  bitTopicDataWriter_->dispose(key_data,
1340  handle);
1341 
1342  if (DDS::RETCODE_OK != retDispose) {
1344  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_topic_bit ")
1345  ACE_TEXT("Unable to dispose for topic ptr 0x%x handle %d. ")
1346  ACE_TEXT("Call returned %d.\n"),
1347  topic,
1348  handle,
1349  retDispose));
1350  }
1351 
1352  } catch (const CORBA::Exception& ex) {
1354  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_topic_bit:");
1355  }
1356  }
1357  }
1358 
1359 #else
1360  ACE_UNUSED_ARG(topic);
1361 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1362 }
1363 
1365 {
1366 #if !defined (DDS_HAS_MINIMUM_BIT)
1367 
1368  if (useBIT_) {
1369  if (!subscription->is_bit()) {
1370  try {
1372  DDS::InstanceHandle_t handle = subscription->get_handle();
1373 
1374  DDS::ReturnCode_t retGetKey
1375  = bitSubscriptionDataWriter_->get_key_value(key_data,
1376  handle);
1377 
1378  if (DDS::RETCODE_OK != retGetKey) {
1380  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_subscription_bit ")
1381  ACE_TEXT("Unable to get_key_value for subscription ptr 0x%x handle %d. ")
1382  ACE_TEXT("Call returned %d.\n"),
1383  subscription,
1384  handle,
1385  retGetKey));
1386  }
1387 
1388  DDS::ReturnCode_t retDispose =
1389  bitSubscriptionDataWriter_->dispose(key_data,
1390  handle);
1391 
1392  if (DDS::RETCODE_OK != retDispose) {
1394  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_subscription_bit ")
1395  ACE_TEXT("Unable to dispose for subscription ptr 0x%x handle %d. ")
1396  ACE_TEXT("Call returned %d.\n"),
1397  subscription,
1398  handle,
1399  retDispose));
1400  }
1401 
1402  } catch (const CORBA::Exception& ex) {
1404  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_subscription_bit:");
1405  }
1406  }
1407  }
1408 
1409 #else
1410  ACE_UNUSED_ARG(subscription);
1411 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1412 }
1413 
1415 {
1416 #if !defined (DDS_HAS_MINIMUM_BIT)
1417 
1418  if (useBIT_) {
1419  if (!publication->is_bit()) {
1420  try {
1422  DDS::InstanceHandle_t handle = publication->get_handle();
1423 
1424  DDS::ReturnCode_t retGetKey
1425  = bitPublicationDataWriter_->get_key_value(key_data, handle);
1426 
1427  if (DDS::RETCODE_OK != retGetKey) {
1429  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_publication_bit ")
1430  ACE_TEXT("Unable to get_key_value for publication ptr 0x%x handle %d. ")
1431  ACE_TEXT("Call returned %d.\n"),
1432  publication,
1433  handle,
1434  retGetKey));
1435  }
1436 
1437  DDS::ReturnCode_t retDispose =
1438  bitPublicationDataWriter_->dispose(key_data,
1439  handle);
1440 
1441  if (DDS::RETCODE_OK != retDispose) {
1443  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_publication_bit ")
1444  ACE_TEXT("Unable to dispose for publication ptr 0x%x handle %d. ")
1445  ACE_TEXT("Call returned %d.\n"),
1446  publication,
1447  handle,
1448  retDispose));
1449  }
1450 
1451  } catch (const CORBA::Exception& ex) {
1453  "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_publication_bit:");
1454  }
1455  }
1456  }
1457 
1458 #else
1459  ACE_UNUSED_ARG(publication);
1460 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1461 }
1462 
1464 {
1465  IdToTopicMap::iterator map_entry = this->idToTopicMap_.find(topicId);
1466  if (map_entry != this->idToTopicMap_.end())
1467  idToTopicMap_.erase(map_entry);
1468 }
1469 
1470 std::string DCPS_IR_Domain::dump_to_string(const std::string& prefix, int depth) const
1471 {
1472  std::string str;
1473 #if !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
1474  for (int i=0; i < depth; i++)
1475  str += prefix;
1476  std::string indent = str + prefix;
1477  std::ostringstream os;
1478  os << "DCPS_IR_Domain[" << id_ << "]";
1479  str += os.str();
1480  if (useBIT_)
1481  str += " BITS";
1482  str += "\n";
1483 
1484  str += indent + "Participants:\n";
1485  for (DCPS_IR_Participant_Map::const_iterator pm = participants_.begin();
1486  pm != participants_.end();
1487  pm++)
1488  {
1489  str += pm->second->dump_to_string(prefix, depth+1);
1490  }
1491 
1492  str += indent + "Dead Participants:\n";
1493  for (DCPS_IR_Participant_Set::const_iterator dp = deadParticipants_.begin();
1494  dp != deadParticipants_.end();
1495  dp++)
1496  {
1497  OpenDDS::DCPS::RepoIdConverter sub_converter((*dp)->get_id());
1498  str += indent + std::string(sub_converter);
1499  str += "\n";
1500  }
1501 
1502  str += indent + "Topic Descriptions:\n";
1503  for (DCPS_IR_Topic_Description_Set::const_iterator tdi = topicDescriptions_.begin();
1504  tdi != topicDescriptions_.end();
1505  tdi++)
1506  {
1507  str += tdi->second->dump_to_string(prefix, depth+1);
1508  }
1509 #endif // !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
1510  return str;
1511 }
1512 
const char *const BUILT_IN_SUBSCRIPTION_TOPIC_TYPE
UserDataQosPolicy user_data
PartitionQosPolicy partition
#define PARTICIPANT_QOS_DEFAULT
#define ACE_DEBUG(X)
DDS::DomainParticipant_var bitParticipant_
#define ACE_ERROR(X)
OpenDDS::DCPS::GUID_t get_participant_id()
int find_topic_description(const char *name, const char *dataTypeName, DCPS_IR_Topic_Description *&desc)
void set_bit_status(CORBA::Boolean isBIT)
DDS::InstanceHandle_t get_handle()
int remove_topic_description(DCPS_IR_Topic_Description *desc)
Returns 0 if successful.
OpenDDS::DCPS::GUID_t get_next_participant_id()
Next Entity Id value in sequence.
LatencyBudgetQosPolicy latency_budget
ReliabilityQosPolicy reliability
GroupDataQosPolicy group_data
LifespanQosPolicy lifespan
DDS::Publisher_var bitPublisher_
OwnershipQosPolicy ownership
OpenDDS::DCPS::GUID_t get_id()
DurabilityQosPolicy durability
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
void remove_dead_participants(bool part_of_cleanup=false)
Remove any participants currently marked as dead.
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
OpenDDS::DCPS::GUID_t get_id() const
TimeBasedFilterQosPolicy time_based_filter
TransportPriorityQosPolicy transport_priority
sequence< octet > key
const DDS::DomainParticipantQos * get_qos()
CORBA::ULong get_number_topics() const
Returns the number of topics.
DDS::Topic_var bitSubscriptionTopic_
void last_participant_key(long key)
Ensure no conflicts with sequence values from persistent storage.
int add_topic(DCPS_IR_Topic *topic)
OwnershipQosPolicy ownership
const char * c_str() const
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
void set_bit_status(CORBA::Boolean isBIT)
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
LivelinessQosPolicy liveliness
DCPS_IR_Topic_Description * get_topic_description()
DeadlineQosPolicy deadline
DestinationOrderQosPolicy destination_order
DDS::Topic_var bitParticipantTopic_
OpenDDS::DCPS::GUID_t get_next_topic_id(bool builtin)
int remove_participant(const OpenDDS::DCPS::GUID_t &particpantId, CORBA::Boolean notify_lost)
DCPS_IR_Participant_Set deadParticipants_
bool topicIsBIT(const char *name, const char *type)
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
int init_built_in_topics(bool federated, bool persistent)
ResourceLimitsQosPolicy resource_limits
CORBA::Boolean is_bit()
void publish_subscription_bit(DCPS_IR_Subscription *subscription)
Publish Subscription in the Subscription Built-In Topic.
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
DCPS_IR_Domain(DDS::DomainId_t id, OpenDDS::DCPS::RepoIdGenerator &generator)
void bind_config(const OPENDDS_STRING &name, DDS::Entity_ptr entity)
const DDS::StatusMask DEFAULT_STATUS_MASK
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
DCPS_IR_Participant * participant(const OpenDDS::DCPS::GUID_t &id) const
Find the participant with the id.
DDS::InstanceHandle_t get_handle()
dead
DDS::TopicQos * get_topic_qos()
LatencyBudgetQosPolicy latency_budget
DestinationOrderQosPolicy destination_order
const char *const BUILT_IN_PUBLICATION_TOPIC
OpenDDS::DCPS::TopicStatus remove_topic(DCPS_IR_Participant *part, DCPS_IR_Topic *&topic)
OpenDDS::DCPS::TransportConfig_rch transportConfig_
DurabilityServiceQosPolicy durability_service
DCPS_IR_Participant_Map participants_
all the participants
DOMAINID_TYPE_NATIVE DomainId_t
DDS::InstanceHandle_t get_handle()
int init_built_in_topics_datawriters(bool federated)
PresentationQosPolicy presentation
LM_DEBUG
DDS::Topic_var bitTopicTopic_
void set_handle(DDS::InstanceHandle_t handle)
DurabilityQosPolicyKind kind
int reassociate_built_in_topic_pubs()
DurabilityQosPolicy durability
unsigned long nanosec
Definition: DdsDcpsCore.idl:69
DDS::DomainId_t get_id()
OwnershipStrengthQosPolicy ownership_strength
DCPS_IR_Topic_Description * get_topic_description()
DDS::DomainParticipantFactory_var bitParticipantFactory_
ACE_CDR::Boolean Boolean
DestinationOrderQosPolicy destination_order
TransportConfig_rch get_config(const OPENDDS_STRING &name) const
#define TheTransientKludge
void publish_topic_bit(DCPS_IR_Topic *topic)
Publish Topic in the Topic Built-In Topic.
int remove_topic(DCPS_IR_Topic *topic)
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
DurabilityQosPolicy durability
int init_built_in_topics_transport(bool persistent)
LM_NOTICE
OpenDDS::DCPS::TopicStatus force_add_topic(const OpenDDS::DCPS::GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr)
Representative of the Domain Participant.
Create RepoId values for use within DDS.
int add_participant(DCPS_IR_Participant_rch participant)
DDS::InstanceHandle_t get_handle()
int add_topic_description(OpenDDS::DCPS::unique_ptr< DCPS_IR_Topic_Description > desc)
void set_handle(DDS::InstanceHandle_t handle)
#define PUBLISHER_QOS_DEFAULT
int cleanup_built_in_topics()
Cleans up the Built-In Topic structures.
TopicDataQosPolicy topic_data
const char *const BUILT_IN_PARTICIPANT_TOPIC
LM_WARNING
DeadlineQosPolicy deadline
void set_handle(DDS::InstanceHandle_t handle)
ReliabilityQosPolicy reliability
int init_built_in_topics_topics()
DDS::PublisherQos * get_publisher_qos()
int remove_topic_reference(OpenDDS::DCPS::GUID_t topicId, DCPS_IR_Topic *&topic)
OpenDDS::DCPS::GUID_t get_id()
int strcmp(const char *s, const char *t)
const char *const name
Definition: debug.cpp:60
void set_handle(DDS::InstanceHandle_t handle)
GUID_t next(bool builtin=false)
Obtain the next GUID_t value.
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
ACE_TEXT("TCP_Factory")
const char *const BUILT_IN_PARTICIPANT_TOPIC_TYPE
OpenDDS::DCPS::RepoIdGenerator & participantIdGenerator_
void add_dead_participant(DCPS_IR_Participant_rch participant)
void remove_topic_id_mapping(const OpenDDS::DCPS::GUID_t &topicId)
OwnershipQosPolicy ownership
const char *const BUILT_IN_SUBSCRIPTION_TOPIC
void dispose_participant_bit(DCPS_IR_Participant *participant)
Dispose Participant in the Participant Built-In Topic.
void publish_participant_bit(DCPS_IR_Participant *participant)
Publish Participant in the Participant Built-In Topic.
void publish_publication_bit(DCPS_IR_Publication *publication)
Publish Publication in the Publication Built-In Topic.
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const DCPS_IR_Participant_Map & participants() const
Expose a readable reference to the participant map.
ReliabilityQosPolicy reliability
OpenDDS::DCPS::GUID_t get_id()
OpenDDS::DCPS::GUID_t get_participant_id()
void set_bit_status(CORBA::Boolean isBIT)
const char *const BUILT_IN_TOPIC_TOPIC
const DDS::SubscriberQos * get_subscriber_qos()
DDS::Topic_var bitPublicationTopic_
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
DCPS_IR_Participant_rch participant_rch(const OpenDDS::DCPS::GUID_t &id) const
OpenDDS::DCPS::TopicStatus find_topic(const char *topicName, DCPS_IR_Topic *&topic)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
HistoryQosPolicy history
LifespanQosPolicy lifespan
std::string dump_to_string(const std::string &prefix, int depth) const
static const char DEFAULT_INST_PREFIX[]
static TransportRegistry * instance()
Return a singleton instance of this class.
WriterDataLifecycleQosPolicy writer_data_lifecycle
DCPS_IR_Topic_Description * get_topic_description()
Representative of a Subscription.
void dispose_subscription_bit(DCPS_IR_Subscription *subscription)
Dispose Subscription in the Subscription Built-In Topic.
const ReturnCode_t RETCODE_OK
int add_topic_reference(DCPS_IR_Topic *topic)
DCPS_IR_Topic * get_topic()
#define ACE_ERROR_RETURN(X, Y)
LivelinessQosPolicy liveliness
#define TheParticipantFactory
UserDataQosPolicy user_data
UserDataQosPolicy user_data
void dispose_topic_bit(DCPS_IR_Topic *topic)
Dispose Topic in the Topic Built-In Topic.
DeadlineQosPolicy deadline
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
GroupDataQosPolicy group_data
#define TheServiceParticipant
void dispose_publication_bit(DCPS_IR_Publication *publication)
Dispose Publication in the Publication Built-In Topic.
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
LM_ERROR
PartitionQosPolicy partition
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
PresentationQosPolicy presentation
Representative of a Topic Description.
DDS::DomainId_t id_
IdToTopicMap idToTopicMap_
Actual mapping of Id values to Topic object references.
Boolean is_nil(T x)
std::map< OpenDDS::DCPS::GUID_t, DCPS_IR_Participant_rch, OpenDDS::DCPS::GUID_tKeyLessThan > DCPS_IR_Participant_Map
Representative of a Publication.
OpenDDS::DCPS::TopicStatus add_topic_i(OpenDDS::DCPS::GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr, bool isBIT)
LivelinessQosPolicy liveliness
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
DDS::DataWriterQos * get_datawriter_qos()
const char *const BUILT_IN_TOPIC_TOPIC_TYPE
const char *const BUILT_IN_PUBLICATION_TOPIC_TYPE
OpenDDS::DCPS::RcHandle< DCPS_IR_Participant > DCPS_IR_Participant_rch
void release(bool removing)
DurabilityServiceQosPolicy durability_service
LatencyBudgetQosPolicy latency_budget
OpenDDS::DCPS::TopicStatus add_topic(OpenDDS::DCPS::GUID_t_out topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr)
DDS::DomainParticipantListener_var bitParticipantListener_
const DDS::DataReaderQos * get_datareader_qos()