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

Representative of the Domain Participant. More...

#include <DCPS_IR_Participant.h>

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

Public Types

enum  { OWNER_NONE }
 Special owner to enforce no callbacks. More...
 

Public Member Functions

 DCPS_IR_Participant (const TAO_DDS_DCPSFederationId &federationId, OpenDDS::DCPS::GUID_t id, DCPS_IR_Domain *domain, DDS::DomainParticipantQos qos, Update::Manager *um, bool isBit)
 
virtual ~DCPS_IR_Participant ()
 
void takeOwnership ()
 Take local ownership of this participant and publish an update. More...
 
void changeOwner (long sender, long owner)
 Process an incoming update that changes ownership. More...
 
long owner () const
 Value of the owner for this participant. More...
 
bool isOwner () const
 Indication of whether the current repository is the owner of this participant. More...
 
int add_publication (OpenDDS::DCPS::unique_ptr< DCPS_IR_Publication > pub)
 
int find_publication_reference (OpenDDS::DCPS::GUID_t pubId, DCPS_IR_Publication *&pub)
 Return the publication object. More...
 
int remove_publication (OpenDDS::DCPS::GUID_t pubId)
 
int add_subscription (OpenDDS::DCPS::unique_ptr< DCPS_IR_Subscription > sub)
 
int find_subscription_reference (OpenDDS::DCPS::GUID_t subId, DCPS_IR_Subscription *&sub)
 Return the subscription object. More...
 
int remove_subscription (OpenDDS::DCPS::GUID_t subId)
 
int add_topic_reference (DCPS_IR_Topic *topic)
 
int remove_topic_reference (OpenDDS::DCPS::GUID_t topicId, DCPS_IR_Topic *&topic)
 
int find_topic_reference (OpenDDS::DCPS::GUID_t topicId, DCPS_IR_Topic *&topic)
 
void remove_all_dependents (CORBA::Boolean notify_lost)
 Removes all topics, publications and. More...
 
void mark_dead ()
 
OpenDDS::DCPS::GUID_t get_id ()
 
CORBA::Boolean is_alive ()
 
void set_alive (CORBA::Boolean alive)
 
void ignore_participant (OpenDDS::DCPS::GUID_t id)
 Ignore the participant with the id. More...
 
void ignore_topic (OpenDDS::DCPS::GUID_t id)
 Ignore the topic with the id. More...
 
void ignore_publication (OpenDDS::DCPS::GUID_t id)
 Ignore the publication with the id. More...
 
void ignore_subscription (OpenDDS::DCPS::GUID_t id)
 Ignore the subscription with the id. More...
 
const DDS::DomainParticipantQosget_qos ()
 
bool set_qos (const DDS::DomainParticipantQos &qos)
 
DDS::InstanceHandle_t get_handle ()
 
void set_handle (DDS::InstanceHandle_t handle)
 
DCPS_IR_Domainget_domain_reference () const
 
const DCPS_IR_Publication_Mappublications () const
 Expose a readable reference to the publication map. More...
 
const DCPS_IR_Subscription_Mapsubscriptions () const
 Expose a readable reference to the subscription map. More...
 
const DCPS_IR_Topic_Maptopics () const
 Expose a readable reference to the topic map. More...
 
std::string dump_to_string (const std::string &prefix, int depth) const
 
bool & isBitPublisher ()
 
bool isBitPublisher () const
 
CORBA::Boolean is_participant_ignored (OpenDDS::DCPS::GUID_t id)
 
CORBA::Boolean is_topic_ignored (OpenDDS::DCPS::GUID_t id)
 
CORBA::Boolean is_publication_ignored (OpenDDS::DCPS::GUID_t id)
 
CORBA::Boolean is_subscription_ignored (OpenDDS::DCPS::GUID_t id)
 
OpenDDS::DCPS::GUID_t get_next_topic_id (bool builtin)
 
OpenDDS::DCPS::GUID_t get_next_publication_id (bool builtin)
 
OpenDDS::DCPS::GUID_t get_next_subscription_id (bool builtin)
 
void last_topic_key (long key)
 
void last_publication_key (long key)
 
void last_subscription_key (long key)
 
- 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 Attributes

OpenDDS::DCPS::GUID_t id_
 
DCPS_IR_Domaindomain_
 
DDS::DomainParticipantQos qos_
 
CORBA::Boolean aliveStatus_
 
DDS::InstanceHandle_t handle_
 
const TAO_DDS_DCPSFederationIdfederationId_
 
long owner_
 
ACE_SYNCH_MUTEX ownerLock_
 Lock portions ownership processing. More...
 
Update::Managerum_
 
bool isBitPublisher_
 Flag indicating this participant publishes built-in topics. More...
 
OpenDDS::DCPS::RepoIdGenerator topicIdGenerator_
 
OpenDDS::DCPS::RepoIdGenerator publicationIdGenerator_
 
OpenDDS::DCPS::RepoIdGenerator subscriptionIdGenerator_
 
DCPS_IR_Subscription_Map subscriptions_
 
DCPS_IR_Publication_Map publications_
 
DCPS_IR_Topic_Map topicRefs_
 
TAO_DDS_RepoId_Set ignoredParticipants_
 
TAO_DDS_RepoId_Set ignoredTopics_
 
TAO_DDS_RepoId_Set ignoredPublications_
 
TAO_DDS_RepoId_Set ignoredSubscriptions_
 

Additional Inherited Members

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

Detailed Description

Representative of the Domain Participant.

Definition at line 62 of file DCPS_IR_Participant.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Special owner to enforce no callbacks.

Enumerator
OWNER_NONE 

Definition at line 67 of file DCPS_IR_Participant.h.

Constructor & Destructor Documentation

◆ DCPS_IR_Participant()

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL DCPS_IR_Participant::DCPS_IR_Participant ( const TAO_DDS_DCPSFederationId federationId,
OpenDDS::DCPS::GUID_t  id,
DCPS_IR_Domain domain,
DDS::DomainParticipantQos  qos,
Update::Manager um,
bool  isBit 
)

Definition at line 26 of file DCPS_IR_Participant.cpp.

