OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DCPS_IR_Domain Class Reference

Representation of a Domain in the system. More...

#include <DCPS_IR_Domain.h>

Inheritance diagram for DCPS_IR_Domain:
Inheritance graph
[legend]
Collaboration diagram for DCPS_IR_Domain:
Collaboration graph
[legend]

Public Member Functions

 DCPS_IR_Domain (DDS::DomainId_t id, OpenDDS::DCPS::RepoIdGenerator &generator)
 
 ~DCPS_IR_Domain ()
 
int add_participant (DCPS_IR_Participant_rch participant)
 
int remove_participant (const OpenDDS::DCPS::GUID_t &particpantId, CORBA::Boolean notify_lost)
 
DCPS_IR_Participant_rch participant_rch (const OpenDDS::DCPS::GUID_t &id) const
 
DCPS_IR_Participantparticipant (const OpenDDS::DCPS::GUID_t &id) const
 Find the participant with the id. More...
 
OpenDDS::DCPS::TopicStatus find_topic (const char *topicName, DCPS_IR_Topic *&topic)
 
DCPS_IR_Topicfind_topic (const OpenDDS::DCPS::GUID_t &id)
 Find a topic object reference using the topic Id value. More...
 
OpenDDS::DCPS::TopicStatus remove_topic (DCPS_IR_Participant *part, DCPS_IR_Topic *&topic)
 
void remove_topic_id_mapping (const OpenDDS::DCPS::GUID_t &topicId)
 
void add_dead_participant (DCPS_IR_Participant_rch participant)
 
void remove_dead_participants (bool part_of_cleanup=false)
 Remove any participants currently marked as dead. More...
 
DDS::DomainId_t get_id ()
 
OpenDDS::DCPS::GUID_t get_next_participant_id ()
 Next Entity Id value in sequence. More...
 
void last_participant_key (long key)
 Ensure no conflicts with sequence values from persistent storage. More...
 
int init_built_in_topics (bool federated, bool persistent)
 
int cleanup_built_in_topics ()
 Cleans up the Built-In Topic structures. More...
 
int reassociate_built_in_topic_pubs ()
 
void publish_participant_bit (DCPS_IR_Participant *participant)
 Publish Participant in the Participant Built-In Topic. More...
 
void publish_topic_bit (DCPS_IR_Topic *topic)
 Publish Topic in the Topic Built-In Topic. More...
 
void publish_subscription_bit (DCPS_IR_Subscription *subscription)
 Publish Subscription in the Subscription Built-In Topic. More...
 
void publish_publication_bit (DCPS_IR_Publication *publication)
 Publish Publication in the Publication Built-In Topic. More...
 
void dispose_participant_bit (DCPS_IR_Participant *participant)
 Dispose Participant in the Participant Built-In Topic. More...
 
void dispose_topic_bit (DCPS_IR_Topic *topic)
 Dispose Topic in the Topic Built-In Topic. More...
 
void dispose_subscription_bit (DCPS_IR_Subscription *subscription)
 Dispose Subscription in the Subscription Built-In Topic. More...
 
void dispose_publication_bit (DCPS_IR_Publication *publication)
 Dispose Publication in the Publication Built-In Topic. More...
 
const DCPS_IR_Participant_Mapparticipants () const
 Expose a readable reference to the participant map. More...
 
std::string dump_to_string (const std::string &prefix, int depth) const
 
bool useBIT () const
 
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)
 
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)
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 

Private Types

typedef std::map< OpenDDS::DCPS::GUID_t, OpenDDS::DCPS::container_supported_unique_ptr< DCPS_IR_Topic >, OpenDDS::DCPS::GUID_tKeyLessThanIdToTopicMap
 Mapping from GUID_t values to Topic object references. More...
 

Private Member Functions

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)
 
int add_topic_description (OpenDDS::DCPS::unique_ptr< DCPS_IR_Topic_Description > desc)
 
int find_topic_description (const char *name, const char *dataTypeName, DCPS_IR_Topic_Description *&desc)
 
int remove_topic_description (DCPS_IR_Topic_Description *desc)
 Returns 0 if successful. More...
 
 DCPS_IR_Domain (const DCPS_IR_Domain &)
 
int init_built_in_topics_topics ()
 
int init_built_in_topics_datawriters (bool federated)
 
int init_built_in_topics_transport (bool persistent)
 

Private Attributes

DDS::DomainId_t id_
 
OpenDDS::DCPS::RepoIdGeneratorparticipantIdGenerator_
 
DCPS_IR_Participant_Map participants_
 all the participants More...
 
DCPS_IR_Participant_Set deadParticipants_
 
DCPS_IR_Topic_Description_Set topicDescriptions_
 all the topics More...
 
IdToTopicMap idToTopicMap_
 Actual mapping of Id values to Topic object references. More...
 
OpenDDS::DCPS::AtomicBool useBIT_
 indicates if the BuiltIn Topics are enabled More...
 
DDS::DomainParticipantFactory_var bitParticipantFactory_
 
DDS::DomainParticipant_var bitParticipant_
 
DDS::DomainParticipantListener_var bitParticipantListener_
 
DDS::Publisher_var bitPublisher_
 
OpenDDS::DCPS::TransportConfig_rch transportConfig_
 
DDS::Topic_var bitParticipantTopic_
 
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
 
DDS::Topic_var bitTopicTopic_
 
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
 
DDS::Topic_var bitSubscriptionTopic_
 
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
 
DDS::Topic_var bitPublicationTopic_
 
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Detailed Description

Representation of a Domain in the system.

This represents a Domain in the system. It contains the representatives of the entities that are in the corresponding system's domain.

Definition at line 64 of file DCPS_IR_Domain.h.

Member Typedef Documentation

◆ IdToTopicMap

Mapping from GUID_t values to Topic object references.

Definition at line 236 of file DCPS_IR_Domain.h.

Constructor & Destructor Documentation

◆ DCPS_IR_Domain() [1/2]

DCPS_IR_Domain::DCPS_IR_Domain ( DDS::DomainId_t  id,
OpenDDS::DCPS::RepoIdGenerator generator 
)

