#include <PublisherMonitorImpl.h>
Inheritance diagram for OpenDDS::DCPS::PublisherMonitorImpl:
Public Member Functions | |
PublisherMonitorImpl (PublisherImpl *pub, OpenDDS::DCPS::PublisherReportDataWriter_ptr pub_writer) | |
virtual | ~PublisherMonitorImpl () |
virtual void | report () |
Private Attributes | |
PublisherImpl * | pub_ |
OpenDDS::DCPS::PublisherReportDataWriter_var | pub_writer_ |
Definition at line 22 of file PublisherMonitorImpl.h.
OpenDDS::DCPS::PublisherMonitorImpl::PublisherMonitorImpl | ( | PublisherImpl * | pub, | |
OpenDDS::DCPS::PublisherReportDataWriter_ptr | pub_writer | |||
) |
Definition at line 19 of file PublisherMonitorImpl.cpp.
00021 : pub_(pub), 00022 pub_writer_(PublisherReportDataWriter::_duplicate(pub_writer)) 00023 { 00024 }
OpenDDS::DCPS::PublisherMonitorImpl::~PublisherMonitorImpl | ( | ) | [virtual] |
void OpenDDS::DCPS::PublisherMonitorImpl::report | ( | ) | [virtual] |
Implements OpenDDS::DCPS::Monitor.
Definition at line 31 of file PublisherMonitorImpl.cpp.
References OpenDDS::DCPS::PublisherImpl::get_instance_handle(), OpenDDS::DCPS::PublisherImpl::get_participant(), OpenDDS::DCPS::PublisherImpl::get_publication_ids(), DDS::HANDLE_NIL, pub_, and pub_writer_.
00031 { 00032 if (!CORBA::is_nil(this->pub_writer_.in())) { 00033 PublisherReport report; 00034 report.handle = pub_->get_instance_handle(); 00035 DDS::DomainParticipant_var dp = pub_->get_participant(); 00036 report.dp_id = dynamic_cast<DomainParticipantImpl*>(dp.in())->get_id(); 00037 TransportImpl_rch ti; //TODO: transport = pub_->get_transport_impl(); 00038 // TODO: remove/replace 00039 report.transport_id = 0; 00040 PublisherImpl::PublicationIdVec writers; 00041 pub_->get_publication_ids(writers); 00042 CORBA::ULong length = 0; 00043 report.writers.length(static_cast<CORBA::ULong>(writers.size())); 00044 for (PublisherImpl::PublicationIdVec::iterator iter = writers.begin(); 00045 iter != writers.end(); 00046 ++iter) { 00047 report.writers[length++] = *iter; 00048 } 00049 this->pub_writer_->write(report, DDS::HANDLE_NIL); 00050 } 00051 }
OpenDDS::DCPS::PublisherReportDataWriter_var OpenDDS::DCPS::PublisherMonitorImpl::pub_writer_ [private] |