32  : id_(id),
33  domain_(domain),
34  qos_(qos),
35  aliveStatus_(1),
36  handle_(0),
37  federationId_(federationId),
38  owner_(federationId.overridden() ? OWNER_NONE : federationId.id()),
40  federationId.id(),
44  federationId.id(),
48  federationId.id(),
51  um_(um),
52  isBitPublisher_(isBit)
53 {
54 }
ENTITYKIND_USER_WRITER_WITH_KEY and ENTITYKIND_USER_WRITER_NO_KEY.
Definition: GuidUtils.h:69
ENTITYKIND_BUILTIN_TOPIC.
Definition: GuidUtils.h:74
DCPS_IR_Domain * domain_
ENTITYKIND_BUILTIN_WRITER_WITH_KEY and ENTITYKIND_USER_WRITER_NO_KEY.
Definition: GuidUtils.h:72
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
DDS::InstanceHandle_t handle_
const TAO_DDS_DCPSFederationId & federationId_
OpenDDS::DCPS::RepoIdGenerator topicIdGenerator_
CORBA::Boolean aliveStatus_
ENTITYKIND_OPENDDS_TOPIC.
Definition: GuidUtils.h:71
ENTITYKIND_USER_READER_WITH_KEY and ENTITYKIND_USER_READER_NO_KEY.
Definition: GuidUtils.h:70
DDS::DomainParticipantQos qos_
Update::Manager * um_
OpenDDS::DCPS::RepoIdGenerator subscriptionIdGenerator_
ParticipantId participantId() const
Get the participant id from the GUID.
ENTITYKIND_BUILTIN_READER_WITH_KEY and ENTITYKIND_USER_READER_NO_KEY.
Definition: GuidUtils.h:73
void id(RepoKey fedId)
OpenDDS::DCPS::GUID_t id_
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.
OpenDDS::DCPS::RepoIdGenerator publicationIdGenerator_

◆ ~DCPS_IR_Participant()

DCPS_IR_Participant::~DCPS_IR_Participant ( )
virtual

Definition at line 56 of file DCPS_IR_Participant.cpp.

57 {
58 }

Member Function Documentation

◆ add_publication()

int DCPS_IR_Participant::add_publication ( OpenDDS::DCPS::unique_ptr< DCPS_IR_Publication pub)

Add a publication This takes ownership of the memory pointed to by pub Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 150 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), DCPS_IR_Publication::get_id(), id_, isBitPublisher_, LM_DEBUG, LM_NOTICE, OpenDDS::DCPS::move(), publications_, and DCPS_IR_Publication::set_bit_status().

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

151 {
152  OpenDDS::DCPS::GUID_t pubId = pub->get_id();
153  DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
154 
155  if (where == this->publications_.end()) {
156  DCPS_IR_Publication* pubptr = pub.get();
157  this->publications_.insert(
158  where, DCPS_IR_Publication_Map::value_type(pubId, OpenDDS::DCPS::move(pub)));
159 
160  if (isBitPublisher_) {
162  }
163 
165  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
166  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
167  ACE_DEBUG((LM_DEBUG,
168  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_publication: ")
169  ACE_TEXT("participant %C successfully added publication %C at 0x%x.\n"),
170  std::string(part_converter).c_str(),
171  std::string(pub_converter).c_str(),
172  pubptr));
173  }
174 
175  return 0;
176 
177  } else {
179  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
180  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
181  ACE_ERROR((LM_NOTICE,
182  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_publication: ")
183  ACE_TEXT("participant %C attempted to add existing publication %C.\n"),
184  std::string(part_converter).c_str(),
185  std::string(pub_converter).c_str()));
186  }
187 
188  return 1;
189  }
190 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
Representative of a Publication.
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.
OpenDDS::DCPS::GUID_t get_id()
void set_bit_status(CORBA::Boolean isBIT)
DCPS_IR_Publication_Map publications_

◆ add_subscription()

int DCPS_IR_Participant::add_subscription ( OpenDDS::DCPS::unique_ptr< DCPS_IR_Subscription sub)

Add a subscription This takes ownership of the memory pointed to by aub Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 276 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), DCPS_IR_Subscription::get_id(), id_, isBitPublisher_, LM_DEBUG, LM_NOTICE, OpenDDS::DCPS::move(), DCPS_IR_Subscription::set_bit_status(), and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

277 {
278  OpenDDS::DCPS::GUID_t subId = sub->get_id();
279  DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
280 
281  if (where == this->subscriptions_.end()) {
282 
283  DCPS_IR_Subscription* subptr = sub.get();
284  this->subscriptions_.insert(
285  where, DCPS_IR_Subscription_Map::value_type(subId, OpenDDS::DCPS::move(sub)));
286 
287  if (isBitPublisher_) {
289  }
290 
292  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
293  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
294  ACE_DEBUG((LM_DEBUG,
295  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_subscription: ")
296  ACE_TEXT("participant %C successfully added subscription %C at 0x%x.\n"),
297  std::string(part_converter).c_str(),
298  std::string(sub_converter).c_str(),
299  subptr));
300  }
301 
302  return 0;
303 
304  } else {
306  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
307  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
308  ACE_ERROR((LM_NOTICE,
309  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_subscription: ")
310  ACE_TEXT("participant %C attempted to add existing subscription %C.\n"),
311  std::string(part_converter).c_str(),
312  std::string(sub_converter).c_str()));
313  }
314 
315  return 1;
316  }
317 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
Representative of a Subscription.
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
DCPS_IR_Subscription_Map subscriptions_
OpenDDS::DCPS::GUID_t get_id()
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.
void set_bit_status(CORBA::Boolean isBIT)

◆ add_topic_reference()

int DCPS_IR_Participant::add_topic_reference ( DCPS_IR_Topic topic)

Add a topic Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 403 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Topic::get_id(), id_, isBitPublisher_, LM_DEBUG, LM_NOTICE, DCPS_IR_Topic::set_bit_status(), and topicRefs_.

Referenced by DCPS_IR_Domain::add_topic_i().

404 {
405  OpenDDS::DCPS::GUID_t topicId = topic->get_id();
406  DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
407 
408  if (where == this->topicRefs_.end()) {
409  this->topicRefs_.insert(
410  where, DCPS_IR_Topic_Map::value_type(topicId, topic));
411 
412  if (isBitPublisher_) {
414  }
415 
417  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
418  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
419  ACE_DEBUG((LM_DEBUG,
420  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_topic_reference: ")
421  ACE_TEXT("participant %C successfully added topic %C at 0x%x.\n"),
422  std::string(part_converter).c_str(),
423  std::string(topic_converter).c_str(),
424  topic));
425  }
426 
427  return 0;
428 
429  } else {
431  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
432  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
433  ACE_DEBUG((LM_NOTICE,
434  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_topic_reference: ")
435  ACE_TEXT("participant %C attempted to add existing topic %C.\n"),
436  std::string(part_converter).c_str(),
437  std::string(topic_converter).c_str()));
438  }
439 
440  return 1;
441  }
442 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
void set_bit_status(CORBA::Boolean isBIT)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DCPS_IR_Topic_Map topicRefs_
OpenDDS::DCPS::GUID_t get_id() const
OpenDDS::DCPS::GUID_t id_
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.

◆ changeOwner()

void DCPS_IR_Participant::changeOwner ( long  sender,
long  owner 
)

Process an incoming update that changes ownership.

: Ensure that any stalled callbacks are made.

Definition at line 104 of file DCPS_IR_Participant.cpp.

References ACE_GUARD, ACE_SYNCH_MUTEX, isOwner(), owner(), owner_, OWNER_NONE, and ownerLock_.

