OpenDDS  Snapshot(2023/03/10-19:29)
Public Member Functions | Private Attributes | List of all members
DCPS_IR_Topic Class Reference

Representative of a Topic. More...

#include <DCPS_IR_Topic.h>

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

Public Member Functions

 DCPS_IR_Topic (const OpenDDS::DCPS::GUID_t &id, const DDS::TopicQos &qos, DCPS_IR_Domain *domain, DCPS_IR_Participant *creator, DCPS_IR_Topic_Description *description, bool isBIT)
 
 ~DCPS_IR_Topic ()
 
void release (bool removing)
 
int add_publication_reference (DCPS_IR_Publication *publication, bool associate=true)
 
int remove_publication_reference (DCPS_IR_Publication *publication)
 
int add_subscription_reference (DCPS_IR_Subscription *subscription, bool associate=true)
 
int remove_subscription_reference (DCPS_IR_Subscription *subscription)
 
void try_associate (DCPS_IR_Subscription *subscription)
 
void reevaluate_associations (DCPS_IR_Subscription *subscription)
 
OpenDDS::DCPS::GUID_t get_id () const
 
OpenDDS::DCPS::GUID_t get_participant_id () const
 
DCPS_IR_Topic_Descriptionget_topic_description ()
 
DDS::TopicQosget_topic_qos ()
 
bool set_topic_qos (const DDS::TopicQos &qos)
 
DDS::InstanceHandle_t get_handle ()
 
void set_handle (DDS::InstanceHandle_t handle)
 
CORBA::Boolean is_bit ()
 
void set_bit_status (CORBA::Boolean isBIT)
 
void reassociate_all_publications ()
 
std::string dump_to_string (const std::string &prefix, int depth) const
 

Private Attributes

OpenDDS::DCPS::GUID_t id_
 
DDS::TopicQos qos_
 
DCPS_IR_Domaindomain_
 
DCPS_IR_Participantparticipant_
 
DCPS_IR_Topic_Descriptiondescription_
 
DDS::InstanceHandle_t handle_
 
CORBA::Boolean isBIT_
 
DCPS_IR_Publication_Set publicationRefs_
 
DCPS_IR_Subscription_Set subscriptionRefs_
 
bool removed_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenDDS::DCPS::EnableContainerSupportedUniquePtr< DCPS_IR_Topic >
 EnableContainerSupportedUniquePtr ()
 
void _add_ref ()
 
void _remove_ref ()
 
long ref_count () const
 

Detailed Description

Representative of a Topic.

Definition at line 43 of file DCPS_IR_Topic.h.

Constructor & Destructor Documentation

◆ DCPS_IR_Topic()

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL DCPS_IR_Topic::DCPS_IR_Topic ( const OpenDDS::DCPS::GUID_t id,
const DDS::TopicQos qos,
DCPS_IR_Domain domain,
DCPS_IR_Participant creator,
DCPS_IR_Topic_Description description,
bool  isBIT 
)

Definition at line 25 of file DCPS_IR_Topic.cpp.

31  : id_(id),
32  qos_(qos),
33  domain_(domain),
34  participant_(creator),
35  description_(description),
36  handle_(0),
37  isBIT_(isBIT),
38  removed_(false)
39 {
40 }
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Participant * participant_
DDS::InstanceHandle_t handle_
DDS::TopicQos qos_
CORBA::Boolean isBIT_
DCPS_IR_Topic_Description * description_
DCPS_IR_Domain * domain_

◆ ~DCPS_IR_Topic()

DCPS_IR_Topic::~DCPS_IR_Topic ( )

Definition at line 42 of file DCPS_IR_Topic.cpp.

43 {
44 }

Member Function Documentation

◆ add_publication_reference()

int DCPS_IR_Topic::add_publication_reference ( DCPS_IR_Publication publication,
bool  associate = true 
)

Adds the publication to the list of publications Calls the topic description's try associate if successfully added 'associate' switch toggles association attempt. Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 57 of file DCPS_IR_Topic.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, description_, domain_, DCPS_IR_Publication::get_id(), id_, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::insert(), LM_DEBUG, LM_ERROR, LM_WARNING, publicationRefs_, DCPS_IR_Domain::publish_publication_bit(), and DCPS_IR_Topic_Description::try_associate_publication().

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