Definition at line 39 of file DCPS_IR_Domain.cpp.

40  : id_(id),
41  participantIdGenerator_(generator),
42  useBIT_(false)
43 {
44 }
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
OpenDDS::DCPS::RepoIdGenerator & participantIdGenerator_
DDS::DomainId_t id_

◆ ~DCPS_IR_Domain()

DCPS_IR_Domain::~DCPS_IR_Domain ( )

Definition at line 46 of file DCPS_IR_Domain.cpp.

47 {
48 }

◆ DCPS_IR_Domain() [2/2]

DCPS_IR_Domain::DCPS_IR_Domain ( const DCPS_IR_Domain )
private

Member Function Documentation

◆ add_dead_participant()

void DCPS_IR_Domain::add_dead_participant ( DCPS_IR_Participant_rch  participant)

Mark a participant as being unresponsive (dead) and schedule it to be removed next time remove_dead_participants is called.

Definition at line 966 of file DCPS_IR_Domain.cpp.

References deadParticipants_.

Referenced by DCPS_IR_Participant::mark_dead().

967 {
968  deadParticipants_.insert(participant);
969 }
DCPS_IR_Participant_Set deadParticipants_

◆ add_participant()

int DCPS_IR_Domain::add_participant ( DCPS_IR_Participant_rch  participant)

