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

Method writer

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

Source from the content-addressed store, hash-verified

283}
284
285DDS::DataWriter_var
286OpenDDS::Model::Entities::writer(
287 const OPENDDS_STRING& name,
288 const OPENDDS_STRING& transportConfig)
289{
290 StringToDataWriterMap::const_iterator which
291 = this->writerByString_.find( name);
292 if( which != this->writerByString_.end()) {
293 return DDS::DataWriter::_duplicate( which->second);
294 }
295
296 // See if there is a configuration profile for it.
297 Config::WriterProfileMap::const_iterator where
298 = this->config_.writerProfileMap().find( name);
299 if( where == this->config_.writerProfileMap().end()) {
300 ACE_ERROR((LM_ERROR,
301 ACE_TEXT("(%P|%t) ERROR: Entities::writer() - ")
302 ACE_TEXT("unable to find profile to configure ")
303 ACE_TEXT("writer: [%C].\n"),
304 name.c_str()
305 ));
306 return 0;
307 }
308 WriterProfile* profile = where->second;
309
310 // Find the containing Publisher.
311 DDS::Publisher_var publisher = this->publisher(profile->publisher,
312 transportConfig);
313 if( !publisher) {
314 ACE_ERROR((LM_ERROR,
315 ACE_TEXT("(%P|%t) ERROR: Entities::writer() - ")
316 ACE_TEXT("unable to find publisher: [%C] for writer [%C].\n"),
317 profile->publisher.c_str(), name.c_str()
318 ));
319 return 0;
320 }
321
322 // We need the *name* of the participant in order to look up the Topic.
323 // This should be Ok since we will only be configuring Writers that have
324 // been successfully defined in a configuration file, implying that there
325 // exists a defined [publisher] profile.
326 Config::PublisherProfileMap::const_iterator location
327 = this->config_.publisherProfileMap().find( profile->publisher);
328 if( location == this->config_.publisherProfileMap().end()) {
329 ACE_ERROR((LM_ERROR,
330 ACE_TEXT("(%P|%t) ERROR: Entities::writer() - ")
331 ACE_TEXT("unable to find profile to configure ")
332 ACE_TEXT("publisher: [%C] for writer [%C].\n"),
333 profile->publisher.c_str(), name.c_str()
334 ));
335 return 0;
336 }
337 PublisherProfile* publisherProfile = location->second;
338
339 // Find the Topic.
340 DDS::Topic_var topic
341 = this->topic( profile->topic,
342 publisherProfile->participant,

Callers 15

run_instanceFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
send_reference_dataFunction · 0.45
send_trade_dataFunction · 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

publisherMethod · 0.95
topicMethod · 0.95
copyToWriterQosMethod · 0.80
createWriterMethod · 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
send_reference_dataFunction · 0.36
send_trade_dataFunction · 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