Referenced by TAO_DDS_DCPSInfo_i::changeOwnership(), and takeOwnership().

105 {
106  {
107  ACE_GUARD(ACE_SYNCH_MUTEX, guard, this->ownerLock_);
108 
109  if ((owner == OWNER_NONE)
110  && (this->isOwner() || (this->owner_ != sender))) {
111  // Do not eliminate ownership if we are the owner or if the update
112  // does not come from the current owner.
113  return;
114  }
115 
116  // Finally. Change the value.
117  this->owner_ = owner;
118 
119  } // End of lock scope.
120 
121  if (this->isOwner()) {
122  /// @TODO: Ensure that any stalled callbacks are made.
123  }
124 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_SYNCH_MUTEX ownerLock_
Lock portions ownership processing.
long owner() const
Value of the owner for this participant.
bool isOwner() const
Indication of whether the current repository is the owner of this participant.

◆ dump_to_string()

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

Definition at line 880 of file DCPS_IR_Participant.cpp.

References aliveStatus_, ACE_Unbounded_Set_Ex< T, C >::begin(), ACE_Unbounded_Set_Ex< T, C >::end(), federationId_, TAO_DDS_DCPSFederationId::id(), id_, ignoredParticipants_, ignoredPublications_, ignoredSubscriptions_, ignoredTopics_, isBitPublisher_, OPENDDS_END_VERSIONED_NAMESPACE_DECL, TAO_DDS_DCPSFederationId::overridden(), owner_, publications_, subscriptions_, and topicRefs_.

881 {
882  std::string str;
883 #if !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
884  OpenDDS::DCPS::RepoIdConverter local_converter(id_);
885 
886  for (int i=0; i < depth; i++)
887  str += prefix;
888  std::string indent = str + prefix;
889  str += "DCPS_IR_Participant[";
890  str += std::string(local_converter);
891  str += "]";
892  if (isBitPublisher_)
893  str += " (BIT)";
894  std::ostringstream os;
895  os << "federation id[" << federationId_.id();
897  os << "(federated)";
898 
899  os << "] owner[" << owner_ << "]";
900  str += os.str();
901  str += aliveStatus_ ? " (alive)" : " (not alive)";
902  str += "\n";
903 
904  str += indent + "Topics:\n";
905  for (DCPS_IR_Topic_Map::const_iterator tm = topicRefs_.begin();
906  tm != topicRefs_.end();
907  tm++)
908  {
909  str += tm->second->dump_to_string(prefix, depth+1);
910  }
911 
912  str += indent + "Publications:\n";
913  for (DCPS_IR_Publication_Map::const_iterator pm = publications_.begin();
914  pm != publications_.end();
915  pm++)
916  {
917  str += pm->second->dump_to_string(prefix, depth+1);
918  }
919 
920  str += indent + "Subscriptions:\n";
921  for (DCPS_IR_Subscription_Map::const_iterator sm = subscriptions_.begin();
922  sm != subscriptions_.end();
923  sm++)
924  {
925  str += sm->second->dump_to_string(prefix, depth+1);
926  }
927 
928  str += indent + "ignored Participants [ ";
930  ipart != ignoredParticipants_.end();
931  ipart++)
932  {
933  OpenDDS::DCPS::RepoIdConverter ipart_converter(*ipart);
934  str += std::string(ipart_converter);
935  str += " ";
936  }
937  str += "]\n";
938  str += indent + "ignored Topics [ ";
939 
941  itop != ignoredTopics_.end();
942  itop++)
943  {
944  OpenDDS::DCPS::RepoIdConverter itop_converter(*itop);
945  str += std::string(itop_converter);
946  str += " ";
947  }
948  str += "]\n";
949  str += indent + "ignored Publications [ ";
950 
952  ipub != ignoredPublications_.end();
953  ipub++)
954  {
955  OpenDDS::DCPS::RepoIdConverter ipub_converter(*ipub);
956  str += std::string(ipub_converter);
957  str += " ";
958  }
959  str += "]\n";
960  str += indent + "ignored Subscriptions [ ";
961 
963  isub != ignoredSubscriptions_.end();
964  isub++)
965  {
966  OpenDDS::DCPS::RepoIdConverter isub_converter(*isub);
967  str += std::string(isub_converter);
968  str += " ";
969  }
970  str += "]\n";
971 
972 #endif // !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
973  return str;
974 }
iterator end(void)
TAO_DDS_RepoId_Set ignoredSubscriptions_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
TAO_DDS_RepoId_Set ignoredPublications_
iterator begin(void)
const TAO_DDS_DCPSFederationId & federationId_
CORBA::Boolean aliveStatus_
DCPS_IR_Subscription_Map subscriptions_
DCPS_IR_Topic_Map topicRefs_
TAO_DDS_RepoId_Set ignoredTopics_
void id(RepoKey fedId)
OpenDDS::DCPS::GUID_t id_
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.
DCPS_IR_Publication_Map publications_
TAO_DDS_RepoId_Set ignoredParticipants_

◆ find_publication_reference()

int DCPS_IR_Participant::find_publication_reference ( OpenDDS::DCPS::GUID_t  pubId,
DCPS_IR_Publication *&  pub 
)

Return the publication object.

Definition at line 192 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::disassociate_publication(), and TAO_DDS_DCPSInfo_i::update_publication_qos().

194 {
195  DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
196 
197  if (where != this->publications_.end()) {
198  pub = where->second.get();
199 
201  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
202  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
203  ACE_DEBUG((LM_DEBUG,
204  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_publication_reference: ")
205  ACE_TEXT("participant %C found publication %C at 0x%x.\n"),
206  std::string(part_converter).c_str(),
207  std::string(pub_converter).c_str(),
208  pub));
209  }
210 
211  return 0;
212 
213  } else {
215  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
216  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
217  ACE_DEBUG((LM_DEBUG,
218  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_publication_reference: ")
219  ACE_TEXT("participant %C could not find publication %C.\n"),
220  std::string(part_converter).c_str(),
221  std::string(pub_converter).c_str()));
222  }
223  pub = 0;
224  return -1;
225  }
226 }
#define ACE_DEBUG(X)
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")
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_

◆ find_subscription_reference()

int DCPS_IR_Participant::find_subscription_reference ( OpenDDS::DCPS::GUID_t  subId,
DCPS_IR_Subscription *&  sub 
)

Return the subscription object.

Definition at line 319 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::disassociate_subscription(), TAO_DDS_DCPSInfo_i::update_subscription_params(), and TAO_DDS_DCPSInfo_i::update_subscription_qos().