Add the participant Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 75 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, OpenDDS::DCPS::RcHandle< T >::in(), LM_DEBUG, LM_NOTICE, participants_, and publish_participant_bit().

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 
91  ACE_DEBUG((LM_DEBUG,
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 {
102  ACE_DEBUG((LM_NOTICE,
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 }
#define ACE_DEBUG(X)
DCPS_IR_Participant_Map participants_
all the participants
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
void publish_participant_bit(DCPS_IR_Participant *participant)
Publish Participant in the Participant Built-In Topic.
DDS::DomainId_t id_

◆ add_topic()

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic ( OpenDDS::DCPS::GUID_t_out  topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr 
)

Add a topic to the domain Returns OpenDDS::DCPS::CREATED if successful

Definition at line 156 of file DCPS_IR_Domain.cpp.

References add_topic_i(), OpenDDS::DCPS::CREATED, DCPS_IR_Participant::get_next_topic_id(), OpenDDS::DCPS::GUID_UNKNOWN, and OpenDDS::DCPS::topicIsBIT().

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 }
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)
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
OpenDDS::DCPS::GUID_t get_next_topic_id(bool builtin)
bool topicIsBIT(const char *name, const char *type)

◆ add_topic_description()

int DCPS_IR_Domain::add_topic_description ( OpenDDS::DCPS::unique_ptr< DCPS_IR_Topic_Description desc)
private

Takes ownership of the memory pointed to by desc if successful returns 0 if successful, 1 if description already exists -1 unknown error 2 if confliciting dataTypeName

Definition at line 899 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, find_topic_description(), OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Topic_Description::get_name(), id_, LM_DEBUG, LM_ERROR, LM_NOTICE, OpenDDS::DCPS::move(), and topicDescriptions_.

Referenced by add_topic_i().

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 
913  ACE_DEBUG((LM_DEBUG,
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:
923  ACE_DEBUG((LM_NOTICE,
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:
931  ACE_DEBUG((LM_NOTICE,
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:
939  ACE_ERROR((LM_ERROR,
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 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
int find_topic_description(const char *name, const char *dataTypeName, DCPS_IR_Topic_Description *&desc)
Representative of a Topic Description.
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DDS::DomainId_t id_

◆ add_topic_i()

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic_i ( OpenDDS::DCPS::GUID_t topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr,
bool  isBIT 
)
private

Definition at line 193 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), DCPS_IR_Topic_Description::add_topic(), add_topic_description(), DCPS_IR_Participant::add_topic_reference(), OpenDDS::DCPS::CONFLICTING_TYPENAME, OpenDDS::DCPS::CREATED, OpenDDS::DCPS::DCPS_debug_level, find_topic_description(), OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), OpenDDS::DCPS::GUID_UNKNOWN, id_, idToTopicMap_, LM_DEBUG, LM_ERROR, LM_NOTICE, OpenDDS::DCPS::move(), OpenDDS::DCPS::NOT_FOUND, publish_topic_bit(), and DCPS_IR_Topic_Description::remove_topic().

Referenced by add_topic(), and force_add_topic().

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);
246  ACE_DEBUG((LM_DEBUG,
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);
270  ACE_DEBUG((LM_NOTICE,
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);
285  ACE_ERROR((LM_ERROR,
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 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
int find_topic_description(const char *name, const char *dataTypeName, DCPS_IR_Topic_Description *&desc)
Representative of a Topic Description.
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
int add_topic_description(OpenDDS::DCPS::unique_ptr< DCPS_IR_Topic_Description > desc)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
void publish_topic_bit(DCPS_IR_Topic *topic)
Publish Topic in the Topic Built-In Topic.
int add_topic(DCPS_IR_Topic *topic)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
IdToTopicMap idToTopicMap_
Actual mapping of Id values to Topic object references.
ACE_TEXT("TCP_Factory")
int add_topic_reference(DCPS_IR_Topic *topic)
int remove_topic(DCPS_IR_Topic *topic)
DDS::DomainId_t id_

◆ cleanup_built_in_topics()

int DCPS_IR_Domain::cleanup_built_in_topics ( )

Cleans up the Built-In Topic structures.

Definition at line 857 of file DCPS_IR_Domain.cpp.

References ACE_ERROR, bitParticipant_, bitParticipantDataWriter_, bitParticipantFactory_, bitParticipantTopic_, bitPublicationDataWriter_, bitPublicationTopic_, bitPublisher_, bitSubscriptionDataWriter_, bitSubscriptionTopic_, bitTopicDataWriter_, bitTopicTopic_, LM_ERROR, OpenDDS::DCPS::retcode_to_string(), and useBIT_.

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 }
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
DDS::Topic_var bitTopicTopic_
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
DDS::DomainParticipant_var bitParticipant_
DDS::Topic_var bitPublicationTopic_
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
DDS::Topic_var bitParticipantTopic_
DDS::Publisher_var bitPublisher_
DDS::DomainParticipantFactory_var bitParticipantFactory_
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
DDS::Topic_var bitSubscriptionTopic_

◆ dispose_participant_bit()

void DCPS_IR_Domain::dispose_participant_bit ( DCPS_IR_Participant participant)

Dispose Participant in the Participant Built-In Topic.

Definition at line 1266 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR, ACE_TEXT(), bitParticipantDataWriter_, DCPS_IR_Participant::get_handle(), DCPS_IR_Participant::get_id(), DCPS_IR_Participant::isBitPublisher(), LM_ERROR, DDS::RETCODE_OK, and useBIT_.

Referenced by remove_participant().

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());
1282  ACE_ERROR((LM_ERROR,
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());
1295  ACE_ERROR((LM_ERROR,
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 }
DDS::InstanceHandle_t get_handle()
#define ACE_ERROR(X)
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
const ReturnCode_t RETCODE_OK
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
OpenDDS::DCPS::GUID_t get_id()
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82

◆ dispose_publication_bit()

void DCPS_IR_Domain::dispose_publication_bit ( DCPS_IR_Publication publication)

Dispose Publication in the Publication Built-In Topic.

Definition at line 1414 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR, ACE_TEXT(), bitPublicationDataWriter_, DCPS_IR_Publication::get_handle(), DCPS_IR_Publication::is_bit(), LM_ERROR, DDS::RETCODE_OK, and useBIT_.

Referenced by DCPS_IR_Participant::remove_publication().

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) {
1428  ACE_ERROR((LM_ERROR,
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) {
1442  ACE_ERROR((LM_ERROR,
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 }
#define ACE_ERROR(X)
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
const ReturnCode_t RETCODE_OK
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
ACE_TEXT("TCP_Factory")
DDS::InstanceHandle_t get_handle()
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82

◆ dispose_subscription_bit()

void DCPS_IR_Domain::dispose_subscription_bit ( DCPS_IR_Subscription subscription)

Dispose Subscription in the Subscription Built-In Topic.

Definition at line 1364 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR, ACE_TEXT(), bitSubscriptionDataWriter_, DCPS_IR_Subscription::get_handle(), DCPS_IR_Subscription::is_bit(), LM_ERROR, DDS::RETCODE_OK, and useBIT_.

Referenced by DCPS_IR_Participant::remove_subscription().

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) {
1379  ACE_ERROR((LM_ERROR,
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) {
1393  ACE_ERROR((LM_ERROR,
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 }
#define ACE_ERROR(X)
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
const ReturnCode_t RETCODE_OK
DDS::InstanceHandle_t get_handle()
ACE_TEXT("TCP_Factory")
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_

◆ dispose_topic_bit()

void DCPS_IR_Domain::dispose_topic_bit ( DCPS_IR_Topic topic)

Dispose Topic in the Topic Built-In Topic.

Definition at line 1314 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR, ACE_TEXT(), bitTopicDataWriter_, DCPS_IR_Topic::get_handle(), DCPS_IR_Topic::is_bit(), LM_ERROR, DDS::RETCODE_OK, and useBIT_.

Referenced by remove_topic().

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) {
1329  ACE_ERROR((LM_ERROR,
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) {
1343  ACE_ERROR((LM_ERROR,
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 }
#define ACE_ERROR(X)
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
const ReturnCode_t RETCODE_OK
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
ACE_TEXT("TCP_Factory")
DDS::InstanceHandle_t get_handle()
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
CORBA::Boolean is_bit()
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82

◆ dump_to_string()

std::string DCPS_IR_Domain::dump_to_string ( const std::string &  prefix,
int  depth 
) const

Definition at line 1470 of file DCPS_IR_Domain.cpp.

References deadParticipants_, id_, OPENDDS_END_VERSIONED_NAMESPACE_DECL, participants_, topicDescriptions_, and useBIT_.

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 }
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DCPS_IR_Participant_Map participants_
all the participants
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
DCPS_IR_Participant_Set deadParticipants_
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
DDS::DomainId_t id_

◆ find_topic() [1/2]

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::find_topic ( const char *  topicName,
DCPS_IR_Topic *&  topic 
)

Find the topic with the topic name Does NOT take ownership of any initial memory pointed to by topic Returns OpenDDS::DCPS::FOUND if exists and topic is changed, -1 otherwise

Definition at line 330 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::FOUND, DCPS_IR_Topic::get_id(), id_, LM_DEBUG, OpenDDS::DCPS::NOT_FOUND, and topicDescriptions_.

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);
342  ACE_DEBUG((LM_DEBUG,
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 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t get_id() const
DDS::DomainId_t id_

◆ find_topic() [2/2]

DCPS_IR_Topic * DCPS_IR_Domain::find_topic ( const OpenDDS::DCPS::GUID_t id)

Find a topic object reference using the topic Id value.

Definition at line 358 of file DCPS_IR_Domain.cpp.

References idToTopicMap_.

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 }
IdToTopicMap idToTopicMap_
Actual mapping of Id values to Topic object references.

◆ find_topic_description()

int DCPS_IR_Domain::find_topic_description ( const char *  name,
const char *  dataTypeName,
DCPS_IR_Topic_Description *&  desc 
)
private

Find the topic description with the name and data type name Does NOT take ownership of any initial memory pointed to by desc Returns 0 if found and desc is changed, -1 if not found and 1 if conflicting dataTypeName

Definition at line 418 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, init_built_in_topics(), LM_DEBUG, LM_NOTICE, ACE_OS::strcmp(), and topicDescriptions_.

Referenced by add_topic_description(), and add_topic_i().

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())) {
429  ACE_DEBUG((LM_DEBUG,
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 {
442  ACE_DEBUG((LM_NOTICE,
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 }
#define ACE_DEBUG(X)
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
int strcmp(const char *s, const char *t)
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
DDS::DomainId_t id_

◆ force_add_topic()

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::force_add_topic ( const OpenDDS::DCPS::GUID_t topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr 
)

Add a topic to the domain Returns OpenDDS::DCPS::CREATED if successful

Definition at line 178 of file DCPS_IR_Domain.cpp.

References add_topic_i(), and OpenDDS::DCPS::topicIsBIT().

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 }
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)
bool topicIsBIT(const char *name, const char *type)

◆ get_id()

DDS::DomainId_t DCPS_IR_Domain::get_id ( void  )

Definition at line 1006 of file DCPS_IR_Domain.cpp.

References id_.

Referenced by DCPS_IR_Participant::remove_all_dependents(), and DCPS_IR_Participant::takeOwnership().

1007 {
1008  return id_;
1009 }
DDS::DomainId_t id_

◆ get_next_participant_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Domain::get_next_participant_id ( )

Next Entity Id value in sequence.

Definition at line 1012 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::RepoIdGenerator::next(), and participantIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

1013 {
1014  return this->participantIdGenerator_.next();
1015 }
GUID_t next(bool builtin=false)
Obtain the next GUID_t value.
OpenDDS::DCPS::RepoIdGenerator & participantIdGenerator_

◆ init_built_in_topics()

int DCPS_IR_Domain::init_built_in_topics ( bool  federated,
bool  persistent 
)

Initialize the Built-In Topic structures This needs to be called before the run begins Returns 0 (zero) if successful

Definition at line 469 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, ACE_ERROR_RETURN, ACE_TEXT(), bitParticipant_, bitParticipantFactory_, bitParticipantListener_, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DEFAULT_STATUS_MASK, id_, init_built_in_topics_datawriters(), init_built_in_topics_topics(), init_built_in_topics_transport(), CORBA::is_nil(), LM_DEBUG, LM_ERROR, PARTICIPANT_QOS_DEFAULT, reassociate_built_in_topic_pubs(), TheParticipantFactory, TheTransientKludge, and useBIT_.

Referenced by TAO_DDS_DCPSInfo_i::domain(), and find_topic_description().

470 {
471  // Indicates that BIT subscriber and datareaders should not be created.
472  TheTransientKludge->enable();
473 
475  ACE_DEBUG((LM_DEBUG,
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())) {
493  ACE_ERROR_RETURN((LM_ERROR,
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 }
#define PARTICIPANT_QOS_DEFAULT
#define ACE_DEBUG(X)
int init_built_in_topics_transport(bool persistent)
DDS::DomainParticipantListener_var bitParticipantListener_
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
const DDS::StatusMask DEFAULT_STATUS_MASK
DDS::DomainParticipant_var bitParticipant_
int init_built_in_topics_topics()
int init_built_in_topics_datawriters(bool federated)
#define TheTransientKludge
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DDS::DomainParticipantFactory_var bitParticipantFactory_
#define ACE_ERROR_RETURN(X, Y)
#define TheParticipantFactory
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
Boolean is_nil(T x)
DDS::DomainId_t id_

◆ init_built_in_topics_datawriters()

int DCPS_IR_Domain::init_built_in_topics_datawriters ( bool  federated)
private

work of initializing the built in topics is done in these private methods. They were broken up for readability.

Definition at line 705 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR_RETURN, ACE_TEXT(), bitParticipantDataWriter_, bitParticipantTopic_, bitPublicationDataWriter_, bitPublicationTopic_, bitPublisher_, bitSubscriptionDataWriter_, bitSubscriptionTopic_, bitTopicDataWriter_, bitTopicTopic_, OpenDDS::DCPS::DEFAULT_STATUS_MASK, DDS::DataWriterQos::durability, CORBA::is_nil(), DDS::DurabilityQosPolicy::kind, DDS::LivelinessQosPolicy::lease_duration, DDS::DataWriterQos::liveliness, LM_ERROR, DDS::Duration_t::nanosec, DDS::Duration_t::sec, TheServiceParticipant, and DDS::TRANSIENT_LOCAL_DURABILITY_QOS.

Referenced by init_built_in_topics(), and init_built_in_topics_topics().

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 
732  ACE_ERROR_RETURN((LM_ERROR,
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 
754  ACE_ERROR_RETURN((LM_ERROR,
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 
773  ACE_ERROR_RETURN((LM_ERROR,
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 
791  ACE_ERROR_RETURN((LM_ERROR,
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 }
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
DDS::Topic_var bitTopicTopic_
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
const DDS::StatusMask DEFAULT_STATUS_MASK
DDS::Topic_var bitPublicationTopic_
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
DurabilityQosPolicyKind kind
DurabilityQosPolicy durability
unsigned long nanosec
Definition: DdsDcpsCore.idl:69
DDS::Topic_var bitParticipantTopic_
ACE_TEXT("TCP_Factory")
DDS::Publisher_var bitPublisher_
#define ACE_ERROR_RETURN(X, Y)
#define TheServiceParticipant
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
LivelinessQosPolicy liveliness
Boolean is_nil(T x)
DDS::Topic_var bitSubscriptionTopic_

◆ init_built_in_topics_topics()

int DCPS_IR_Domain::init_built_in_topics_topics ( )
private

work of initializing the built in topics is done in these private methods. They were broken up for readability.

Definition at line 565 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR, ACE_ERROR_RETURN, ACE_TEXT(), bitParticipant_, bitParticipantTopic_, bitPublicationTopic_, bitSubscriptionTopic_, bitTopicTopic_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::DEFAULT_STATUS_MASK, init_built_in_topics_datawriters(), CORBA::is_nil(), LM_ERROR, and DDS::RETCODE_OK.

Referenced by init_built_in_topics().

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(),
580  ACE_ERROR((LM_ERROR,
581  ACE_TEXT("(%P|%t) ERROR: Failed to register the ParticipantBuiltinTopicDataTypeSupport.")));
582  return 1;
583  }
584 
588  topic_qos,
589  DDS::TopicListener::_nil(),
591 
593  ACE_ERROR_RETURN((LM_ERROR,
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(),
608  ACE_ERROR((LM_ERROR,
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())) {
621  ACE_ERROR_RETURN((LM_ERROR,
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(),
636  ACE_ERROR((LM_ERROR,
637  ACE_TEXT("(%P|%t) ERROR: Failed to register the SubscriptionBuiltinTopicDataTypeSupport.")));
638  return 1;
639  }
640 
644  topic_qos,
645  DDS::TopicListener::_nil(),
647 
649  ACE_ERROR_RETURN((LM_ERROR,
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(),
664  ACE_ERROR((LM_ERROR,
665  ACE_TEXT("(%P|%t) ERROR: Failed to register the PublicationBuiltinTopicDataTypeSupport.")));
666  return 1;
667  }
668 
672  topic_qos,
673  DDS::TopicListener::_nil(),
675 
677  ACE_ERROR_RETURN((LM_ERROR,
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 }
#define ACE_ERROR(X)
const char *const BUILT_IN_TOPIC_TOPIC_TYPE
const ReturnCode_t RETCODE_OK
DDS::Topic_var bitTopicTopic_
const DDS::StatusMask DEFAULT_STATUS_MASK
DDS::DomainParticipant_var bitParticipant_
DDS::Topic_var bitPublicationTopic_
const char *const BUILT_IN_PARTICIPANT_TOPIC
const char *const BUILT_IN_PUBLICATION_TOPIC
DDS::Topic_var bitParticipantTopic_
ACE_TEXT("TCP_Factory")
const char *const BUILT_IN_SUBSCRIPTION_TOPIC
const char *const BUILT_IN_TOPIC_TOPIC
#define ACE_ERROR_RETURN(X, Y)
const char *const BUILT_IN_PUBLICATION_TOPIC_TYPE
const char *const BUILT_IN_SUBSCRIPTION_TOPIC_TYPE
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
Boolean is_nil(T x)
const char *const BUILT_IN_PARTICIPANT_TOPIC_TYPE
DDS::Topic_var bitSubscriptionTopic_

◆ init_built_in_topics_transport()

int DCPS_IR_Domain::init_built_in_topics_transport ( bool  persistent)
private

work of initializing the built in topics is done in these private methods. They were broken up for readability.

Definition at line 807 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_ERROR_RETURN, ACE_TEXT(), DDS::WriterDataLifecycleQosPolicy::autodispose_unregistered_instances, OpenDDS::DCPS::TransportRegistry::bind_config(), bitParticipant_, bitPublisher_, OpenDDS::DCPS::TransportRegistry::DEFAULT_INST_PREFIX, OpenDDS::DCPS::DEFAULT_STATUS_MASK, OpenDDS::DCPS::TransportRegistry::get_config(), OpenDDS::DCPS::TransportRegistry::instance(), CORBA::is_nil(), LM_ERROR, PUBLISHER_QOS_DEFAULT, transportConfig_, and DDS::DataWriterQos::writer_data_lifecycle.

Referenced by init_built_in_topics().

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())) {
825  ACE_ERROR_RETURN((LM_ERROR,
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 }
const DDS::StatusMask DEFAULT_STATUS_MASK
DDS::DomainParticipant_var bitParticipant_
static const char DEFAULT_INST_PREFIX[]
static TransportRegistry * instance()
Return a singleton instance of this class.
TransportConfig_rch get_config(const OPENDDS_STRING &name) const
#define PUBLISHER_QOS_DEFAULT
OpenDDS::DCPS::TransportConfig_rch transportConfig_
ACE_TEXT("TCP_Factory")
DDS::Publisher_var bitPublisher_
WriterDataLifecycleQosPolicy writer_data_lifecycle
void bind_config(const OPENDDS_STRING &name, DDS::Entity_ptr entity)
#define ACE_ERROR_RETURN(X, Y)
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
Boolean is_nil(T x)

◆ last_participant_key()

void DCPS_IR_Domain::last_participant_key ( long  key)

Ensure no conflicts with sequence values from persistent storage.

Definition at line 1018 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::RepoIdGenerator::last(), and participantIdGenerator_.

1019 {
1021 }
sequence< octet > key
OpenDDS::DCPS::RepoIdGenerator & participantIdGenerator_

◆ participant()

DCPS_IR_Participant * DCPS_IR_Domain::participant ( const OpenDDS::DCPS::GUID_t id) const

Find the participant with the id.

Definition at line 69 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::RcHandle< T >::in(), and participant_rch().

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant(), TAO_DDS_DCPSInfo_i::add_subscription(), and remove_participant().

70 {
72  return p ? p.in() : 0;
73 }
DCPS_IR_Participant_rch participant_rch(const OpenDDS::DCPS::GUID_t &id) const

◆ participant_rch()

DCPS_IR_Participant_rch DCPS_IR_Domain::participant_rch ( const OpenDDS::DCPS::GUID_t id) const

Definition at line 56 of file DCPS_IR_Domain.cpp.

References participants_.

Referenced by participant().

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 }
DCPS_IR_Participant_Map participants_
all the participants
OpenDDS::DCPS::RcHandle< DCPS_IR_Participant > DCPS_IR_Participant_rch

◆ participants()

const DCPS_IR_Participant_Map & DCPS_IR_Domain::participants ( ) const

Expose a readable reference to the participant map.

Definition at line 51 of file DCPS_IR_Domain.cpp.

References participants_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

52 {
53  return this->participants_;
54 }
DCPS_IR_Participant_Map participants_
all the participants

◆ publish_participant_bit()

void DCPS_IR_Domain::publish_participant_bit ( DCPS_IR_Participant participant)

Publish Participant in the Participant Built-In Topic.

Definition at line 1023 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, OpenDDS::DCPS::bit_key_to_guid(), bitParticipantDataWriter_, OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Participant::get_id(), DCPS_IR_Participant::get_qos(), OpenDDS::DCPS::guid_to_bit_key(), DCPS_IR_Participant::isBitPublisher(), LM_DEBUG, DCPS_IR_Participant::set_handle(), useBIT_, and DDS::DomainParticipantQos::user_data.

Referenced by add_participant(), and DCPS_IR_Participant::set_qos().

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 
1040  ACE_DEBUG((LM_DEBUG,
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 }
#define ACE_DEBUG(X)
UserDataQosPolicy user_data
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
OpenDDS::DCPS::GUID_t get_id()
void set_handle(DDS::InstanceHandle_t handle)
const DDS::DomainParticipantQos * get_qos()
const char * c_str() const
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82

◆ publish_publication_bit()

void DCPS_IR_Domain::publish_publication_bit ( DCPS_IR_Publication publication)

Publish Publication in the Publication Built-In Topic.

Definition at line 1186 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, ACE_ERROR, OpenDDS::DCPS::bit_key_to_guid(), bitPublicationDataWriter_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, DDS::DataWriterQos::deadline, DDS::DataWriterQos::destination_order, DDS::DataWriterQos::durability, DDS::DataWriterQos::durability_service, DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Publication::get_datawriter_qos(), DCPS_IR_Publication::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Publication::get_participant_id(), DCPS_IR_Publication::get_publisher_qos(), DCPS_IR_Publication::get_topic(), DCPS_IR_Publication::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), DDS::PublisherQos::group_data, OpenDDS::DCPS::guid_to_bit_key(), DDS::DataWriterQos::latency_budget, DDS::DataWriterQos::lifespan, DDS::DataWriterQos::liveliness, LM_DEBUG, LM_ERROR, DDS::DataWriterQos::ownership, DDS::DataWriterQos::ownership_strength, DDS::PublisherQos::partition, DDS::PublisherQos::presentation, DDS::DataWriterQos::reliability, DDS::RETCODE_OK, DCPS_IR_Publication::set_bit_status(), DCPS_IR_Publication::set_handle(), ACE_OS::strcmp(), DDS::TopicQos::topic_data, useBIT_, and DDS::DataWriterQos::user_data.

Referenced by DCPS_IR_Topic::add_publication_reference(), DCPS_IR_Publication::set_qos(), and DCPS_IR_Topic::set_topic_qos().

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 
1238  ACE_DEBUG((LM_DEBUG,
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) {
1245  ACE_ERROR((LM_ERROR,
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 }
#define ACE_DEBUG(X)
DDS::DataWriterQos * get_datawriter_qos()
#define ACE_ERROR(X)
const char *const BUILT_IN_TOPIC_TOPIC_TYPE
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DDS::TopicQos * get_topic_qos()
const ReturnCode_t RETCODE_OK
OpenDDS::DCPS::GUID_t get_participant_id()
DCPS_IR_Topic * get_topic()
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_
TopicDataQosPolicy topic_data
PartitionQosPolicy partition
Representative of a Topic Description.
UserDataQosPolicy user_data
GroupDataQosPolicy group_data
DDS::PublisherQos * get_publisher_qos()
ReliabilityQosPolicy reliability
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
DurabilityServiceQosPolicy durability_service
LatencyBudgetQosPolicy latency_budget
OwnershipStrengthQosPolicy ownership_strength
LifespanQosPolicy lifespan
const char * c_str() const
DurabilityQosPolicy durability
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
int strcmp(const char *s, const char *t)
void set_handle(DDS::InstanceHandle_t handle)
PresentationQosPolicy presentation
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
DeadlineQosPolicy deadline
OwnershipQosPolicy ownership
const char *const BUILT_IN_PUBLICATION_TOPIC_TYPE
const char *const BUILT_IN_SUBSCRIPTION_TOPIC_TYPE
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
LivelinessQosPolicy liveliness
DestinationOrderQosPolicy destination_order
OpenDDS::DCPS::GUID_t get_id()
void set_bit_status(CORBA::Boolean isBIT)
const char *const BUILT_IN_PARTICIPANT_TOPIC_TYPE
DCPS_IR_Topic_Description * get_topic_description()

◆ publish_subscription_bit()

void DCPS_IR_Domain::publish_subscription_bit ( DCPS_IR_Subscription subscription)

Publish Subscription in the Subscription Built-In Topic.

Definition at line 1118 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, OpenDDS::DCPS::bit_key_to_guid(), bitSubscriptionDataWriter_, OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, DDS::DataReaderQos::deadline, DDS::DataReaderQos::destination_order, DDS::DataReaderQos::durability, DCPS_IR_Subscription::get_datareader_qos(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Subscription::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Subscription::get_participant_id(), DCPS_IR_Subscription::get_subscriber_qos(), DCPS_IR_Subscription::get_topic(), DCPS_IR_Subscription::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), DDS::SubscriberQos::group_data, OpenDDS::DCPS::guid_to_bit_key(), DDS::DataReaderQos::latency_budget, DDS::DataReaderQos::liveliness, LM_DEBUG, name, DDS::DataReaderQos::ownership, DDS::SubscriberQos::partition, DDS::SubscriberQos::presentation, DDS::DataReaderQos::reliability, DCPS_IR_Subscription::set_bit_status(), DCPS_IR_Subscription::set_handle(), DDS::DataReaderQos::time_based_filter, DDS::TopicQos::topic_data, OpenDDS::DCPS::topicIsBIT(), useBIT_, and DDS::DataReaderQos::user_data.

Referenced by DCPS_IR_Topic_Description::add_subscription_reference(), DCPS_IR_Subscription::set_qos(), and DCPS_IR_Topic::set_topic_qos().

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 
1162  ACE_DEBUG((LM_DEBUG,
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 }
const DDS::DataReaderQos * get_datareader_qos()
#define ACE_DEBUG(X)
GroupDataQosPolicy group_data
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DDS::TopicQos * get_topic_qos()
DestinationOrderQosPolicy destination_order
LivelinessQosPolicy liveliness
TopicDataQosPolicy topic_data
DCPS_IR_Topic_Description * get_topic_description()
Representative of a Topic Description.
const DDS::SubscriberQos * get_subscriber_qos()
TimeBasedFilterQosPolicy time_based_filter
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
LatencyBudgetQosPolicy latency_budget
ReliabilityQosPolicy reliability
OpenDDS::DCPS::GUID_t get_participant_id()
DurabilityQosPolicy durability
UserDataQosPolicy user_data
OwnershipQosPolicy ownership
bool topicIsBIT(const char *name, const char *type)
const char * c_str() const
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
void set_handle(DDS::InstanceHandle_t handle)
OpenDDS::DCPS::GUID_t get_id()
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const char *const name
Definition: debug.cpp:60
PresentationQosPolicy presentation
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
PartitionQosPolicy partition
DeadlineQosPolicy deadline
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
void set_bit_status(CORBA::Boolean isBIT)

◆ publish_topic_bit()

void DCPS_IR_Domain::publish_topic_bit ( DCPS_IR_Topic topic)

Publish Topic in the Topic Built-In Topic.

Definition at line 1058 of file DCPS_IR_Domain.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, OpenDDS::DCPS::bit_key_to_guid(), bitTopicDataWriter_, OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, DDS::TopicQos::deadline, DDS::TopicQos::destination_order, DDS::TopicQos::durability, DDS::TopicQos::durability_service, DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Topic::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Topic::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), OpenDDS::DCPS::guid_to_bit_key(), DDS::TopicQos::history, DDS::TopicQos::latency_budget, DDS::TopicQos::lifespan, DDS::TopicQos::liveliness, LM_DEBUG, name, DDS::TopicQos::ownership, DDS::TopicQos::reliability, DDS::TopicQos::resource_limits, DCPS_IR_Topic::set_bit_status(), DCPS_IR_Topic::set_handle(), DDS::TopicQos::topic_data, OpenDDS::DCPS::topicIsBIT(), DDS::TopicQos::transport_priority, and useBIT_.

Referenced by add_topic_i(), and DCPS_IR_Topic::set_topic_qos().

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 
1096  ACE_DEBUG((LM_DEBUG,
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 }
#define ACE_DEBUG(X)
LivelinessQosPolicy liveliness
OwnershipQosPolicy ownership
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled
DDS::TopicQos * get_topic_qos()
void set_handle(DDS::InstanceHandle_t handle)
TopicDataQosPolicy topic_data
Representative of a Topic Description.
void set_bit_status(CORBA::Boolean isBIT)
DCPS_IR_Topic_Description * get_topic_description()
DeadlineQosPolicy deadline
ReliabilityQosPolicy reliability
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
HistoryQosPolicy history
bool topicIsBIT(const char *name, const char *type)
const char * c_str() const
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DurabilityQosPolicy durability
TransportPriorityQosPolicy transport_priority
const char *const name
Definition: debug.cpp:60
ResourceLimitsQosPolicy resource_limits
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
LifespanQosPolicy lifespan
OpenDDS::DCPS::GUID_t get_id() const
DurabilityServiceQosPolicy durability_service
void _tao_print_exception(const char *info, FILE *f=stdout) const
Definition: Exception.cpp:82
DestinationOrderQosPolicy destination_order
LatencyBudgetQosPolicy latency_budget

◆ reassociate_built_in_topic_pubs()

int DCPS_IR_Domain::reassociate_built_in_topic_pubs ( )

Reassociate the Built-In Topic datawriters This needs to be called after reincarnating from persistence and before the run begins Returns 0 (zero) if successful

Definition at line 536 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, LM_DEBUG, and participants_.

Referenced by init_built_in_topics().

537 {
539  ACE_DEBUG((LM_DEBUG,
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 }
#define ACE_DEBUG(X)
DCPS_IR_Participant_Map participants_
all the participants
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DDS::DomainId_t id_

◆ remove_dead_participants()

void DCPS_IR_Domain::remove_dead_participants ( bool  part_of_cleanup = false)

Remove any participants currently marked as dead.

Definition at line 971 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_ERROR, dead, deadParticipants_, OpenDDS::DCPS::RcHandle< T >::in(), LM_DEBUG, LM_WARNING, and remove_participant().

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

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.
986  ACE_DEBUG((LM_DEBUG,
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 {
992  ACE_ERROR((LM_WARNING,
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 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
dead
int remove_participant(const OpenDDS::DCPS::GUID_t &particpantId, CORBA::Boolean notify_lost)
DCPS_IR_Participant_Set deadParticipants_

◆ remove_participant()

int DCPS_IR_Domain::remove_participant ( const OpenDDS::DCPS::GUID_t particpantId,
CORBA::Boolean  notify_lost 
)

Remove the particpant The participant has been deleted if returns successful. Returns 0 if successful. The notify_lost parameter is passed to the remove_associations() See the comments of remove_associations() in DataWriterRemote.idl or DataReaderRemote.idl.

Definition at line 115 of file DCPS_IR_Domain.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, dispose_participant_bit(), OpenDDS::DCPS::RcHandle< T >::get(), id_, OpenDDS::DCPS::RcHandle< T >::in(), LM_DEBUG, LM_ERROR, participant(), and participants_.

Referenced by remove_dead_participants().

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);
134  ACE_DEBUG((LM_DEBUG,
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);
147  ACE_ERROR((LM_ERROR,
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 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
DCPS_IR_Participant * participant(const OpenDDS::DCPS::GUID_t &id) const
Find the participant with the id.
void dispose_participant_bit(DCPS_IR_Participant *participant)
Dispose Participant in the Participant Built-In Topic.
DCPS_IR_Participant_Map participants_
all the participants
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DDS::DomainId_t id_

◆ remove_topic()

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::remove_topic ( DCPS_IR_Participant part,
DCPS_IR_Topic *&  topic 
)

Remove the topic The topic has been deleted if returns successful Returns OpenDDS::DCPS::REMOVED if successful

Definition at line 369 of file DCPS_IR_Domain.cpp.

References ACE_ERROR, ACE_TEXT(), dispose_topic_bit(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Topic::get_id(), DCPS_IR_Participant::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Topic_Description::get_number_topics(), DCPS_IR_Topic::get_topic_description(), id_, LM_ERROR, DCPS_IR_Topic::release(), DCPS_IR_Topic_Description::remove_topic(), remove_topic_description(), DCPS_IR_Participant::remove_topic_reference(), and OpenDDS::DCPS::REMOVED.

Referenced by DCPS_IR_Participant::remove_all_dependents().

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.
386  ACE_ERROR((LM_ERROR,
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());
401  ACE_ERROR((LM_ERROR,
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 }
#define ACE_ERROR(X)
void release(bool removing)
Representative of a Topic Description.
CORBA::ULong get_number_topics() const
Returns the number of topics.
OpenDDS::DCPS::GUID_t get_id()
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
int remove_topic_description(DCPS_IR_Topic_Description *desc)
Returns 0 if successful.
void dispose_topic_bit(DCPS_IR_Topic *topic)
Dispose Topic in the Topic Built-In Topic.
DCPS_IR_Topic_Description * get_topic_description()
int remove_topic_reference(OpenDDS::DCPS::GUID_t topicId, DCPS_IR_Topic *&topic)
ACE_TEXT("TCP_Factory")
int remove_topic(DCPS_IR_Topic *topic)
OpenDDS::DCPS::GUID_t get_id() const
DDS::DomainId_t id_

◆ remove_topic_description()

int DCPS_IR_Domain::remove_topic_description ( DCPS_IR_Topic_Description desc)
private

Returns 0 if successful.

Definition at line 948 of file DCPS_IR_Domain.cpp.

References ACE_ERROR, ACE_TEXT(), DCPS_IR_Topic_Description::get_name(), id_, LM_ERROR, and topicDescriptions_.

Referenced by remove_topic().

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 {
957  ACE_ERROR((LM_ERROR,
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 }
#define ACE_ERROR(X)
DCPS_IR_Topic_Description_Set topicDescriptions_
all the topics
ACE_TEXT("TCP_Factory")
DDS::DomainId_t id_

◆ remove_topic_id_mapping()

void DCPS_IR_Domain::remove_topic_id_mapping ( const OpenDDS::DCPS::GUID_t topicId)

Remove the topic from the id to topic map. This method should only be called by the DCPS_IR_Topic when deleting the topic.

Definition at line 1463 of file DCPS_IR_Domain.cpp.

References idToTopicMap_.

Referenced by DCPS_IR_Topic::release().

1464 {
1465  IdToTopicMap::iterator map_entry = this->idToTopicMap_.find(topicId);
1466  if (map_entry != this->idToTopicMap_.end())
1467  idToTopicMap_.erase(map_entry);
1468 }
IdToTopicMap idToTopicMap_
Actual mapping of Id values to Topic object references.

◆ useBIT()

bool DCPS_IR_Domain::useBIT ( ) const
inline

Definition at line 178 of file DCPS_IR_Domain.h.

References name.

Referenced by TAO_DDS_DCPSInfo_i::domain().

178 { return useBIT_; }
OpenDDS::DCPS::AtomicBool useBIT_
indicates if the BuiltIn Topics are enabled

Member Data Documentation

◆ bitParticipant_

DDS::DomainParticipant_var DCPS_IR_Domain::bitParticipant_
private

◆ bitParticipantDataWriter_

DDS::ParticipantBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitParticipantDataWriter_
private

◆ bitParticipantFactory_

DDS::DomainParticipantFactory_var DCPS_IR_Domain::bitParticipantFactory_
private

Built-in Topic variables

Definition at line 246 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), and init_built_in_topics().

◆ bitParticipantListener_

DDS::DomainParticipantListener_var DCPS_IR_Domain::bitParticipantListener_
private

Built-in Topic variables

Definition at line 248 of file DCPS_IR_Domain.h.

Referenced by init_built_in_topics().

◆ bitParticipantTopic_

DDS::Topic_var DCPS_IR_Domain::bitParticipantTopic_
private

Built-in Topic variables

Definition at line 254 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

◆ bitPublicationDataWriter_

DDS::PublicationBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitPublicationDataWriter_
private

◆ bitPublicationTopic_

DDS::Topic_var DCPS_IR_Domain::bitPublicationTopic_
private

Built-in Topic variables

Definition at line 263 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

◆ bitPublisher_

DDS::Publisher_var DCPS_IR_Domain::bitPublisher_
private

Built-in Topic variables

Definition at line 249 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_transport().

◆ bitSubscriptionDataWriter_

DDS::SubscriptionBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitSubscriptionDataWriter_
private

◆ bitSubscriptionTopic_

DDS::Topic_var DCPS_IR_Domain::bitSubscriptionTopic_
private

Built-in Topic variables

Definition at line 260 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

◆ bitTopicDataWriter_

DDS::TopicBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitTopicDataWriter_
private

Built-in Topic variables

Definition at line 258 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_topic_bit(), init_built_in_topics_datawriters(), and publish_topic_bit().

◆ bitTopicTopic_

DDS::Topic_var DCPS_IR_Domain::bitTopicTopic_
private

Built-in Topic variables

Definition at line 257 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

◆ deadParticipants_

DCPS_IR_Participant_Set DCPS_IR_Domain::deadParticipants_
private

the dead participants dead participants exist in both this and participants_

Definition at line 228 of file DCPS_IR_Domain.h.

Referenced by add_dead_participant(), dump_to_string(), and remove_dead_participants().

◆ id_

DDS::DomainId_t DCPS_IR_Domain::id_
private

◆ idToTopicMap_

IdToTopicMap DCPS_IR_Domain::idToTopicMap_
private

Actual mapping of Id values to Topic object references.

Definition at line 239 of file DCPS_IR_Domain.h.

Referenced by add_topic_i(), find_topic(), and remove_topic_id_mapping().

◆ participantIdGenerator_

OpenDDS::DCPS::RepoIdGenerator& DCPS_IR_Domain::participantIdGenerator_
private

Participant GUID Id generator. The remaining Entities have their values generated within the containing Participant.

Definition at line 221 of file DCPS_IR_Domain.h.

Referenced by get_next_participant_id(), and last_participant_key().

◆ participants_

DCPS_IR_Participant_Map DCPS_IR_Domain::participants_
private

◆ topicDescriptions_

DCPS_IR_Topic_Description_Set DCPS_IR_Domain::topicDescriptions_
private

◆ transportConfig_

OpenDDS::DCPS::TransportConfig_rch DCPS_IR_Domain::transportConfig_
private

Built-in Topic variables

Definition at line 252 of file DCPS_IR_Domain.h.

Referenced by init_built_in_topics_transport().

◆ useBIT_

OpenDDS::DCPS::AtomicBool DCPS_IR_Domain::useBIT_
private

The documentation for this class was generated from the following files: