MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / createSubscription

Method createSubscription

tools/modeling/codegen/model/Delegate.cpp:195–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195DDS::DataReader*
196OpenDDS::Model::Delegate::createSubscription(
197 unsigned int which,
198 DDS::Subscriber* subscriber,
199 DDS::TopicDescription* topic,
200 const DDS::DataReaderQos& readerQos,
201 DDS::StatusMask mask,
202 const OPENDDS_STRING& transportConfig,
203 bool copyQosFromTopic)
204{
205 if( !this->service_) {
206 return 0;
207 }
208 DDS::DataReaderQos dr_qos = readerQos;
209 if (copyQosFromTopic) {
210 // Per the DDS Spec, copy from related topic for CF topic,
211 // Error if copy from mulitopic
212 DDS::TopicQos topicQos = TheServiceParticipant->initial_TopicQos();
213 DDS::Topic* qosTopic;
214 if ((qosTopic = dynamic_cast<DDS::Topic*>(topic)) != NULL) {
215 qosTopic->get_qos(topicQos);
216#ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC
217 } else {
218 DDS::ContentFilteredTopic* qosCfTopic =
219 dynamic_cast<DDS::ContentFilteredTopic*>(topic);
220 if (qosCfTopic != NULL) {
221 DDS::Topic_var related = qosCfTopic->get_related_topic();
222 related->get_qos(topicQos);
223 }
224#endif
225 }
226 subscriber->copy_from_topic_qos(dr_qos, topicQos);
227 }
228 this->service_->copySubscriptionQos(which, dr_qos);
229
230 return this->createReader(
231 subscriber,
232 topic,
233 dr_qos,
234 mask,
235 transportConfig
236 );
237}
238
239DDS::DataReader*
240OpenDDS::Model::Delegate::createReader(

Callers

nothing calls this directly

Calls 5

createReaderMethod · 0.95
get_related_topicMethod · 0.80
copySubscriptionQosMethod · 0.80
get_qosMethod · 0.45
copy_from_topic_qosMethod · 0.45

Tested by

no test coverage detected