321 {
322  DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
323 
324  if (where != this->subscriptions_.end()) {
325  sub = where->second.get();
326 
328  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
329  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
330  ACE_DEBUG((LM_DEBUG,
331  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_subscription_reference: ")
332  ACE_TEXT("participant %C found subscription %C at 0x%x.\n"),
333  std::string(part_converter).c_str(),
334  std::string(sub_converter).c_str(),
335  sub));
336  }
337 
338  return 0;
339 
340  } else {
342  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
343  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
344  ACE_DEBUG((LM_DEBUG,
345  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_subscription_reference: ")
346  ACE_TEXT("participant %C could not find subscription %C.\n"),
347  std::string(part_converter).c_str(),
348  std::string(sub_converter).c_str()));
349  }
350  sub = 0;
351  return -1;
352  }
353 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
DCPS_IR_Subscription_Map subscriptions_
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_

◆ find_topic_reference()

int DCPS_IR_Participant::find_topic_reference ( OpenDDS::DCPS::GUID_t  topicId,
DCPS_IR_Topic *&  topic 
)

Find topic reference with id Does NOT give ownership of memory Returns 0 if successful

Definition at line 481 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, LM_DEBUG, LM_ERROR, and topicRefs_.

Referenced by TAO_DDS_DCPSInfo_i::remove_topic(), and TAO_DDS_DCPSInfo_i::update_topic_qos().

483 {
484  DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
485 
486  if (where != this->topicRefs_.end()) {
487  topic = where->second;
488 
490  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
491  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
492  ACE_DEBUG((LM_DEBUG,
493  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_topic_reference: ")
494  ACE_TEXT("participant %C found topic %C at %x.\n"),
495  std::string(part_converter).c_str(),
496  std::string(topic_converter).c_str(),
497  topic));
498  }
499 
500  return 0;
501 
502  } else {
503  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
504  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
505  ACE_ERROR((LM_ERROR,
506  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::find_topic_reference: ")
507  ACE_TEXT("participant %C unable to find topic %C.\n"),
508  std::string(part_converter).c_str(),
509  std::string(topic_converter).c_str()));
510  topic = 0;
511  return -1;
512  }
513 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
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")
DCPS_IR_Topic_Map topicRefs_
OpenDDS::DCPS::GUID_t id_

◆ get_domain_reference()

DCPS_IR_Domain * DCPS_IR_Participant::get_domain_reference ( ) const

Definition at line 838 of file DCPS_IR_Participant.cpp.

References domain_.

Referenced by DCPS_IR_Publication::set_qos(), and DCPS_IR_Subscription::set_qos().

839 {
840  return domain_;
841 }
DCPS_IR_Domain * domain_

◆ get_handle()

DDS::InstanceHandle_t DCPS_IR_Participant::get_handle ( void  )

Definition at line 809 of file DCPS_IR_Participant.cpp.

References handle_.

Referenced by DCPS_IR_Domain::dispose_participant_bit().

810 {
811  return handle_;
812 }
DDS::InstanceHandle_t handle_

◆ get_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Participant::get_id ( void  )

◆ get_next_publication_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Participant::get_next_publication_id ( bool  builtin)

Next Entity Id value in sequence.

Definition at line 850 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

851 {
852  return this->publicationIdGenerator_.next(builtin);
853 }
GUID_t next(bool builtin=false)
Obtain the next GUID_t value.
OpenDDS::DCPS::RepoIdGenerator publicationIdGenerator_

◆ get_next_subscription_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Participant::get_next_subscription_id ( bool  builtin)

Next Entity Id value in sequence.

Definition at line 856 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

857 {
858  return this->subscriptionIdGenerator_.next(builtin);
859 }
GUID_t next(bool builtin=false)
Obtain the next GUID_t value.
OpenDDS::DCPS::RepoIdGenerator subscriptionIdGenerator_

◆ get_next_topic_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Participant::get_next_topic_id ( bool  builtin)

Next Entity Id value in sequence.

Definition at line 844 of file DCPS_IR_Participant.cpp.

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

Referenced by DCPS_IR_Domain::add_topic().

845 {
846  return this->topicIdGenerator_.next(builtin);
847 }
GUID_t next(bool builtin=false)
Obtain the next GUID_t value.
OpenDDS::DCPS::RepoIdGenerator topicIdGenerator_

◆ get_qos()

const DDS::DomainParticipantQos * DCPS_IR_Participant::get_qos ( void  )

Return pointer to the participant qos Participant retains ownership

Definition at line 819 of file DCPS_IR_Participant.cpp.

References qos_.

Referenced by DCPS_IR_Domain::publish_participant_bit().

820 {
821  return &qos_;
822 }
DDS::DomainParticipantQos qos_

◆ ignore_participant()

void DCPS_IR_Participant::ignore_participant ( OpenDDS::DCPS::GUID_t  id)

Ignore the participant with the id.

Definition at line 687 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, ignoredParticipants_, ACE_Unbounded_Set_Ex< T, C >::insert(), LM_DEBUG, publications_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_domain_participant().

688 {
690  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
691  OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
692  ACE_DEBUG((LM_DEBUG,
693  ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_participant: ")
694  ACE_TEXT("participant %C now ignoring participant %C.\n"),
695  std::string(part_converter).c_str(),
696  std::string(ignore_converter).c_str()));
697  }
698 
700 
701  // disassociate any publications
702  for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
703  current != this->publications_.end();
704  ++current) {
705  current->second->disassociate_participant(id);
706  }
707 
708  // disassociate any subscriptions
709  for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
710  current != this->subscriptions_.end();
711  ++current) {
712  current->second->disassociate_participant(id);
713  }
714 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
int insert(const T &new_item)
DCPS_IR_Subscription_Map subscriptions_
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_
TAO_DDS_RepoId_Set ignoredParticipants_

◆ ignore_publication()

void DCPS_IR_Participant::ignore_publication ( OpenDDS::DCPS::GUID_t  id)

Ignore the publication with the id.

Definition at line 745 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, ignoredPublications_, ACE_Unbounded_Set_Ex< T, C >::insert(), LM_DEBUG, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_publication().

746 {
748  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
749  OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
750  ACE_DEBUG((LM_DEBUG,
751  ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_publication: ")
752  ACE_TEXT("participant %C now ignoring publication %C.\n"),
753  std::string(part_converter).c_str(),
754  std::string(ignore_converter).c_str()));
755  }
756 
758 
759  // disassociate any subscriptions
760  for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
761  current != this->subscriptions_.end();
762  ++current) {
763  current->second->disassociate_publication(id);
764  }
765 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
TAO_DDS_RepoId_Set ignoredPublications_
int insert(const T &new_item)
DCPS_IR_Subscription_Map subscriptions_
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_

◆ ignore_subscription()

void DCPS_IR_Participant::ignore_subscription ( OpenDDS::DCPS::GUID_t  id)

Ignore the subscription with the id.

Definition at line 767 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, ignoredSubscriptions_, ACE_Unbounded_Set_Ex< T, C >::insert(), LM_DEBUG, and publications_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_subscription().

