OpenDDS::DCPS::StaticEndpointManager Class Reference

#include <StaticDiscovery.h>

Inheritance diagram for OpenDDS::DCPS::StaticEndpointManager:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::StaticEndpointManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StaticEndpointManager (const RepoId &participant_id, ACE_Thread_Mutex &lock, const EndpointRegistry &registry, StaticParticipant &participant)
void init_bit ()
virtual void assign_publication_key (RepoId &rid, const RepoId &topicId, const DDS::DataWriterQos &qos)
virtual void assign_subscription_key (RepoId &rid, const RepoId &topicId, const DDS::DataReaderQos &qos)
virtual bool update_topic_qos (const RepoId &, const DDS::TopicQos &, OPENDDS_STRING &)
virtual bool update_publication_qos (const RepoId &, const DDS::DataWriterQos &, const DDS::PublisherQos &)
virtual bool update_subscription_qos (const RepoId &, const DDS::DataReaderQos &, const DDS::SubscriberQos &)
virtual bool update_subscription_params (const RepoId &, const DDS::StringSeq &)
virtual void association_complete (const RepoId &, const RepoId &)
virtual bool disassociate (const StaticDiscoveredParticipantData &)
virtual DDS::ReturnCode_t add_publication_i (const RepoId &, LocalPublication &)
virtual DDS::ReturnCode_t remove_publication_i (const RepoId &)
virtual DDS::ReturnCode_t add_subscription_i (const RepoId &, LocalSubscription &)
virtual DDS::ReturnCode_t remove_subscription_i (const RepoId &)
virtual bool shutting_down () const
virtual void populate_transport_locator_sequence (TransportLocatorSeq *&, DiscoveredSubscriptionIter &, const RepoId &)
virtual void populate_transport_locator_sequence (TransportLocatorSeq *&, DiscoveredPublicationIter &, const RepoId &)
virtual bool defer_writer (const RepoId &, const RepoId &)
virtual bool defer_reader (const RepoId &, const RepoId &)
virtual void reader_exists (const RepoId &readerid, const RepoId &writerid)
virtual void reader_does_not_exist (const RepoId &readerid, const RepoId &writerid)
virtual void writer_exists (const RepoId &writerid, const RepoId &readerid)
virtual void writer_does_not_exist (const RepoId &writerid, const RepoId &readerid)
OpenDDS::DCPS::PublicationBuiltinTopicDataDataReaderImplpub_bit ()
OpenDDS::DCPS::SubscriptionBuiltinTopicDataDataReaderImplsub_bit ()

Private Attributes

const EndpointRegistryregistry_
StaticParticipantparticipant_

Detailed Description

Definition at line 134 of file StaticDiscovery.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::StaticEndpointManager::StaticEndpointManager ( const RepoId participant_id,
ACE_Thread_Mutex lock,
const EndpointRegistry registry,
StaticParticipant participant 
)

Definition at line 78 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::pub_bit_key_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::sub_bit_key_, and DDS::BuiltinTopicKey_t::value.

00082   : EndpointManager<StaticDiscoveredParticipantData>(participant_id, lock)
00083   , registry_(registry)
00084   , participant_(participant)
00085 {
00086   pub_bit_key_.value[0] = pub_bit_key_.value[1] = pub_bit_key_.value[2] = 0;
00087   sub_bit_key_.value[0] = sub_bit_key_.value[1] = sub_bit_key_.value[2] = 0;
00088 }


Member Function Documentation

DDS::ReturnCode_t OpenDDS::DCPS::StaticEndpointManager::add_publication_i ( const RepoId writerid,
LocalPublication &  pub 
) [virtual]

Reimplemented from OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 304 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointRegistry::Writer::best_effort_readers, OpenDDS::DCPS::ReaderAssociation::exprParams, OpenDDS::DCPS::ReaderAssociation::filterClassName, OpenDDS::DCPS::ReaderAssociation::filterExpression, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::participant_id_, OpenDDS::DCPS::EndpointRegistry::Reader::qos, OpenDDS::DCPS::EndpointRegistry::reader_map, OpenDDS::DCPS::ReaderAssociation::readerId, OpenDDS::DCPS::ReaderAssociation::readerQos, OpenDDS::DCPS::ReaderAssociation::readerTransInfo, registry_, OpenDDS::DCPS::EndpointRegistry::Writer::reliable_readers, DDS::RETCODE_ERROR, DDS::RETCODE_OK, OpenDDS::DCPS::ReaderAssociation::subQos, OpenDDS::DCPS::EndpointRegistry::Reader::subscriber_qos, OpenDDS::DCPS::EndpointRegistry::Reader::trans_info, and OpenDDS::DCPS::EndpointRegistry::writer_map.

00306 {
00307   /*
00308     Find all matching remote readers.
00309     If the reader is best effort, then associate immediately.
00310     If the reader is reliable (we are reliable by implication), register with the transport to receive notification that the remote reader is up.
00311     */
00312   EndpointRegistry::WriterMapType::const_iterator pos = registry_.writer_map.find(writerid);
00313   if (pos == registry_.writer_map.end()) {
00314     return DDS::RETCODE_ERROR;
00315   }
00316   const EndpointRegistry::Writer& writer = pos->second;
00317 
00318   for (RepoIdSet::const_iterator pos = writer.best_effort_readers.begin(), limit = writer.best_effort_readers.end();
00319        pos != limit;
00320        ++pos) {
00321     const RepoId& readerid = *pos;
00322     const EndpointRegistry::Reader& reader = registry_.reader_map.find(readerid)->second;
00323 
00324 #ifdef __SUNPRO_CC
00325     ReaderAssociation ra;
00326     ra.readerTransInfo = reader.trans_info;
00327     ra.readerId = readerid;
00328     ra.subQos = reader.subscriber_qos;
00329     ra.readerQos = reader.qos;
00330     ra.filterClassName = "";
00331     ra.filterExpression = "";
00332     ra.exprParams = 0;
00333 #else
00334     const ReaderAssociation ra =
00335       {reader.trans_info, readerid, reader.subscriber_qos, reader.qos, "", "", 0};
00336 #endif
00337     pub.publication_->add_association(writerid, ra, true);
00338     pub.publication_->association_complete(readerid);
00339   }
00340 
00341   for (RepoIdSet::const_iterator pos = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
00342        pos != limit;
00343        ++pos) {
00344     const RepoId& readerid = *pos;
00345     const EndpointRegistry::Reader& reader = registry_.reader_map.find(readerid)->second;
00346     pub.publication_->register_for_reader(participant_id_, writerid, readerid, reader.trans_info, this);
00347   }
00348 
00349   return DDS::RETCODE_OK;
00350 }

DDS::ReturnCode_t OpenDDS::DCPS::StaticEndpointManager::add_subscription_i ( const RepoId readerid,
LocalSubscription &  sub 
) [virtual]

Reimplemented from OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 384 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointRegistry::Reader::best_effort_writers, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::participant_id_, OpenDDS::DCPS::EndpointRegistry::Writer::publisher_qos, OpenDDS::DCPS::WriterAssociation::pubQos, OpenDDS::DCPS::EndpointRegistry::Writer::qos, OpenDDS::DCPS::EndpointRegistry::reader_map, registry_, OpenDDS::DCPS::EndpointRegistry::Reader::reliable_writers, DDS::RETCODE_ERROR, DDS::RETCODE_OK, OpenDDS::DCPS::EndpointRegistry::Writer::trans_info, OpenDDS::DCPS::EndpointRegistry::writer_map, OpenDDS::DCPS::WriterAssociation::writerId, OpenDDS::DCPS::WriterAssociation::writerQos, and OpenDDS::DCPS::WriterAssociation::writerTransInfo.

00386 {
00387   /*
00388     Find all matching remote writers.
00389     If we (the reader) is best effort, then associate immediately.
00390     If we (the reader) are reliable, then register with the transport to receive notification that the remote writer is up.
00391     */
00392   EndpointRegistry::ReaderMapType::const_iterator pos = registry_.reader_map.find(readerid);
00393   if (pos == registry_.reader_map.end()) {
00394     return DDS::RETCODE_ERROR;
00395   }
00396   const EndpointRegistry::Reader& reader = pos->second;
00397 
00398   for (RepoIdSet::const_iterator pos = reader.best_effort_writers.begin(), limit = reader.best_effort_writers.end();
00399        pos != limit;
00400        ++pos) {
00401     const RepoId& writerid = *pos;
00402     const EndpointRegistry::Writer& writer = registry_.writer_map.find(writerid)->second;
00403 
00404 #ifdef __SUNPRO_CC
00405     WriterAssociation wa;
00406     wa.writerTransInfo = writer.trans_info;
00407     wa.writerId = writerid;
00408     wa.pubQos = writer.publisher_qos;
00409     wa.writerQos = writer.qos;
00410 #else
00411     const WriterAssociation wa =
00412       {writer.trans_info, writerid, writer.publisher_qos, writer.qos};
00413 #endif
00414     sub.subscription_->add_association(readerid, wa, false);
00415   }
00416 
00417   for (RepoIdSet::const_iterator pos = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
00418        pos != limit;
00419        ++pos) {
00420     const RepoId& writerid = *pos;
00421     const EndpointRegistry::Writer& writer = registry_.writer_map.find(writerid)->second;
00422     sub.subscription_->register_for_writer(participant_id_, readerid, writerid, writer.trans_info, this);
00423   }
00424 
00425   return DDS::RETCODE_OK;
00426 }