59 {
60  int status = publicationRefs_.insert(publication);
61 
62  switch (status) {
63  case 0:
64 
65  // Publish the BIT information
66  domain_->publish_publication_bit(publication);
67 
68  if (associate) {
70  // Do not check incompatible qos here. The check is done
71  // in the DCPS_IR_Topic_Description::try_associate_publication method
72  }
73 
75  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
76  OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
77  ACE_DEBUG((LM_DEBUG,
78  ACE_TEXT("(%P|%t) DCPS_IR_Topic::add_publication_reference: ")
79  ACE_TEXT("topic %C added publication %C at %x\n"),
80  std::string(topic_converter).c_str(),
81  std::string(pub_converter).c_str(),
82  publication));
83  }
84 
85  break;
86 
87  case 1:
88 
90  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
91  OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
92  ACE_DEBUG((LM_WARNING,
93  ACE_TEXT("(%P|%t) WARNING: DCPS_IR_Topic::add_publication_reference: ")
94  ACE_TEXT("topic %C attempt to re-add publication %C.\n"),
95  std::string(topic_converter).c_str(),
96  std::string(pub_converter).c_str()));
97  }
98 
99  break;
100 
101  case -1: {
102  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
103  OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
104  ACE_ERROR((LM_ERROR,
105  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Topic::add_publication_reference: ")
106  ACE_TEXT("topic %C failed to add publication %C\n"),
107  std::string(topic_converter).c_str(),
108  std::string(pub_converter).c_str()));
109  }
110  };
111 
112  return status;
113 }
#define ACE_DEBUG(X)
OpenDDS::DCPS::GUID_t id_
#define ACE_ERROR(X)
void try_associate_publication(DCPS_IR_Publication *publication)
OpenDDS::DCPS::GUID_t get_id()
DCPS_IR_Topic_Description * description_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DCPS_IR_Domain * domain_
void publish_publication_bit(DCPS_IR_Publication *publication)
Publish Publication in the Publication Built-In Topic.
DCPS_IR_Publication_Set publicationRefs_

◆ add_subscription_reference()

int DCPS_IR_Topic::add_subscription_reference ( DCPS_IR_Subscription subscription,
bool  associate = true 
)

Adds the subscription to the list of subscriptions and let description handle the association. Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 143 of file DCPS_IR_Topic.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), DCPS_IR_Topic_Description::add_subscription_reference(), OpenDDS::DCPS::DCPS_debug_level, description_, DCPS_IR_Subscription::get_id(), id_, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::insert(), LM_DEBUG, LM_ERROR, and subscriptionRefs_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

145 {
146  int status = subscriptionRefs_.insert(subscription);
147 
148  switch (status) {
149  case 0:
150 
152  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
153  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
154  ACE_DEBUG((LM_DEBUG,
155  ACE_TEXT("(%P|%t) DCPS_IR_Topic::add_subscription_reference: ")
156  ACE_TEXT("topic %C added subscription %C at %x.\n"),
157  std::string(topic_converter).c_str(),
158  std::string(sub_converter).c_str(),
159  subscription));
160  }
161 
162  status = this->description_->add_subscription_reference(subscription, associate);
163  break;
164 
165  case 1: {
166  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
167  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
168  ACE_ERROR((LM_ERROR,
169  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Topic::add_subscription_reference: ")
170  ACE_TEXT("topic %C attempt to re-add subscription %C.\n"),
171  std::string(topic_converter).c_str(),
172  std::string(sub_converter).c_str()));
173  }
174  break;
175 
176  case -1: {
177  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
178  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
179  ACE_ERROR((LM_ERROR,
180  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Topic::add_subscription_reference: ")
181  ACE_TEXT("topic %C failed to add subscription %C.\n"),
182  std::string(topic_converter).c_str(),
183  std::string(sub_converter).c_str()));
184  }
185  };
186 
187  return status;
188 }
#define ACE_DEBUG(X)
OpenDDS::DCPS::GUID_t id_
#define ACE_ERROR(X)
int add_subscription_reference(DCPS_IR_Subscription *subscription, bool associate=true)
DCPS_IR_Topic_Description * description_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
OpenDDS::DCPS::GUID_t get_id()
DCPS_IR_Subscription_Set subscriptionRefs_

◆ dump_to_string()

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

Definition at line 375 of file DCPS_IR_Topic.cpp.

References ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::begin(), ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::end(), id_, isBIT_, OPENDDS_END_VERSIONED_NAMESPACE_DECL, publicationRefs_, and subscriptionRefs_.

376 {
377  std::string str;
378 #if !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
379  OpenDDS::DCPS::RepoIdConverter local_converter(id_);
380 
381  for (int i=0; i < depth; i++)
382  str += prefix;
383  std::string indent = str + prefix;
384  str += "DCPS_IR_Topic[";
385  str += std::string(local_converter);
386  str += "]";
387  if (isBIT_)
388  str += " (BIT)";
389  str += "\n";
390 
391  str += indent + "Publications:\n";
393  pub != publicationRefs_.end();
394  pub++)
395  {
396  OpenDDS::DCPS::RepoIdConverter pub_converter((*pub)->get_id());
397  str += indent + std::string(pub_converter);
398  str += "\n";
399 
400  }
401 
402  str += indent + "Subscriptions:\n";
404  sub != subscriptionRefs_.end();
405  sub++)
406  {
407  OpenDDS::DCPS::RepoIdConverter sub_converter((*sub)->get_id());
408  str += indent + std::string(sub_converter);
409  str += "\n";
410  }
411 #endif // !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
412  return str;
413 }
OpenDDS::DCPS::GUID_t id_
CORBA::Boolean isBIT_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
DCPS_IR_Publication_Set publicationRefs_
DCPS_IR_Subscription_Set subscriptionRefs_

◆ get_handle()

DDS::InstanceHandle_t DCPS_IR_Topic::get_handle ( void  )

Definition at line 327 of file DCPS_IR_Topic.cpp.

References handle_.

Referenced by DCPS_IR_Domain::dispose_topic_bit().

328 {
329  return handle_;
330 }
DDS::InstanceHandle_t handle_

◆ get_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Topic::get_id ( void  ) const

◆ get_participant_id()

OpenDDS::DCPS::GUID_t DCPS_IR_Topic::get_participant_id ( ) const

Definition at line 225 of file DCPS_IR_Topic.cpp.

References DCPS_IR_Participant::get_id(), and participant_.

226 {
227  return participant_->get_id();
228 }
DCPS_IR_Participant * participant_
OpenDDS::DCPS::GUID_t get_id()

◆ get_topic_description()

DCPS_IR_Topic_Description * DCPS_IR_Topic::get_topic_description ( )

◆ get_topic_qos()

DDS::TopicQos * DCPS_IR_Topic::get_topic_qos ( )

Return pointer to the Topic qos Topic retains ownership

Definition at line 230 of file DCPS_IR_Topic.cpp.

References qos_.

Referenced by TAO_DDS_DCPSInfo_i::find_topic(), DCPS_IR_Domain::publish_publication_bit(), DCPS_IR_Domain::publish_subscription_bit(), and DCPS_IR_Domain::publish_topic_bit().

231 {
232  return &qos_;
233 }
DDS::TopicQos qos_

◆ is_bit()

CORBA::Boolean DCPS_IR_Topic::is_bit ( )

Definition at line 337 of file DCPS_IR_Topic.cpp.

References isBIT_.

Referenced by DCPS_IR_Domain::dispose_topic_bit().

338 {
339  return isBIT_;
340 }
CORBA::Boolean isBIT_

◆ reassociate_all_publications()

void DCPS_IR_Topic::reassociate_all_publications ( )

◆ reevaluate_associations()

void DCPS_IR_Topic::reevaluate_associations ( DCPS_IR_Subscription subscription)

Called by the DCPS_IR_Topic_Description to re-evaluate the association between the publications of this topic and the provided subscription.

Definition at line 347 of file DCPS_IR_Topic.cpp.

References ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::begin(), ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::end(), publicationRefs_, DCPS_IR_Subscription::reevaluate_association(), and DCPS_IR_Publication::reevaluate_association().

Referenced by DCPS_IR_Topic_Description::reevaluate_associations().

348 {
349  DCPS_IR_Publication * pub = 0;
352 
353  while (iter != end) {
354  pub = *iter;
355  ++iter;
356 
357  subscription->reevaluate_association(pub);
358  pub->reevaluate_association(subscription);
359  }
360 }
Representative of a Publication.
bool reevaluate_association(DCPS_IR_Subscription *subscription)
DCPS_IR_Publication_Set publicationRefs_
bool reevaluate_association(DCPS_IR_Publication *publication)

