| 28 | } |
| 29 | |
| 30 | void |
| 31 | DWMonitorImpl::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 | } |
nothing calls this directly
no test coverage detected