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

Method report

dds/monitor/DWMonitorImpl.cpp:30–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void
31DWMonitorImpl::report() {
32 if (!CORBA::is_nil(dw_writer_.in())) {
33 DataWriterReport report;
34 report.dp_id = dw_->get_dp_id();
35 DDS::Publisher_var pub = dw_->get_publisher();
36 report.pub_handle = pub->get_instance_handle();
37 report.dw_id = dw_->get_guid();
38 DDS::Topic_var topic = dw_->get_topic();
39 OpenDDS::DCPS::TopicImpl* ti = dynamic_cast<DCPS::TopicImpl*>(topic.in());
40 if (!ti) {
41 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) DWMonitorImpl::report():")
42 ACE_TEXT(" failed to obtain TopicImpl.\n")));
43 return;
44 }
45 report.topic_id = ti->get_id();
46 DCPS::DataWriterImpl::InstanceHandleVec instances;
47 dw_->get_instance_handles(instances);
48 CORBA::ULong length = 0;
49 report.instances.length(static_cast<CORBA::ULong>(instances.size()));
50 for (DCPS::DataWriterImpl::InstanceHandleVec::iterator iter = instances.begin();
51 iter != instances.end();
52 ++iter) {
53 report.instances[length++] = *iter;
54 }
55 DCPS::RepoIdSet readers;
56 dw_->get_readers(readers);
57 length = 0;
58 report.associations.length(static_cast<CORBA::ULong>(readers.size()));
59 for (DCPS::RepoIdSet::iterator iter = readers.begin();
60 iter != readers.end();
61 ++iter) {
62 report.associations[length].dr_id = *iter;
63 length++;
64 }
65 dw_writer_->write(report, DDS::HANDLE_NIL);
66 }
67}
68
69}
70}

Callers

nothing calls this directly

Calls 14

get_publisherMethod · 0.80
get_readersMethod · 0.80
inMethod · 0.45
get_dp_idMethod · 0.45
get_instance_handleMethod · 0.45
get_guidMethod · 0.45
get_topicMethod · 0.45
get_idMethod · 0.45
get_instance_handlesMethod · 0.45
lengthMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected