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

Method associate

dds/InfoRepo/DCPS_IR_Topic_Description.cpp:339–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void DCPS_IR_Topic_Description::associate(DCPS_IR_Publication* publication,
340 DCPS_IR_Subscription* subscription)
341{
342 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
343 OpenDDS::DCPS::RepoIdConverter pub_converter(publication->get_id());
344 OpenDDS::DCPS::RepoIdConverter sub_converter(subscription->get_id());
345 ACE_DEBUG((LM_DEBUG,
346 ACE_TEXT("(%P|%t) DCPS_IR_Topic_Description::associate: ")
347 ACE_TEXT("topic description %C associating ")
348 ACE_TEXT("publication %C with subscription %C.\n"),
349 this->name_.c_str(),
350 std::string(pub_converter).c_str(),
351 std::string(sub_converter).c_str()));
352 }
353
354 // The publication must be told first because it will be the connector
355 // if a data link needs to be created.
356 // This is only required if the publication and subscription are being
357 // handed by the same process and thread. Order when there is
358 // another thread or process is not important.
359 // Note: the client thread may process the add_associations() oneway
360 // call instead of the ORB thread because it is currently
361 // in a two-way call to the Repo.
362 int error = publication->add_associated_subscription(subscription, true);
363
364 // If there was no TAO error contacting the publication (This can happen if
365 // an old publisher has exited non-gracefully)
366 if (error != -1) {
367 // Associate the subscription with the publication
368 subscription->add_associated_publication(publication, false);
369 } else {
370 ACE_DEBUG((LM_INFO, ACE_TEXT("Invalid publication detected, NOT notifying subscription of association\n")));
371 }
372}
373
374void DCPS_IR_Topic_Description::reevaluate_associations(DCPS_IR_Subscription* subscription)
375{

Callers 3

initMethod · 0.45
initMethod · 0.45
run_testFunction · 0.45

Calls 3

get_idMethod · 0.45

Tested by

no test coverage detected