◆ release()

void DCPS_IR_Topic::release ( bool  removing)

Delete the topic object upon last topic associated sub/pub and topic object deletion. It's kind of reference counting. The removing true indicates it's called upon delete_topic, otherwise it's upon remove_publication/remove_subscription.

Definition at line 46 of file DCPS_IR_Topic.cpp.

References domain_, id_, publicationRefs_, DCPS_IR_Domain::remove_topic_id_mapping(), removed_, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::size(), and subscriptionRefs_.

Referenced by DCPS_IR_Participant::remove_all_dependents(), DCPS_IR_Participant::remove_publication(), DCPS_IR_Participant::remove_subscription(), and DCPS_IR_Domain::remove_topic().

47 {
48  if (removing || this->removed_) {
49  this->removed_ = true;
50 
51  if (publicationRefs_.size() == 0 && subscriptionRefs_.size() == 0) {
52  this->domain_->remove_topic_id_mapping(this->id_);
53  }
54  }
55 }
OpenDDS::DCPS::GUID_t id_
void remove_topic_id_mapping(const OpenDDS::DCPS::GUID_t &topicId)
DCPS_IR_Domain * domain_
DCPS_IR_Publication_Set publicationRefs_
DCPS_IR_Subscription_Set subscriptionRefs_

◆ remove_publication_reference()

int DCPS_IR_Topic::remove_publication_reference ( DCPS_IR_Publication publication)

Removes the publication from the list of publications Returns 0 if successful

Definition at line 115 of file DCPS_IR_Topic.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Publication::get_id(), id_, LM_DEBUG, LM_ERROR, publicationRefs_, and ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::remove().

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

116 {
117  int status = publicationRefs_.remove(publication);
118 
119  if (0 == status) {
121  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
122  OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
123  ACE_DEBUG((LM_DEBUG,
124  ACE_TEXT("(%P|%t) DCPS_IR_Topic::remove_publication_reference: ")
125  ACE_TEXT("topic %C removed publication %C.\n"),
126  std::string(topic_converter).c_str(),
127  std::string(pub_converter).c_str()));
128  }
129 
130  } else {
131  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
132  OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
133  ACE_ERROR((LM_ERROR,
134  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Topic::remove_publication_reference: ")
135  ACE_TEXT("topic %C failed to remove publication %C.\n"),
136  std::string(topic_converter).c_str(),
137  std::string(pub_converter).c_str()));
138  }
139 
140  return status;
141 }
#define ACE_DEBUG(X)
OpenDDS::DCPS::GUID_t id_
#define ACE_ERROR(X)
OpenDDS::DCPS::GUID_t get_id()
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DCPS_IR_Publication_Set publicationRefs_

◆ remove_subscription_reference()

int DCPS_IR_Topic::remove_subscription_reference ( DCPS_IR_Subscription subscription)

Removes the subscription from the list of subscriptions Returns 0 if successful

Definition at line 190 of file DCPS_IR_Topic.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, description_, DCPS_IR_Subscription::get_id(), id_, LM_DEBUG, LM_ERROR, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::remove(), DCPS_IR_Topic_Description::remove_subscription_reference(), and subscriptionRefs_.

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

191 {
192  int status = subscriptionRefs_.remove(subscription);
193 
194  if (0 == status) {
196  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
197  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
198  ACE_DEBUG((LM_DEBUG,
199  ACE_TEXT("(%P|%t) DCPS_IR_Topic::remove_subscription_reference: ")
200  ACE_TEXT("topic %C removed subscription %C.\n"),
201  std::string(topic_converter).c_str(),
202  std::string(sub_converter).c_str()));
203  }
204 
205  this->description_->remove_subscription_reference(subscription);
206 
207  } else {
208  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
209  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
210  ACE_ERROR((LM_ERROR,
211  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Topic::remove_subscription_reference: ")
212  ACE_TEXT("topic %C failed to remove subscription %C.\n"),
213  std::string(topic_converter).c_str(),
214  std::string(sub_converter).c_str()));
215  } // if (0 == status)
216 
217  return status;
218 }
#define ACE_DEBUG(X)
OpenDDS::DCPS::GUID_t id_
#define ACE_ERROR(X)
DCPS_IR_Topic_Description * description_
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
OpenDDS::DCPS::GUID_t get_id()
DCPS_IR_Subscription_Set subscriptionRefs_
int remove_subscription_reference(DCPS_IR_Subscription *subscription)

