#include <SubscriberMonitorImpl.h>
Inheritance diagram for OpenDDS::DCPS::SubscriberMonitorImpl:
Public Member Functions | |
SubscriberMonitorImpl (SubscriberImpl *sub, OpenDDS::DCPS::SubscriberReportDataWriter_ptr sub_writer) | |
virtual | ~SubscriberMonitorImpl () |
virtual void | report () |
Private Attributes | |
SubscriberImpl * | sub_ |
OpenDDS::DCPS::SubscriberReportDataWriter_var | sub_writer_ |
Definition at line 22 of file SubscriberMonitorImpl.h.
OpenDDS::DCPS::SubscriberMonitorImpl::SubscriberMonitorImpl | ( | SubscriberImpl * | sub, | |
OpenDDS::DCPS::SubscriberReportDataWriter_ptr | sub_writer | |||
) |
Definition at line 19 of file SubscriberMonitorImpl.cpp.
00021 : sub_(sub), 00022 sub_writer_(SubscriberReportDataWriter::_duplicate(sub_writer)) 00023 { 00024 }
OpenDDS::DCPS::SubscriberMonitorImpl::~SubscriberMonitorImpl | ( | ) | [virtual] |
void OpenDDS::DCPS::SubscriberMonitorImpl::report | ( | ) | [virtual] |
Implements OpenDDS::DCPS::Monitor.
Definition at line 31 of file SubscriberMonitorImpl.cpp.
References OpenDDS::DCPS::SubscriberImpl::get_instance_handle(), OpenDDS::DCPS::SubscriberImpl::get_participant(), OpenDDS::DCPS::SubscriberImpl::get_subscription_ids(), DDS::HANDLE_NIL, sub_, and sub_writer_.
00031 { 00032 if (!CORBA::is_nil(this->sub_writer_.in())) { 00033 SubscriberReport report; 00034 report.handle = sub_->get_instance_handle(); 00035 DDS::DomainParticipant_var dp = sub_->get_participant(); 00036 report.dp_id = dynamic_cast<DomainParticipantImpl*>(dp.in())->get_id(); 00037 TransportImpl_rch ti; //TODO: transport = sub_->get_transport_impl(); 00038 // TODO: remove transport_id and replace with name 00039 report.transport_id = 0; 00040 SubscriberImpl::SubscriptionIdVec readers; 00041 sub_->get_subscription_ids(readers); 00042 CORBA::ULong length = 0; 00043 report.readers.length(static_cast<CORBA::ULong>(readers.size())); 00044 for (SubscriberImpl::SubscriptionIdVec::iterator iter = readers.begin(); 00045 iter != readers.end(); 00046 ++iter) { 00047 report.readers[length++] = *iter; 00048 } 00049 this->sub_writer_->write(report, DDS::HANDLE_NIL); 00050 } 00051 }
OpenDDS::DCPS::SubscriberReportDataWriter_var OpenDDS::DCPS::SubscriberMonitorImpl::sub_writer_ [private] |