768 {
770  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
771  OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
772  ACE_DEBUG((LM_DEBUG,
773  ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_subscription: ")
774  ACE_TEXT("participant %C now ignoring subscription %C.\n"),
775  std::string(part_converter).c_str(),
776  std::string(ignore_converter).c_str()));
777  }
778 
780 
781  // disassociate any publications
782  for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
783  current != this->publications_.end();
784  ++current) {
785  current->second->disassociate_subscription(id);
786  }
787 }
#define ACE_DEBUG(X)
TAO_DDS_RepoId_Set ignoredSubscriptions_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
int insert(const T &new_item)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_

◆ ignore_topic()

void DCPS_IR_Participant::ignore_topic ( OpenDDS::DCPS::GUID_t  id)

Ignore the topic with the id.

Definition at line 716 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, ignoredTopics_, ACE_Unbounded_Set_Ex< T, C >::insert(), LM_DEBUG, publications_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_topic().

717 {
719  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
720  OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
721  ACE_DEBUG((LM_DEBUG,
722  ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_topic: ")
723  ACE_TEXT("participant %C now ignoring topic %C.\n"),
724  std::string(part_converter).c_str(),
725  std::string(ignore_converter).c_str()));
726  }
727 
729 
730  // disassociate any publications
731  for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
732  current != this->publications_.end();
733  ++current) {
734  current->second->disassociate_topic(id);
735  }
736 
737  // disassociate any subscriptions
738  for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
739  current != this->subscriptions_.end();
740  ++current) {
741  current->second->disassociate_topic(id);
742  }
743 }
#define ACE_DEBUG(X)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
int insert(const T &new_item)
DCPS_IR_Subscription_Map subscriptions_
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
TAO_DDS_RepoId_Set ignoredTopics_
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_

◆ is_alive()

CORBA::Boolean DCPS_IR_Participant::is_alive ( void  )

◆ is_participant_ignored()

CORBA::Boolean DCPS_IR_Participant::is_participant_ignored ( OpenDDS::DCPS::GUID_t  id)

Test if an entity is ignored by this participant.

Definition at line 789 of file DCPS_IR_Participant.cpp.

References ACE_Unbounded_Set_Ex< T, C >::find(), and ignoredParticipants_.

Referenced by DCPS_IR_Subscription::is_publication_ignored(), DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

790 {
791  return (0 == ignoredParticipants_.find(id));
792 }
int find(const T &item) const
TAO_DDS_RepoId_Set ignoredParticipants_

◆ is_publication_ignored()

CORBA::Boolean DCPS_IR_Participant::is_publication_ignored ( OpenDDS::DCPS::GUID_t  id)

Test if an entity is ignored by this participant.

Definition at line 799 of file DCPS_IR_Participant.cpp.

References ACE_Unbounded_Set_Ex< T, C >::find(), and ignoredPublications_.

Referenced by DCPS_IR_Subscription::is_publication_ignored().

800 {
801  return (0 == ignoredPublications_.find(id));
802 }
TAO_DDS_RepoId_Set ignoredPublications_
int find(const T &item) const

◆ is_subscription_ignored()

CORBA::Boolean DCPS_IR_Participant::is_subscription_ignored ( OpenDDS::DCPS::GUID_t  id)

Test if an entity is ignored by this participant.

Definition at line 804 of file DCPS_IR_Participant.cpp.

References ACE_Unbounded_Set_Ex< T, C >::find(), and ignoredSubscriptions_.

Referenced by DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

805 {
806  return (0 == ignoredSubscriptions_.find(id));
807 }
TAO_DDS_RepoId_Set ignoredSubscriptions_
int find(const T &item) const

◆ is_topic_ignored()

CORBA::Boolean DCPS_IR_Participant::is_topic_ignored ( OpenDDS::DCPS::GUID_t  id)

Test if an entity is ignored by this participant.

Definition at line 794 of file DCPS_IR_Participant.cpp.

References ACE_Unbounded_Set_Ex< T, C >::find(), and ignoredTopics_.

Referenced by DCPS_IR_Subscription::is_publication_ignored(), DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

795 {
796  return (0 == ignoredTopics_.find(id));
797 }
TAO_DDS_RepoId_Set ignoredTopics_
int find(const T &item) const

◆ isBitPublisher() [1/2]

bool & DCPS_IR_Participant::isBitPublisher ( )

◆ isBitPublisher() [2/2]

bool DCPS_IR_Participant::isBitPublisher ( ) const

Flag to discriminate the built-in topic publishing participant within a domain.

Definition at line 145 of file DCPS_IR_Participant.cpp.

References isBitPublisher_.

146 {
147  return this->isBitPublisher_;
148 }
bool isBitPublisher_
Flag indicating this participant publishes built-in topics.

◆ isOwner()

bool DCPS_IR_Participant::isOwner ( ) const

◆ last_publication_key()

void DCPS_IR_Participant::last_publication_key ( long  key)

Ensure no conflicts with sequence values from persistent storage.

Definition at line 868 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

869 {
870  return this->publicationIdGenerator_.last(key);
871 }
sequence< octet > key
OpenDDS::DCPS::RepoIdGenerator publicationIdGenerator_

◆ last_subscription_key()

void DCPS_IR_Participant::last_subscription_key ( long  key)

Ensure no conflicts with sequence values from persistent storage.

Definition at line 874 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

875 {
876  return this->subscriptionIdGenerator_.last(key);
877 }
sequence< octet > key
OpenDDS::DCPS::RepoIdGenerator subscriptionIdGenerator_

◆ last_topic_key()

void DCPS_IR_Participant::last_topic_key ( long  key)

Ensure no conflicts with sequence values from persistent storage.

Definition at line 862 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::add_topic().

863 {
864  return this->topicIdGenerator_.last(key);
865 }
sequence< octet > key
OpenDDS::DCPS::RepoIdGenerator topicIdGenerator_

◆ mark_dead()

void DCPS_IR_Participant::mark_dead ( )

◆ owner()

long DCPS_IR_Participant::owner ( void  ) const

Value of the owner for this participant.

Definition at line 127 of file DCPS_IR_Participant.cpp.

References owner_.

Referenced by changeOwner().

128 {
129  return this->owner_;
130 }

◆ publications()

const DCPS_IR_Publication_Map & DCPS_IR_Participant::publications ( void  ) const

Expose a readable reference to the publication map.

Definition at line 61 of file DCPS_IR_Participant.cpp.

References publications_.

Referenced by TAO_DDS_DCPSInfo_i::disassociate_participant(), and TAO_DDS_DCPSInfo_i::remove_by_owner().

62 {
63  return this->publications_;
64 }
DCPS_IR_Publication_Map publications_

◆ remove_all_dependents()

void DCPS_IR_Participant::remove_all_dependents ( CORBA::Boolean  notify_lost)

Removes all topics, publications and.