void OpenDDS::DCPS::StaticEndpointManager::assign_publication_key ( RepoId rid,
const RepoId topicId,
const DDS::DataWriterQos qos 
) [virtual]

Reimplemented from OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 184 of file StaticDiscovery.cpp.

References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKey, OpenDDS::DCPS::EntityId_t::entityKind, OpenDDS::DCPS::ENTITYKIND_USER_WRITER_WITH_KEY, LM_ERROR, LM_INFO, LM_WARNING, registry_, DDS::DataWriterQos::user_data, and OpenDDS::DCPS::EndpointRegistry::writer_map.

00187 {
00188   if (qos.user_data.value.length() != BYTES_IN_ENTITY) {
00189     ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::assign_publication_key: no user data to identify writer\n")));
00190     return;
00191   }
00192 
00193   rid.entityId.entityKey[0] = qos.user_data.value[0];
00194   rid.entityId.entityKey[1] = qos.user_data.value[1];
00195   rid.entityId.entityKey[2] = qos.user_data.value[2];
00196   rid.entityId.entityKind = ENTITYKIND_USER_WRITER_WITH_KEY;
00197 
00198   if (DCPS_debug_level > 8) {
00199     ACE_DEBUG((LM_INFO, "(%P|%t) looking up writer ID %C\n",
00200                LogGuid(rid).c_str()));
00201   }
00202 
00203   EndpointRegistry::WriterMapType::const_iterator pos = registry_.writer_map.find(rid);
00204   if (pos == registry_.writer_map.end()) {
00205     ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) WARNING: StaticEndpointManager::assign_publication_key: unknown writer: %C\n"), LogGuid(rid).c_str()));
00206     return;
00207   }
00208 
00209   DDS::DataWriterQos qos2(qos);
00210   // Qos in registry will not have the user data so overwrite.
00211   qos2.user_data = pos->second.qos.user_data;
00212 
00213   DDS::DataWriterQos qos3(pos->second.qos);
00214 
00215   if (qos2 != qos3) {
00216     ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) WARNING: StaticEndpointManager::assign_publication_key: dynamic and static QoS differ\n")));
00217   }
00218 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::assign_subscription_key ( RepoId rid,
const RepoId topicId,
const DDS::DataReaderQos qos 
) [virtual]

Reimplemented from OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 220 of file StaticDiscovery.cpp.

References ACE_TEXT(), OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKey, OpenDDS::DCPS::EntityId_t::entityKind, OpenDDS::DCPS::ENTITYKIND_USER_READER_WITH_KEY, LM_ERROR, LM_WARNING, OpenDDS::DCPS::EndpointRegistry::reader_map, registry_, and DDS::DataReaderQos::user_data.

