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

Method reader

tools/modeling/codegen/model/Entities.cpp:384–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384DDS::DataReader_var
385OpenDDS::Model::Entities::reader(
386 const OPENDDS_STRING& name,
387 const OPENDDS_STRING& transportConfig)
388{
389 StringToDataReaderMap::const_iterator which
390 = this->readerByString_.find( name);
391 if( which != this->readerByString_.end()) {
392 return DDS::DataReader::_duplicate( which->second);
393 }
394
395 // See if there is a configuration profile for it.
396 Config::ReaderProfileMap::const_iterator where
397 = this->config_.readerProfileMap().find( name);
398 if( where == this->config_.readerProfileMap().end()) {
399 ACE_ERROR((LM_ERROR,
400 ACE_TEXT("(%P|%t) ERROR: Entities::reader() - ")
401 ACE_TEXT("unable to find profile to configure ")
402 ACE_TEXT("reader: [%C].\n"),
403 name.c_str()
404 ));
405 return 0;
406 }
407 ReaderProfile* profile = where->second;
408
409 // Find the containing Subscriber.
410 DDS::Subscriber_var subscriber = this->subscriber(profile->subscriber,
411 transportConfig);
412 if( !subscriber) {
413 ACE_ERROR((LM_ERROR,
414 ACE_TEXT("(%P|%t) ERROR: Entities::reader() - ")
415 ACE_TEXT("unable to find subscriber: [%C] for reader [%C].\n"),
416 profile->subscriber.c_str(), name.c_str()
417 ));
418 return 0;
419 }
420
421 // We need the *name* of the participant in order to look up the Topic.
422 // This should be Ok since we will only be configuring Readers that have
423 // been successfully defined in a configuration file, implying that there
424 // exists a defined [subscriber] profile.
425 Config::SubscriberProfileMap::const_iterator location
426 = this->config_.subscriberProfileMap().find( profile->subscriber);
427 if( location == this->config_.subscriberProfileMap().end()) {
428 ACE_ERROR((LM_ERROR,
429 ACE_TEXT("(%P|%t) ERROR: Entities::reader() - ")
430 ACE_TEXT("unable to find profile to configure ")
431 ACE_TEXT("subscriber: [%C] for reader [%C].\n"),
432 profile->subscriber.c_str(), name.c_str()
433 ));
434 return 0;
435 }
436 SubscriberProfile* subscriberProfile = location->second;
437
438 // Find the Topic.
439 DDS::Topic_var topic
440 = this->topic(profile->topic,
441 subscriberProfile->participant,

Callers 15

run_instanceFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45

Calls 9

subscriberMethod · 0.95
topicMethod · 0.95
copyToReaderQosMethod · 0.80
createReaderMethod · 0.80
findMethod · 0.45
endMethod · 0.45
get_qosMethod · 0.45
copy_from_topic_qosMethod · 0.45

Tested by 15

run_instanceFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36