Definition at line 515 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), Update::Actor, Update::DataReader, Update::DataWriter, OpenDDS::DCPS::DCPS_debug_level, Update::Manager::destroy(), domain_, DCPS_IR_Domain::get_id(), get_id(), id_, isBitPublisher(), LM_DEBUG, publications_, DCPS_IR_Topic::release(), DCPS_IR_Topic::remove_publication_reference(), DCPS_IR_Topic::remove_subscription_reference(), DCPS_IR_Domain::remove_topic(), subscriptions_, Update::Topic, topicRefs_, and um_.

516 {
517  // remove all the publications associations
518  {
519  DCPS_IR_Publication_Map::const_iterator next = this->publications_.begin();
520 
521  while (next != this->publications_.end()) {
522  DCPS_IR_Publication_Map::const_iterator current = next;
523  ++ next;
524  DCPS_IR_Topic* topic = current->second->get_topic();
525  topic->remove_publication_reference(current->second.get());
526 
527  if (0 != current->second->remove_associations(notify_lost)) {
528  return;
529  }
530 
531  topic->release(false);
532  }
533  }
534 
535  {
536  DCPS_IR_Subscription_Map::const_iterator next = this->subscriptions_.begin();
537 
538  while (next != this->subscriptions_.end()) {
539  DCPS_IR_Subscription_Map::const_iterator current = next;
540  ++ next;
541  DCPS_IR_Topic* topic = current->second->get_topic();
542  topic->remove_subscription_reference(current->second.get());
543 
544  if (0 != current->second->remove_associations(notify_lost)) {
545  return;
546  }
547 
548  topic->release(false);
549  }
550  }
551 
552  {
553  DCPS_IR_Topic_Map::const_iterator next = this->topicRefs_.begin();
554 
555  while (next != this->topicRefs_.end()) {
556  DCPS_IR_Topic_Map::const_iterator current = next;
557  ++ next;
558 
559  // Notify the federation to remove the topic.
560  if (this->um_ && (this->isBitPublisher() == false)) {
561  Update::IdPath path(
562  this->domain_->get_id(),
563  this->get_id(),
564  current->second->get_id());
565  this->um_->destroy(path, Update::Topic);
566 
568  OpenDDS::DCPS::GUID_t id = current->second->get_id();
569  OpenDDS::DCPS::RepoIdConverter converter(id);
570  ACE_DEBUG((LM_DEBUG,
571  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
572  ACE_TEXT("pushing deletion of topic %C in domain %d.\n"),
573  std::string(converter).c_str(),
574  this->domain_->get_id()));
575  }
576 
577  // Remove the topic ourselves.
578  // N.B. This call sets the second (reference) argument to 0, so when
579  // clear() is called below, no destructor is (re)called.
580 
581  // Get the topic id and topic point before remove_topic since it
582  // invalidates the iterator. Accessing after removal got SEGV.
583  OpenDDS::DCPS::GUID_t id = current->first;
584  DCPS_IR_Topic* topic = current->second;
585 
586  this->domain_->remove_topic(this, topic);
587 
589  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
590  OpenDDS::DCPS::RepoIdConverter topic_converter(id);
591  ACE_DEBUG((LM_DEBUG,
592  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
593  ACE_TEXT("domain %d participant %C removed topic %C.\n"),
594  this->domain_->get_id(),
595  std::string(part_converter).c_str(),
596  std::string(topic_converter).c_str()));
597  }
598  }
599  }
600  }
601 
602  // Clear the Topic container of null pointers.
603  this->topicRefs_.clear();
604 
605  // The publications and subscriptions can NOT be deleted until after all
606  // the associations have been removed. Otherwise an access violation
607  // can occur because a publication and subscription of this participant
608  // could be associated.
609 
610  // delete all the publications
611  for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
612  current != this->publications_.end();
613  ++current) {
614  // Notify the federation to destroy the publication.
615  if (this->um_ && (this->isBitPublisher() == false)) {
616  Update::IdPath path(
617  this->domain_->get_id(),
618  this->get_id(),
619  current->second->get_id());
621 
623  OpenDDS::DCPS::GUID_t id = current->second->get_id();
624  OpenDDS::DCPS::RepoIdConverter converter(id);
625  ACE_DEBUG((LM_DEBUG,
626  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
627  ACE_TEXT("pushing deletion of publication %C in domain %d.\n"),
628  std::string(converter).c_str(),
629  this->domain_->get_id()));
630  }
631  }
632  }
633 
634  // Clear the container.
635  this->publications_.clear();
636 
637  // delete all the subscriptions
638  for (DCPS_IR_Subscription_Map::const_iterator current
639  = this->subscriptions_.begin();
640  current != this->subscriptions_.end();
641  ++current) {
642  // Notify the federation to destroy the subscription.
643  if (this->um_ && (this->isBitPublisher() == false)) {
644  Update::IdPath path(
645  this->domain_->get_id(),
646  this->get_id(),
647  current->second->get_id());
649 
651  OpenDDS::DCPS::GUID_t id = current->second->get_id();
652  OpenDDS::DCPS::RepoIdConverter converter(id);
653  ACE_DEBUG((LM_DEBUG,
654  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
655  ACE_TEXT("pushing deletion of subscription %C in domain %d.\n"),
656  std::string(converter).c_str(),
657  this->domain_->get_id()));
658  }
659  }
660  }
661 
662  // Clear the container.
663  this->subscriptions_.clear();
664 }
#define ACE_DEBUG(X)
void destroy(const IdPath &id, ItemType type, ActorType actor=DataWriter)
int remove_subscription_reference(DCPS_IR_Subscription *subscription)
void release(bool removing)
DCPS_IR_Domain * domain_
OpenDDS::DCPS::GUID_t get_id()
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
OpenDDS::DCPS::TopicStatus remove_topic(DCPS_IR_Participant *part, DCPS_IR_Topic *&topic)
DCPS_IR_Subscription_Map subscriptions_
int remove_publication_reference(DCPS_IR_Publication *publication)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
Update::Manager * um_
DCPS_IR_Topic_Map topicRefs_
DDS::DomainId_t get_id()
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_

◆ remove_publication()

int DCPS_IR_Participant::remove_publication ( OpenDDS::DCPS::GUID_t  pubId)

Removes the publication with the id Deletes the publication object if returns successful Returns 0 if successful

Definition at line 228 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Domain::dispose_publication_bit(), domain_, id_, LM_DEBUG, LM_ERROR, publications_, DCPS_IR_Topic::release(), and DCPS_IR_Topic::remove_publication_reference().

Referenced by TAO_DDS_DCPSInfo_i::add_publication(), TAO_DDS_DCPSInfo_i::remove_by_owner(), and TAO_DDS_DCPSInfo_i::remove_publication().

