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

Method subscriber

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

Source from the content-addressed store, hash-verified

227}
228
229DDS::Subscriber_var
230OpenDDS::Model::Entities::subscriber(
231 const OPENDDS_STRING& name,
232 const OPENDDS_STRING& transportConfig)
233{
234 StringToSubscriberMap::const_iterator which
235 = this->subscriberByString_.find( name);
236 if( which != this->subscriberByString_.end()) {
237 return DDS::Subscriber::_duplicate( which->second);
238 }
239
240 // See if there is a configuration profile for it.
241 Config::SubscriberProfileMap::const_iterator where
242 = this->config_.subscriberProfileMap().find( name);
243 if( where == this->config_.subscriberProfileMap().end()) {
244 ACE_ERROR((LM_ERROR,
245 ACE_TEXT("(%P|%t) ERROR: Entities::subscriber() - ")
246 ACE_TEXT("unable to find profile to configure ")
247 ACE_TEXT("subscriber: [%C].\n"),
248 name.c_str()
249 ));
250 return 0;
251 }
252 SubscriberProfile* profile = where->second;
253
254 // Find the containing participant.
255 DDS::DomainParticipant_var participant
256 = this->participant( profile->participant, transportConfig);
257 if( !participant) {
258 ACE_ERROR((LM_ERROR,
259 ACE_TEXT("(%P|%t) ERROR: Entities::subscriber() - ")
260 ACE_TEXT("unable to find participant: [%C] for subscriber [%C].\n"),
261 profile->participant.c_str(), name.c_str()
262 ));
263 return 0;
264 }
265
266 if( OpenDDS::DCPS::DCPS_debug_level>1) {
267 ACE_DEBUG((LM_DEBUG,
268 ACE_TEXT("(%P|%t) Entities::subscriber() - ")
269 ACE_TEXT("Creating subscriber [%C] in participant [%C].\n"),
270 name.c_str(),
271 profile->participant.c_str()
272 ));
273 }
274 this->subscriberByString_[ name]
275 = this->delegate_.createSubscriber(
276 participant,
277 profile->qos,
278 OpenDDS::DCPS::DEFAULT_STATUS_MASK,
279 transportConfig
280 );
281
282 return this->subscriberByString_[ name];
283}
284
285DDS::DataWriter_var
286OpenDDS::Model::Entities::writer(

Callers 3

readerMethod · 0.95
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45

Calls 4

participantMethod · 0.95
findMethod · 0.45
endMethod · 0.45
createSubscriberMethod · 0.45

Tested by 2

ACE_TMAINFunction · 0.36
ACE_TMAINFunction · 0.36