#include <DWMonitorImpl.h>
Inheritance diagram for OpenDDS::DCPS::DWMonitorImpl:
Public Member Functions | |
DWMonitorImpl (DataWriterImpl *dw, OpenDDS::DCPS::DataWriterReportDataWriter_ptr dw_writer) | |
virtual | ~DWMonitorImpl () |
virtual void | report () |
Private Attributes | |
DataWriterImpl * | dw_ |
OpenDDS::DCPS::DataWriterReportDataWriter_var | dw_writer_ |
Definition at line 22 of file DWMonitorImpl.h.
OpenDDS::DCPS::DWMonitorImpl::DWMonitorImpl | ( | DataWriterImpl * | dw, | |
OpenDDS::DCPS::DataWriterReportDataWriter_ptr | dw_writer | |||
) |
Definition at line 18 of file DWMonitorImpl.cpp.
00020 : dw_(dw), 00021 dw_writer_(DataWriterReportDataWriter::_duplicate(dw_writer)) 00022 { 00023 }
OpenDDS::DCPS::DWMonitorImpl::~DWMonitorImpl | ( | ) | [virtual] |
void OpenDDS::DCPS::DWMonitorImpl::report | ( | ) | [virtual] |
Implements OpenDDS::DCPS::Monitor.
Definition at line 30 of file DWMonitorImpl.cpp.
References dw_, dw_writer_, OpenDDS::DCPS::DataWriterImpl::get_dp_id(), OpenDDS::DCPS::DataWriterImpl::get_instance_handles(), OpenDDS::DCPS::DataWriterImpl::get_publication_id(), OpenDDS::DCPS::DataWriterImpl::get_publisher(), OpenDDS::DCPS::DataWriterImpl::get_readers(), OpenDDS::DCPS::DataWriterImpl::get_topic(), and DDS::HANDLE_NIL.
00030 { 00031 if (!CORBA::is_nil(this->dw_writer_.in())) { 00032 DataWriterReport report; 00033 report.dp_id = this->dw_->get_dp_id(); 00034 DDS::Publisher_var pub = this->dw_->get_publisher(); 00035 report.pub_handle = pub->get_instance_handle(); 00036 report.dw_id = this->dw_->get_publication_id(); 00037 DDS::Topic_var topic = this->dw_->get_topic(); 00038 report.topic_id = dynamic_cast<TopicImpl*>(topic.in())->get_id(); 00039 DataWriterImpl::InstanceHandleVec instances; 00040 this->dw_->get_instance_handles(instances); 00041 CORBA::ULong length = 0; 00042 report.instances.length(static_cast<CORBA::ULong>(instances.size())); 00043 for (DataWriterImpl::InstanceHandleVec::iterator iter = instances.begin(); 00044 iter != instances.end(); 00045 ++iter) { 00046 report.instances[length++] = *iter; 00047 } 00048 DCPS::RepoIdSet readers; 00049 this->dw_->get_readers(readers); 00050 length = 0; 00051 report.associations.length(static_cast<CORBA::ULong>(readers.size())); 00052 for (DCPS::RepoIdSet::iterator iter = readers.begin(); 00053 iter != readers.end(); 00054 ++iter) { 00055 report.associations[length].dr_id = *iter; 00056 length++; 00057 } 00058 this->dw_writer_->write(report, DDS::HANDLE_NIL); 00059 } 00060 }
DataWriterImpl* OpenDDS::DCPS::DWMonitorImpl::dw_ [private] |
OpenDDS::DCPS::DataWriterReportDataWriter_var OpenDDS::DCPS::DWMonitorImpl::dw_writer_ [private] |