229 {
230  DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
231 
232  if (where != this->publications_.end()) {
233  DCPS_IR_Topic* topic = where->second->get_topic();
234  topic->remove_publication_reference(where->second.get());
235 
236  if (0 != where->second->remove_associations(false)) {
237  // N.B. As written today, this branch will never be taken.
238  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
239  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
240  ACE_ERROR((LM_ERROR,
241  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_publication: ")
242  ACE_TEXT("participant %C unable to remove associations from publication %C\n"),
243  std::string(part_converter).c_str(),
244  std::string(pub_converter).c_str()));
245  return -1;
246  }
247 
248  this->domain_->dispose_publication_bit(where->second.get());
249  topic->release(false);
250  this->publications_.erase(where);
251 
253  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
254  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
255  ACE_DEBUG((LM_DEBUG,
256  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_publication: ")
257  ACE_TEXT("participant %C removed publication %C.\n"),
258  std::string(part_converter).c_str(),
259  std::string(pub_converter).c_str()));
260  }
261 
262  return 0;
263 
264  } else {
265  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
266  OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
267  ACE_ERROR((LM_ERROR,
268  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_publication: ")
269  ACE_TEXT("participant %C unable to remove publication %C.\n"),
270  std::string(part_converter).c_str(),
271  std::string(pub_converter).c_str()));
272  return -1;
273  }
274 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
void release(bool removing)
DCPS_IR_Domain * domain_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
void dispose_publication_bit(DCPS_IR_Publication *publication)
Dispose Publication in the Publication Built-In Topic.
int remove_publication_reference(DCPS_IR_Publication *publication)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Publication_Map publications_

◆ remove_subscription()

int DCPS_IR_Participant::remove_subscription ( OpenDDS::DCPS::GUID_t  subId)

Removes the subscription with the id Deletes the subscription object if returns successful Returns 0 if successful

Definition at line 355 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Domain::dispose_subscription_bit(), domain_, id_, LM_DEBUG, LM_ERROR, DCPS_IR_Topic::release(), DCPS_IR_Topic::remove_subscription_reference(), and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription(), TAO_DDS_DCPSInfo_i::remove_by_owner(), and TAO_DDS_DCPSInfo_i::remove_subscription().

356 {
357  DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
358 
359  if (where != this->subscriptions_.end()) {
360  DCPS_IR_Topic* topic = where->second->get_topic();
361  topic->remove_subscription_reference(where->second.get());
362 
363  if (0 != where->second->remove_associations(false)) {
364  // N.B. As written today, this branch will never be taken.
365  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
366  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
367  ACE_ERROR((LM_ERROR,
368  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
369  ACE_TEXT("participant %C unable to remove associations from subscription %C\n"),
370  std::string(part_converter).c_str(),
371  std::string(sub_converter).c_str()));
372  return -1;
373  }
374 
375  this->domain_->dispose_subscription_bit(where->second.get());
376  topic->release(false);
377  this->subscriptions_.erase(where);
378 
380  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
381  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
382  ACE_DEBUG((LM_DEBUG,
383  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_subscription: ")
384  ACE_TEXT("participant %C removed subscription %C.\n"),
385  std::string(part_converter).c_str(),
386  std::string(sub_converter).c_str()));
387  }
388 
389  return 0;
390 
391  } else {
392  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
393  OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
394  ACE_ERROR((LM_ERROR,
395  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
396  ACE_TEXT("participant %C unable to remove subscription %C.\n"),
397  std::string(part_converter).c_str(),
398  std::string(sub_converter).c_str()));
399  return -1;
400  }
401 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
int remove_subscription_reference(DCPS_IR_Subscription *subscription)
void release(bool removing)
DCPS_IR_Domain * domain_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
Representative of a Topic.
Definition: DCPS_IR_Topic.h:43
void dispose_subscription_bit(DCPS_IR_Subscription *subscription)
Dispose Subscription in the Subscription Built-In Topic.
DCPS_IR_Subscription_Map subscriptions_
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t id_

◆ remove_topic_reference()

int DCPS_IR_Participant::remove_topic_reference ( OpenDDS::DCPS::GUID_t  topicId,
DCPS_IR_Topic *&  topic 
)

Remove a topic reference Does not change or take ownership of topic Returns 0 if successful

Definition at line 444 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, id_, LM_DEBUG, LM_WARNING, and topicRefs_.

Referenced by TAO_DDS_DCPSInfo_i::remove_by_owner(), and DCPS_IR_Domain::remove_topic().

446 {
447  DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
448 
449  if (where != this->topicRefs_.end()) {
450  topic = where->second;
451  this->topicRefs_.erase(where);
452 
454  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
455  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
456  ACE_DEBUG((LM_DEBUG,
457  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_topic_reference: ")
458  ACE_TEXT("participant %C removed topic %C at 0x%x.\n"),
459  std::string(part_converter).c_str(),
460  std::string(topic_converter).c_str(),
461  topic));
462  }
463 
464  return 0;
465 
466  } else {
468  OpenDDS::DCPS::RepoIdConverter part_converter(id_);
469  OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
470  ACE_ERROR((LM_WARNING,
471  ACE_TEXT("(%P|%t) WARNING: DCPS_IR_Participant::remove_topic_reference: ")
472  ACE_TEXT("participant %C unable to find topic %C for removal.\n"),
473  std::string(part_converter).c_str(),
474  std::string(topic_converter).c_str()));
475  }
476 
477  return -1;
478  }
479 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
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")
DCPS_IR_Topic_Map topicRefs_
OpenDDS::DCPS::GUID_t id_

◆ set_alive()

void DCPS_IR_Participant::set_alive ( CORBA::Boolean  alive)

Definition at line 682 of file DCPS_IR_Participant.cpp.

References aliveStatus_.

683 {
684  aliveStatus_ = alive;
685 }
CORBA::Boolean aliveStatus_

◆ set_handle()

void DCPS_IR_Participant::set_handle ( DDS::InstanceHandle_t  handle)

Definition at line 814 of file DCPS_IR_Participant.cpp.

References handle_.

Referenced by DCPS_IR_Domain::publish_participant_bit().

815 {
816  handle_ = handle;
817 }
DDS::InstanceHandle_t handle_

◆ set_qos()

bool DCPS_IR_Participant::set_qos ( const DDS::DomainParticipantQos qos)

Update qos and also propagate the qos change to related BITs that has the qos copy. Return false if the provided QoS makes the DataWriter and DataReader QoS incompatible. Currently supported changeable QoS in DomainParticipantQos do not affect.

Definition at line 824 of file DCPS_IR_Participant.cpp.

References domain_, DCPS_IR_Domain::publish_participant_bit(), and qos_.

Referenced by TAO_DDS_DCPSInfo_i::update_domain_participant_qos().

