OpenDDS::DCPS::SubscriberMonitorImpl Class Reference

#include <SubscriberMonitorImpl.h>

Inheritance diagram for OpenDDS::DCPS::SubscriberMonitorImpl:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::SubscriberMonitorImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SubscriberMonitorImpl (SubscriberImpl *sub, OpenDDS::DCPS::SubscriberReportDataWriter_ptr sub_writer)
virtual ~SubscriberMonitorImpl ()
virtual void report ()

Private Attributes

SubscriberImplsub_
OpenDDS::DCPS::SubscriberReportDataWriter_var sub_writer_

Detailed Description

Definition at line 22 of file SubscriberMonitorImpl.h.


Constructor & Destructor Documentation

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]

Definition at line 26 of file SubscriberMonitorImpl.cpp.

00027 {
00028 }


Member Function Documentation

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 }


Member Data Documentation

SubscriberImpl* OpenDDS::DCPS::SubscriberMonitorImpl::sub_ [private]

Definition at line 30 of file SubscriberMonitorImpl.h.

Referenced by report().

OpenDDS::DCPS::SubscriberReportDataWriter_var OpenDDS::DCPS::SubscriberMonitorImpl::sub_writer_ [private]

Definition at line 31 of file SubscriberMonitorImpl.h.

Referenced by report().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:43 2016 for OpenDDS by  doxygen 1.4.7