◆ set_bit_status()

void DCPS_IR_Topic::set_bit_status ( CORBA::Boolean  isBIT)

Definition at line 342 of file DCPS_IR_Topic.cpp.

References isBIT_.

Referenced by DCPS_IR_Participant::add_topic_reference(), and DCPS_IR_Domain::publish_topic_bit().

343 {
344  isBIT_ = isBIT;
345 }
CORBA::Boolean isBIT_

◆ set_handle()

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

Definition at line 332 of file DCPS_IR_Topic.cpp.

References handle_.

Referenced by DCPS_IR_Domain::publish_topic_bit().

333 {
334  handle_ = handle;
335 }
DDS::InstanceHandle_t handle_

◆ set_topic_qos()

bool DCPS_IR_Topic::set_topic_qos ( const DDS::TopicQos qos)

Reset topic 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 TopicQos do not affect.

Definition at line 235 of file DCPS_IR_Topic.cpp.

References ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::begin(), domain_, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::end(), publicationRefs_, DCPS_IR_Domain::publish_publication_bit(), DCPS_IR_Domain::publish_subscription_bit(), DCPS_IR_Domain::publish_topic_bit(), qos_, subscriptionRefs_, and DDS::TopicQos::topic_data.

Referenced by TAO_DDS_DCPSInfo_i::update_topic_qos().

236 {
237  // Do not need re-evaluate compatibility and associations when
238  // TopicQos changes since only datareader and datawriter QoS
239  // are evaludated during normal associations establishment.
240  using OpenDDS::DCPS::operator==;
241  bool pub_to_rd_wr = !(qos.topic_data == qos_.topic_data);
242 
243  qos_ = qos;
244  domain_->publish_topic_bit(this);
245 
246  if (!pub_to_rd_wr)
247  return true;
248 
249  // The only changeable TopicQos used by DataWriter and DataReader
250  // is topic_data so we need publish it to DW/DR BIT to make they
251  // are consistent.
252 
253  // Update qos in datawriter BIT for associated datawriters.
254 
255  {
258 
259  while (iter != end) {
261  ++iter;
262  }
263  }
264 
265  // Update qos in datareader BIT for associated datareader.
266 
267  {
270 
271  while (iter != end) {
273  ++iter;
274  }
275  }
276 
277  return true;
278 }
TopicDataQosPolicy topic_data
DDS::TopicQos qos_
void publish_subscription_bit(DCPS_IR_Subscription *subscription)
Publish Subscription in the Subscription Built-In Topic.
void publish_topic_bit(DCPS_IR_Topic *topic)
Publish Topic in the Topic Built-In Topic.
DCPS_IR_Domain * domain_
void publish_publication_bit(DCPS_IR_Publication *publication)
Publish Publication in the Publication Built-In Topic.
DCPS_IR_Publication_Set publicationRefs_
DCPS_IR_Subscription_Set subscriptionRefs_

◆ try_associate()

void DCPS_IR_Topic::try_associate ( DCPS_IR_Subscription subscription)

Called by the DCPS_IR_Topic_Description Find any compatible publications and associate them using the DCPS_IR_Topic_Description's associate method. This method does not check the subscription's incompatible qos status.

Definition at line 280 of file DCPS_IR_Topic.cpp.

References ACE_DEBUG, ACE_TEXT(), ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::begin(), OpenDDS::DCPS::IncompatibleQosStatus::count_since_last_send, OpenDDS::DCPS::DCPS_debug_level, description_, ACE_Unbounded_Set_Ex< T, ACE_Unbounded_Set_Default_Comparator< T > >::end(), DCPS_IR_Subscription::get_id(), DCPS_IR_Publication::get_incompatibleQosStatus(), DCPS_IR_Subscription::get_participant_id(), DCPS_IR_Subscription::get_topic_id(), id_, DCPS_IR_Participant::is_participant_ignored(), DCPS_IR_Participant::is_subscription_ignored(), DCPS_IR_Participant::is_topic_ignored(), LM_DEBUG, participant_, publicationRefs_, DCPS_IR_Topic_Description::try_associate(), and DCPS_IR_Publication::update_incompatible_qos().