825 {
826  // Do not need re-evaluate compatibility and associations when
827  // DomainParticipantQos changes since only datareader and datawriter
828  // QoS are evaludated during normal associations establishment.
829 
830  // Do not need publish the QoS change to topics or datareader or
831  // datawriter BIT as they are independent.
832  qos_ = qos;
833  this->domain_->publish_participant_bit(this);
834 
835  return true;
836 }
DCPS_IR_Domain * domain_
DDS::DomainParticipantQos qos_
void publish_participant_bit(DCPS_IR_Participant *participant)
Publish Participant in the Participant Built-In Topic.

◆ subscriptions()

const DCPS_IR_Subscription_Map & DCPS_IR_Participant::subscriptions ( void  ) const

Expose a readable reference to the subscription map.

Definition at line 67 of file DCPS_IR_Participant.cpp.

References subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::disassociate_participant(), and TAO_DDS_DCPSInfo_i::remove_by_owner().

68 {
69  return this->subscriptions_;
70 }
DCPS_IR_Subscription_Map subscriptions_

◆ takeOwnership()

void DCPS_IR_Participant::takeOwnership ( )

Take local ownership of this participant and publish an update.

Publish an update with our ownership.

Definition at line 79 of file DCPS_IR_Participant.cpp.

References ACE_DEBUG, ACE_TEXT(), changeOwner(), Update::Manager::create(), OpenDDS::DCPS::DCPS_debug_level, domain_, federationId_, DCPS_IR_Domain::get_id(), TAO_DDS_DCPSFederationId::id(), id_, isBitPublisher(), LM_DEBUG, and um_.

Referenced by TAO_DDS_DCPSInfo_i::attach_participant().

80 {
81  /// Publish an update with our ownership.
82  if (this->um_ && (this->isBitPublisher() == false)) {
83  this->um_->create(
85  this->domain_->get_id(),
86  this->id_,
87  this->federationId_.id()));
88 
91  ACE_DEBUG((LM_DEBUG,
92  ACE_TEXT("(%P|%t) DCPS_IR_Participant::take_ownership: ")
93  ACE_TEXT("pushing ownership %C in domain %d.\n"),
94  std::string(converter).c_str(),
95  this->domain_->get_id()));
96  }
97  }
98 
99  // And now handle our internal ownership processing.
100  this->changeOwner(this->federationId_.id(), this->federationId_.id());
101 }
#define ACE_DEBUG(X)
DCPS_IR_Domain * domain_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
const TAO_DDS_DCPSFederationId & federationId_
void create(const UType &info)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
Update::Manager * um_
DDS::DomainId_t get_id()
void id(RepoKey fedId)
OpenDDS::DCPS::GUID_t id_
void changeOwner(long sender, long owner)
Process an incoming update that changes ownership.

◆ topics()

const DCPS_IR_Topic_Map & DCPS_IR_Participant::topics ( ) const

Expose a readable reference to the topic map.

Definition at line 73 of file DCPS_IR_Participant.cpp.

References topicRefs_.

Referenced by TAO_DDS_DCPSInfo_i::remove_by_owner().

74 {
75  return this->topicRefs_;
76 }
DCPS_IR_Topic_Map topicRefs_

Member Data Documentation

◆ aliveStatus_

CORBA::Boolean DCPS_IR_Participant::aliveStatus_
private

Definition at line 218 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), is_alive(), mark_dead(), and set_alive().

◆ domain_

DCPS_IR_Domain* DCPS_IR_Participant::domain_
private

◆ federationId_

const TAO_DDS_DCPSFederationId& DCPS_IR_Participant::federationId_
private

Definition at line 221 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), isOwner(), and takeOwnership().

◆ handle_

DDS::InstanceHandle_t DCPS_IR_Participant::handle_
private

Definition at line 219 of file DCPS_IR_Participant.h.

Referenced by get_handle(), and set_handle().

◆ id_

OpenDDS::DCPS::GUID_t DCPS_IR_Participant::id_
private

◆ ignoredParticipants_

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredParticipants_
private

Lists of Ignored Entities

Definition at line 243 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_participant(), and is_participant_ignored().

◆ ignoredPublications_

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredPublications_
private

Lists of Ignored Entities

Definition at line 245 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_publication(), and is_publication_ignored().

◆ ignoredSubscriptions_

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredSubscriptions_
private

Lists of Ignored Entities

Definition at line 246 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_subscription(), and is_subscription_ignored().

◆ ignoredTopics_

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredTopics_
private

Lists of Ignored Entities

Definition at line 244 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_topic(), and is_topic_ignored().

◆ isBitPublisher_

bool DCPS_IR_Participant::isBitPublisher_
private

Flag indicating this participant publishes built-in topics.

Definition at line 259 of file DCPS_IR_Participant.h.

Referenced by add_publication(), add_subscription(), add_topic_reference(), dump_to_string(), and isBitPublisher().

◆ owner_

long DCPS_IR_Participant::owner_
private

Definition at line 222 of file DCPS_IR_Participant.h.

Referenced by changeOwner(), dump_to_string(), isOwner(), and owner().

◆ ownerLock_

ACE_SYNCH_MUTEX DCPS_IR_Participant::ownerLock_
private

Lock portions ownership processing.

Definition at line 225 of file DCPS_IR_Participant.h.

Referenced by changeOwner().

◆ publicationIdGenerator_

OpenDDS::DCPS::RepoIdGenerator DCPS_IR_Participant::publicationIdGenerator_
private

Entity GUID Id generators.

Definition at line 230 of file DCPS_IR_Participant.h.

Referenced by get_next_publication_id(), and last_publication_key().

◆ publications_

DCPS_IR_Publication_Map DCPS_IR_Participant::publications_
private

◆ qos_

DDS::DomainParticipantQos DCPS_IR_Participant::qos_
private

Definition at line 217 of file DCPS_IR_Participant.h.

Referenced by get_qos(), and set_qos().

◆ subscriptionIdGenerator_

OpenDDS::DCPS::RepoIdGenerator DCPS_IR_Participant::subscriptionIdGenerator_
private

Entity GUID Id generators.

Definition at line 231 of file DCPS_IR_Participant.h.

Referenced by get_next_subscription_id(), and last_subscription_key().

◆ subscriptions_

DCPS_IR_Subscription_Map DCPS_IR_Participant::subscriptions_
private

◆ topicIdGenerator_

OpenDDS::DCPS::RepoIdGenerator DCPS_IR_Participant::topicIdGenerator_
private

Entity GUID Id generators.

Definition at line 229 of file DCPS_IR_Participant.h.

Referenced by get_next_topic_id(), and last_topic_key().

◆ topicRefs_

DCPS_IR_Topic_Map DCPS_IR_Participant::topicRefs_
private

◆ um_

Update::Manager* DCPS_IR_Participant::um_
private

The participant is the only entity that has and deals with dependencies (topics, actors). In handling dependencies it encompasses a bigger role. Therefore it needs to update other entities (specifically the Update::Manager) the changes it makes.

Definition at line 256 of file DCPS_IR_Participant.h.

Referenced by remove_all_dependents(), and takeOwnership().


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