00223 {
00224   if (qos.user_data.value.length() != BYTES_IN_ENTITY) {
00225     ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::assign_subscription_key: no user data to identify reader\n")));
00226     return;
00227   }
00228 
00229   rid.entityId.entityKey[0] = qos.user_data.value[0];
00230   rid.entityId.entityKey[1] = qos.user_data.value[1];
00231   rid.entityId.entityKey[2] = qos.user_data.value[2];
00232   rid.entityId.entityKind = ENTITYKIND_USER_READER_WITH_KEY;
00233 
00234   EndpointRegistry::ReaderMapType::const_iterator pos = registry_.reader_map.find(rid);
00235   if (pos == registry_.reader_map.end()) {
00236     ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) WARNING: StaticEndpointManager::assign_subscription_key: unknown reader: %C\n"), LogGuid(rid).c_str()));
00237     return;
00238   }
00239 
00240   DDS::DataReaderQos qos2(qos);
00241   // Qos in registry will not have the user data so overwrite.
00242   qos2.user_data = pos->second.qos.user_data;
00243 
00244   if (qos2 != pos->second.qos) {
00245     ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) WARNING: StaticEndpointManager::assign_subscription_key: dynamic and static QoS differ\n")));
00246   }
00247 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::association_complete ( const RepoId ,
const RepoId  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 289 of file StaticDiscovery.cpp.

00291 {
00292   // Do nothing.
00293 }

bool OpenDDS::DCPS::StaticEndpointManager::defer_reader ( const RepoId ,
const RepoId  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 495 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00497 {
00498   // TODO
00499   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::defer_reader TODO\n")));
00500   return false;
00501 }

Here is the call graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::defer_writer ( const RepoId ,
const RepoId  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 486 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00488 {
00489   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::defer_writer TODO\n")));
00490   // TODO
00491   return false;
00492 }

Here is the call graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::disassociate ( const StaticDiscoveredParticipantData  )  [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 296 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00297 {
00298   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::disassociate TODO\n")));
00299   // TODO
00300   return false;
00301 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::init_bit (  ) 

Definition at line 90 of file StaticDiscovery.cpp.

References DDS::DataReaderQos::deadline, DDS::SubscriptionBuiltinTopicData::deadline, DDS::DataWriterQos::deadline, DDS::PublicationBuiltinTopicData::deadline, DDS::DataReaderQos::destination_order, DDS::SubscriptionBuiltinTopicData::destination_order, DDS::DataWriterQos::destination_order, DDS::PublicationBuiltinTopicData::destination_order, DDS::DataReaderQos::durability, DDS::SubscriptionBuiltinTopicData::durability, DDS::DataWriterQos::durability, DDS::PublicationBuiltinTopicData::durability, DDS::DataWriterQos::durability_service, DDS::PublicationBuiltinTopicData::durability_service, DDS::SubscriberQos::group_data, DDS::SubscriptionBuiltinTopicData::group_data, DDS::PublisherQos::group_data, DDS::PublicationBuiltinTopicData::group_data, OpenDDS::DCPS::GUID_t::guidPrefix, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::increment_key(), DDS::SubscriptionBuiltinTopicData::key, DDS::PublicationBuiltinTopicData::key, DDS::DataReaderQos::latency_budget, DDS::SubscriptionBuiltinTopicData::latency_budget, DDS::DataWriterQos::latency_budget, DDS::PublicationBuiltinTopicData::latency_budget, DDS::DataWriterQos::lifespan, DDS::PublicationBuiltinTopicData::lifespan, DDS::DataReaderQos::liveliness, DDS::SubscriptionBuiltinTopicData::liveliness, DDS::DataWriterQos::liveliness, DDS::PublicationBuiltinTopicData::liveliness, DDS::NEW_VIEW_STATE, OPENDDS_STRING, DDS::DataReaderQos::ownership, DDS::SubscriptionBuiltinTopicData::ownership, DDS::DataWriterQos::ownership, DDS::PublicationBuiltinTopicData::ownership, DDS::DataWriterQos::ownership_strength, DDS::PublicationBuiltinTopicData::ownership_strength, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::participant_id_, DDS::SubscriberQos::partition, DDS::SubscriptionBuiltinTopicData::partition, DDS::PublisherQos::partition, DDS::PublicationBuiltinTopicData::partition, DDS::SubscriberQos::presentation, DDS::SubscriptionBuiltinTopicData::presentation, DDS::PublisherQos::presentation, DDS::PublicationBuiltinTopicData::presentation, pub_bit(), OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::pub_bit_key_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::pub_key_to_id_, OpenDDS::DCPS::EndpointRegistry::Writer::publisher_qos, OpenDDS::DCPS::EndpointRegistry::Reader::qos, OpenDDS::DCPS::EndpointRegistry::Writer::qos, OpenDDS::DCPS::EndpointRegistry::reader_map, registry_, DDS::DataReaderQos::reliability, DDS::SubscriptionBuiltinTopicData::reliability, DDS::DataWriterQos::reliability, DDS::PublicationBuiltinTopicData::reliability, OpenDDS::DCPS::DataReaderImpl_T< MessageType >::store_synthetic_data(), sub_bit(), OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::sub_bit_key_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::sub_key_to_id_, OpenDDS::DCPS::EndpointRegistry::Reader::subscriber_qos, DDS::DataReaderQos::time_based_filter, DDS::SubscriptionBuiltinTopicData::time_based_filter, OpenDDS::DCPS::EndpointRegistry::topic_map, DDS::SubscriptionBuiltinTopicData::topic_name, OpenDDS::DCPS::EndpointRegistry::Reader::topic_name, DDS::PublicationBuiltinTopicData::topic_name, OpenDDS::DCPS::EndpointRegistry::Writer::topic_name, DDS::SubscriptionBuiltinTopicData::type_name, OpenDDS::DCPS::EndpointRegistry::Topic::type_name, DDS::PublicationBuiltinTopicData::type_name, DDS::DataReaderQos::user_data, DDS::SubscriptionBuiltinTopicData::user_data, DDS::DataWriterQos::user_data, DDS::PublicationBuiltinTopicData::user_data, and OpenDDS::DCPS::EndpointRegistry::writer_map.

Referenced by OpenDDS::DCPS::StaticParticipant::init_bit().

00091 {
00092   // Discover all remote publications and subscriptions.
00093 
00094   for (EndpointRegistry::WriterMapType::const_iterator pos = registry_.writer_map.begin(),
00095          limit = registry_.writer_map.end();
00096        pos != limit;
00097        ++pos) {
00098     const RepoId& remoteid = pos->first;
00099     const EndpointRegistry::Writer& writer = pos->second;
00100 
00101     if (!GuidPrefixEqual()(participant_id_.guidPrefix, remoteid.guidPrefix)) {
00102       increment_key(pub_bit_key_);
00103       pub_key_to_id_[pub_bit_key_] = remoteid;
00104 
00105       // pos represents a remote.
00106       // Populate data.
00107       DDS::PublicationBuiltinTopicData data;
00108 
00109       data.key = pub_bit_key_;
00110       OPENDDS_STRING topic_name = writer.topic_name;
00111       data.topic_name = topic_name.c_str();
00112       const EndpointRegistry::Topic& topic = registry_.topic_map.find(topic_name)->second;
00113       data.type_name = topic.type_name.c_str();
00114       data.durability = writer.qos.durability;
00115       data.durability_service = writer.qos.durability_service;
00116       data.deadline = writer.qos.deadline;
00117       data.latency_budget = writer.qos.latency_budget;
00118       data.liveliness = writer.qos.liveliness;
00119       data.reliability = writer.qos.reliability;
00120       data.lifespan = writer.qos.lifespan;
00121       data.user_data = writer.qos.user_data;
00122       data.ownership = writer.qos.ownership;
00123       data.ownership_strength = writer.qos.ownership_strength;
00124       data.destination_order = writer.qos.destination_order;
00125       data.presentation = writer.publisher_qos.presentation;
00126       data.partition = writer.publisher_qos.partition;
00127       // If the TopicQos becomes available, this can be populated.
00128       //data.topic_data = topic_details.qos_.topic_data;
00129       data.group_data = writer.publisher_qos.group_data;
00130 #ifndef DDS_HAS_MINIMUM_BIT
00131       OpenDDS::DCPS::PublicationBuiltinTopicDataDataReaderImpl* bit = pub_bit();
00132       if (bit) { // bit may be null if the DomainParticipant is shutting down
00133         bit->store_synthetic_data(data, DDS::NEW_VIEW_STATE);
00134       }
00135 #endif /* DDS_HAS_MINIMUM_BIT */
00136     }
00137   }
00138 
00139   for (EndpointRegistry::ReaderMapType::const_iterator pos = registry_.reader_map.begin(),
00140          limit = registry_.reader_map.end();
00141        pos != limit;
00142        ++pos) {
00143     const RepoId& remoteid = pos->first;
00144     const EndpointRegistry::Reader& reader = pos->second;
00145 
00146     if (!GuidPrefixEqual()(participant_id_.guidPrefix, remoteid.guidPrefix)) {
00147       increment_key(sub_bit_key_);
00148       sub_key_to_id_[sub_bit_key_] = remoteid;
00149 
00150       // pos represents a remote.
00151       // Populate data.
00152       DDS::SubscriptionBuiltinTopicData data;
00153 
00154       data.key = sub_bit_key_;
00155       OPENDDS_STRING topic_name = reader.topic_name;
00156       data.topic_name = topic_name.c_str();
00157       const EndpointRegistry::Topic& topic = registry_.topic_map.find(topic_name)->second;
00158       data.type_name = topic.type_name.c_str();
00159       data.durability = reader.qos.durability;
00160       data.deadline = reader.qos.deadline;
00161       data.latency_budget = reader.qos.latency_budget;
00162       data.liveliness = reader.qos.liveliness;
00163       data.reliability = reader.qos.reliability;
00164       data.ownership = reader.qos.ownership;
00165       data.destination_order = reader.qos.destination_order;
00166       data.user_data = reader.qos.user_data;
00167       data.time_based_filter = reader.qos.time_based_filter;
00168       data.presentation = reader.subscriber_qos.presentation;
00169       data.partition = reader.subscriber_qos.partition;
00170       // // If the TopicQos becomes available, this can be populated.
00171       //data.topic_data = topic_details.qos_.topic_data;
00172       data.group_data = reader.subscriber_qos.group_data;
00173 
00174 #ifndef DDS_HAS_MINIMUM_BIT
00175       OpenDDS::DCPS::SubscriptionBuiltinTopicDataDataReaderImpl* bit = sub_bit();
00176       if (bit) { // bit may be null if the DomainParticipant is shutting down
00177         bit->store_synthetic_data(data, DDS::NEW_VIEW_STATE);
00178       }
00179 #endif /* DDS_HAS_MINIMUM_BIT */
00180     }
00181   }
00182 }

Here is the call graph for this function:

Here is the caller graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::populate_transport_locator_sequence ( TransportLocatorSeq *&  ,
DiscoveredPublicationIter ,
const RepoId  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 477 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00480 {
00481   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::populate_transport_locator_sequence TODO\n")));
00482   // TODO
00483 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::populate_transport_locator_sequence ( TransportLocatorSeq *&  ,
DiscoveredSubscriptionIter ,
const RepoId  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 468 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00471 {
00472   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::populate_transport_locator_sequence TODO\n")));
00473   // TODO
00474 }

Here is the call graph for this function:

OpenDDS::DCPS::PublicationBuiltinTopicDataDataReaderImpl * OpenDDS::DCPS::StaticEndpointManager::pub_bit (  ) 

Definition at line 588 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::LocalParticipant< EndpointManagerType >::bit_subscriber(), OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC, and participant_.

Referenced by init_bit().

00589 {
00590   DDS::Subscriber_var sub = participant_.bit_subscriber();
00591   if (!sub.in())
00592     return 0;
00593 
00594   DDS::DataReader_var d = sub->lookup_datareader(BUILT_IN_PUBLICATION_TOPIC);
00595   return dynamic_cast<OpenDDS::DCPS::PublicationBuiltinTopicDataDataReaderImpl*>(d.in());
00596 }

Here is the call graph for this function:

Here is the caller graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::reader_does_not_exist ( const RepoId readerid,
const RepoId writerid 
) [virtual]

Implements OpenDDS::DCPS::DiscoveryListener.

Definition at line 532 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_publications_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::lock_, OpenDDS::DCPS::EndpointRegistry::reader_map, registry_, and OpenDDS::DCPS::DataWriterCallbacks::remove_associations().

00533 {
00534   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00535   LocalPublicationMap::const_iterator lp_pos = local_publications_.find(writerid);
00536   EndpointRegistry::ReaderMapType::const_iterator reader_pos = registry_.reader_map.find(readerid);
00537   if (lp_pos != local_publications_.end() &&
00538       reader_pos != registry_.reader_map.end()) {
00539     DataWriterCallbacks* dwr = lp_pos->second.publication_;
00540     ReaderIdSeq ids;
00541     ids.length(1);
00542     ids[0] = readerid;
00543     dwr->remove_associations(ids, true);
00544   }
00545 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::reader_exists ( const RepoId readerid,
const RepoId writerid 
) [virtual]

Implements OpenDDS::DCPS::DiscoveryListener.

Definition at line 504 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::DataWriterCallbacks::add_association(), OpenDDS::DCPS::DataWriterCallbacks::association_complete(), OpenDDS::DCPS::ReaderAssociation::exprParams, OpenDDS::DCPS::ReaderAssociation::filterClassName, OpenDDS::DCPS::ReaderAssociation::filterExpression, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_publications_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::lock_, OpenDDS::DCPS::EndpointRegistry::reader_map, OpenDDS::DCPS::ReaderAssociation::readerId, OpenDDS::DCPS::ReaderAssociation::readerQos, OpenDDS::DCPS::ReaderAssociation::readerTransInfo, registry_, and OpenDDS::DCPS::ReaderAssociation::subQos.

00505 {
00506   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00507   LocalPublicationMap::const_iterator lp_pos = local_publications_.find(writerid);
00508   EndpointRegistry::ReaderMapType::const_iterator reader_pos = registry_.reader_map.find(readerid);
00509   if (lp_pos != local_publications_.end() &&
00510       reader_pos != registry_.reader_map.end()) {
00511     DataWriterCallbacks* dwr = lp_pos->second.publication_;
00512 #ifdef __SUNPRO_CC
00513     ReaderAssociation ra;
00514     ra.readerTransInfo = reader_pos->second.trans_info;
00515     ra.readerId = readerid;
00516     ra.subQos = reader_pos->second.subscriber_qos;
00517     ra.readerQos = reader_pos->second.qos;
00518     ra.filterClassName = "";
00519     ra.filterExpression = "";
00520     ra.exprParams = 0;
00521 #else
00522     const ReaderAssociation ra =
00523       {reader_pos->second.trans_info, readerid, reader_pos->second.subscriber_qos, reader_pos->second.qos, "", "", 0};
00524 
00525 #endif
00526     dwr->add_association(writerid, ra, true);
00527     dwr->association_complete(readerid);
00528   }
00529 }

Here is the call graph for this function:

DDS::ReturnCode_t OpenDDS::DCPS::StaticEndpointManager::remove_publication_i ( const RepoId writerid  )  [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 353 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_publications_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::participant_id_, registry_, OpenDDS::DCPS::EndpointRegistry::Writer::reliable_readers, DDS::RETCODE_ERROR, DDS::RETCODE_OK, and OpenDDS::DCPS::EndpointRegistry::writer_map.

00354 {
00355   LocalPublicationMap::const_iterator lp_pos = local_publications_.find(writerid);
00356   if (lp_pos == local_publications_.end()) {
00357     return DDS::RETCODE_ERROR;
00358   }
00359 
00360   const LocalPublication& pub = lp_pos->second;
00361 
00362   EndpointRegistry::WriterMapType::const_iterator pos = registry_.writer_map.find(writerid);
00363   if (pos == registry_.writer_map.end()) {
00364     return DDS::RETCODE_ERROR;
00365   }
00366 
00367   const EndpointRegistry::Writer& writer = pos->second;
00368 
00369   ReaderIdSeq ids;
00370   ids.length((CORBA::ULong)writer.reliable_readers.size());
00371   CORBA::ULong idx = 0;
00372   for (RepoIdSet::const_iterator pos = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
00373         pos != limit;
00374         ++pos, ++idx) {
00375     const RepoId& readerid = *pos;
00376     ids[idx] = readerid;
00377     pub.publication_->unregister_for_reader(participant_id_, writerid, readerid);
00378   }
00379 
00380   return DDS::RETCODE_OK;
00381 }

DDS::ReturnCode_t OpenDDS::DCPS::StaticEndpointManager::remove_subscription_i ( const RepoId readerid  )  [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 429 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_subscriptions_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::participant_id_, OpenDDS::DCPS::EndpointRegistry::reader_map, registry_, OpenDDS::DCPS::EndpointRegistry::Reader::reliable_writers, DDS::RETCODE_ERROR, and DDS::RETCODE_OK.

00430 {
00431   LocalSubscriptionMap::const_iterator ls_pos = local_subscriptions_.find(readerid);
00432   if (ls_pos == local_subscriptions_.end()) {
00433     return DDS::RETCODE_ERROR;
00434   }
00435 
00436   const LocalSubscription& sub = ls_pos->second;
00437 
00438   EndpointRegistry::ReaderMapType::const_iterator pos = registry_.reader_map.find(readerid);
00439   if (pos == registry_.reader_map.end()) {
00440     return DDS::RETCODE_ERROR;
00441   }
00442 
00443   const EndpointRegistry::Reader& reader = pos->second;
00444 
00445   WriterIdSeq ids;
00446   ids.length((CORBA::ULong)reader.reliable_writers.size());
00447   CORBA::ULong idx = 0;
00448   for (RepoIdSet::const_iterator pos = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
00449         pos != limit;
00450         ++pos, ++idx) {
00451     const RepoId& writerid = *pos;
00452     ids[idx] = writerid;
00453     sub.subscription_->unregister_for_writer(participant_id_, readerid, writerid);
00454   }
00455 
00456   return DDS::RETCODE_OK;
00457 }

bool OpenDDS::DCPS::StaticEndpointManager::shutting_down ( void   )  const [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 460 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_NOTICE.

00461 {
00462   ACE_DEBUG((LM_NOTICE, ACE_TEXT("(%P|%t) StaticEndpointManager::shutting_down TODO\n")));
00463   // TODO
00464   return false;
00465 }

Here is the call graph for this function:

OpenDDS::DCPS::SubscriptionBuiltinTopicDataDataReaderImpl * OpenDDS::DCPS::StaticEndpointManager::sub_bit (  ) 

Definition at line 599 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::LocalParticipant< EndpointManagerType >::bit_subscriber(), OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC, and participant_.

Referenced by init_bit().

00600 {
00601   DDS::Subscriber_var sub = participant_.bit_subscriber();
00602   if (!sub.in())
00603     return 0;
00604 
00605   DDS::DataReader_var d = sub->lookup_datareader(BUILT_IN_SUBSCRIPTION_TOPIC);
00606   return dynamic_cast<OpenDDS::DCPS::SubscriptionBuiltinTopicDataDataReaderImpl*>(d.in());
00607 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::update_publication_qos ( const RepoId ,
const DDS::DataWriterQos ,
const DDS::PublisherQos  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 260 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_ERROR.

00263 {
00264   ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::update_publication_qos - ")
00265              ACE_TEXT("Not allowed\n")));
00266   return false;
00267 }

Here is the call graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::update_subscription_params ( const RepoId ,
const DDS::StringSeq  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 280 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_ERROR.

00282 {
00283   ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::update_subscription_qos - ")
00284              ACE_TEXT("Not allowed\n")));
00285   return false;
00286 }

Here is the call graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::update_subscription_qos ( const RepoId ,
const DDS::DataReaderQos ,
const DDS::SubscriberQos  
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 270 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_ERROR.

00273 {
00274   ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::update_subscription_qos - ")
00275              ACE_TEXT("Not allowed\n")));
00276   return false;
00277 }

Here is the call graph for this function:

bool OpenDDS::DCPS::StaticEndpointManager::update_topic_qos ( const RepoId ,
const DDS::TopicQos ,
OPENDDS_STRING &   
) [virtual]

Implements OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >.

Definition at line 250 of file StaticDiscovery.cpp.

References ACE_TEXT(), and LM_ERROR.

00253 {
00254   ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: StaticEndpointManager::update_topic_qos - ")
00255              ACE_TEXT("Not allowed\n")));
00256   return false;
00257 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::writer_does_not_exist ( const RepoId writerid,
const RepoId readerid 
) [virtual]

Implements OpenDDS::DCPS::DiscoveryListener.

Definition at line 571 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_subscriptions_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::lock_, registry_, OpenDDS::DCPS::DataReaderCallbacks::remove_associations(), and OpenDDS::DCPS::EndpointRegistry::writer_map.

00572 {
00573   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00574   LocalSubscriptionMap::const_iterator ls_pos = local_subscriptions_.find(readerid);
00575   EndpointRegistry::WriterMapType::const_iterator writer_pos = registry_.writer_map.find(writerid);
00576   if (ls_pos != local_subscriptions_.end() &&
00577       writer_pos != registry_.writer_map.end()) {
00578     DataReaderCallbacks* drr = ls_pos->second.subscription_;
00579     WriterIdSeq ids;
00580     ids.length(1);
00581     ids[0] = writerid;
00582     drr->remove_associations(ids, true);
00583   }
00584 }

Here is the call graph for this function:

void OpenDDS::DCPS::StaticEndpointManager::writer_exists ( const RepoId writerid,
const RepoId readerid 
) [virtual]

Implements OpenDDS::DCPS::DiscoveryListener.

Definition at line 548 of file StaticDiscovery.cpp.

References OpenDDS::DCPS::DataReaderCallbacks::add_association(), OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::local_subscriptions_, OpenDDS::DCPS::EndpointManager< StaticDiscoveredParticipantData >::lock_, OpenDDS::DCPS::WriterAssociation::pubQos, registry_, OpenDDS::DCPS::EndpointRegistry::writer_map, OpenDDS::DCPS::WriterAssociation::writerId, OpenDDS::DCPS::WriterAssociation::writerQos, and OpenDDS::DCPS::WriterAssociation::writerTransInfo.

00549 {
00550   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00551   LocalSubscriptionMap::const_iterator ls_pos = local_subscriptions_.find(readerid);
00552   EndpointRegistry::WriterMapType::const_iterator writer_pos = registry_.writer_map.find(writerid);
00553   if (ls_pos != local_subscriptions_.end() &&
00554       writer_pos != registry_.writer_map.end()) {
00555     DataReaderCallbacks* drr = ls_pos->second.subscription_;
00556 #ifdef __SUNPRO_CC
00557     WriterAssociation wa;
00558     wa.writerTransInfo = writer_pos->second.trans_info;
00559     wa.writerId = writerid;
00560     wa.pubQos = writer_pos->second.publisher_qos;
00561     wa.writerQos = writer_pos->second.qos;
00562 #else
00563     const WriterAssociation wa =
00564       {writer_pos->second.trans_info, writerid, writer_pos->second.publisher_qos, writer_pos->second.qos};
00565 #endif
00566     drr->add_association(readerid, wa, false);
00567   }
00568 }

Here is the call graph for this function:


Member Data Documentation

Definition at line 210 of file StaticDiscovery.h.

Referenced by pub_bit(), and sub_bit().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1