Referenced by DCPS_IR_Topic_Description::try_associate_subscription().

281 {
282  // check if we should ignore this subscription
283  if (participant_->is_subscription_ignored(subscription->get_id()) ||
285  participant_->is_topic_ignored(subscription->get_topic_id())) {
287  OpenDDS::DCPS::RepoIdConverter topic_converter(id_);
288  OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
289  ACE_DEBUG((LM_DEBUG,
290  ACE_TEXT("(%P|%t) DCPS_IR_Topic::try_associate: ")
291  ACE_TEXT("topic %C ignoring subscription %C.\n"),
292  std::string(topic_converter).c_str(),
293  std::string(sub_converter).c_str()));
294  }
295 
296  } else {
297  // check all publications for compatibility
298  DCPS_IR_Publication* pub = 0;
300 
303 
304  while (iter != end) {
305  pub = *iter;
306  ++iter;
307  description_->try_associate(pub, subscription);
308  // Check the publications QOS status
309  qosStatus = pub->get_incompatibleQosStatus();
310 
311  if (0 < qosStatus->count_since_last_send) {
313  }
314  } /* while (iter != end) */
315 
316  // The subscription QOS is not checked because
317  // we don't know if the subscription is finished cycling
318  // through topics.
319  }
320 }
#define ACE_DEBUG(X)
CORBA::Boolean is_subscription_ignored(OpenDDS::DCPS::GUID_t id)
OpenDDS::DCPS::GUID_t id_
DCPS_IR_Participant * participant_
OpenDDS::DCPS::GUID_t get_participant_id()
Representative of a Publication.
bool try_associate(DCPS_IR_Publication *publication, DCPS_IR_Subscription *subscription)
OpenDDS::DCPS::IncompatibleQosStatus * get_incompatibleQosStatus()
DCPS_IR_Topic_Description * description_
CORBA::Boolean is_participant_ignored(OpenDDS::DCPS::GUID_t id)
CORBA::Boolean is_topic_ignored(OpenDDS::DCPS::GUID_t id)
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DCPS_IR_Publication_Set publicationRefs_
OpenDDS::DCPS::GUID_t get_id()
OpenDDS::DCPS::GUID_t get_topic_id()

Member Data Documentation

◆ description_

DCPS_IR_Topic_Description* DCPS_IR_Topic::description_
private

◆ domain_

DCPS_IR_Domain* DCPS_IR_Topic::domain_
private

Definition at line 129 of file DCPS_IR_Topic.h.

Referenced by add_publication_reference(), release(), and set_topic_qos().

◆ handle_

DDS::InstanceHandle_t DCPS_IR_Topic::handle_
private

Definition at line 132 of file DCPS_IR_Topic.h.

Referenced by get_handle(), and set_handle().

◆ id_

OpenDDS::DCPS::GUID_t DCPS_IR_Topic::id_
private

◆ isBIT_

CORBA::Boolean DCPS_IR_Topic::isBIT_
private

Definition at line 133 of file DCPS_IR_Topic.h.

Referenced by dump_to_string(), is_bit(), and set_bit_status().

◆ participant_

DCPS_IR_Participant* DCPS_IR_Topic::participant_
private

Definition at line 130 of file DCPS_IR_Topic.h.

Referenced by get_participant_id(), and try_associate().

◆ publicationRefs_

DCPS_IR_Publication_Set DCPS_IR_Topic::publicationRefs_
private

◆ qos_

DDS::TopicQos DCPS_IR_Topic::qos_
private

Definition at line 128 of file DCPS_IR_Topic.h.

Referenced by get_topic_qos(), and set_topic_qos().

◆ removed_

bool DCPS_IR_Topic::removed_
private

True means release() is called upon delete_topic, but topic object is not deleted because there are still pub/sub associated.

Definition at line 142 of file DCPS_IR_Topic.h.

Referenced by release().

◆ subscriptionRefs_

DCPS_IR_Subscription_Set DCPS_IR_Topic::subscriptionRefs_
private

Keep track the subscriptions of this topic so the TopicQos change can be published for those subscriptions.

Definition at line 138 of file DCPS_IR_Topic.h.

Referenced by add_subscription_reference(), dump_to_string(), release(), remove_subscription_reference(), and set_topic_qos().


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