OpenDDS::DCPS::DRMonitorImpl Class Reference

#include <DRMonitorImpl.h>

Inheritance diagram for OpenDDS::DCPS::DRMonitorImpl:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DRMonitorImpl (DataReaderImpl *dr, OpenDDS::DCPS::DataReaderReportDataWriter_ptr dr_writer)
virtual ~DRMonitorImpl ()
virtual void report ()

Private Attributes

DataReaderImpldr_
OpenDDS::DCPS::DataReaderReportDataWriter_var dr_writer_

Detailed Description

Definition at line 22 of file DRMonitorImpl.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::DRMonitorImpl::DRMonitorImpl ( DataReaderImpl dr,
OpenDDS::DCPS::DataReaderReportDataWriter_ptr  dr_writer 
)

Definition at line 18 of file DRMonitorImpl.cpp.

00020   : dr_(dr),
00021     dr_writer_(DataReaderReportDataWriter::_duplicate(dr_writer))
00022 {
00023 }

OpenDDS::DCPS::DRMonitorImpl::~DRMonitorImpl (  )  [virtual]

Definition at line 25 of file DRMonitorImpl.cpp.

00026 {
00027 }


Member Function Documentation

void OpenDDS::DCPS::DRMonitorImpl::report (  )  [virtual]

Implements OpenDDS::DCPS::Monitor.

Definition at line 30 of file DRMonitorImpl.cpp.

References dr_, dr_writer_, OpenDDS::DCPS::DataReaderImpl::get_dp_id(), OpenDDS::DCPS::DataReaderImpl::get_instance_handles(), OpenDDS::DCPS::DataReaderImpl::get_subscriber(), OpenDDS::DCPS::DataReaderImpl::get_subscription_id(), OpenDDS::DCPS::DataReaderImpl::get_topic_id(), OpenDDS::DCPS::DataReaderImpl::get_writer_states(), and DDS::HANDLE_NIL.

00030                       {
00031   if (!CORBA::is_nil(this->dr_writer_.in())) {
00032     DataReaderReport report;
00033     report.dp_id = this->dr_->get_dp_id();
00034     DDS::Subscriber_var sub = this->dr_->get_subscriber();
00035     report.sub_handle = sub->get_instance_handle();
00036     report.dr_id   = this->dr_->get_subscription_id();
00037     report.topic_id = this->dr_->get_topic_id();
00038     DataReaderImpl::InstanceHandleVec instances;
00039     this->dr_->get_instance_handles(instances);
00040     CORBA::ULong length = 0;
00041     report.instances.length(static_cast<CORBA::ULong>(instances.size()));
00042     for (DataReaderImpl::InstanceHandleVec::iterator iter = instances.begin();
00043          iter != instances.end();
00044          ++iter) {
00045       report.instances[length++] = *iter;
00046     }
00047     DataReaderImpl::WriterStatePairVec writer_states;
00048     this->dr_->get_writer_states(writer_states);
00049     length = 0;
00050     report.associations.length(static_cast<CORBA::ULong>(writer_states.size()));
00051     for (DataReaderImpl::WriterStatePairVec::iterator iter = writer_states.begin();
00052          iter != writer_states.end();
00053          ++iter) {
00054       report.associations[length].dw_id = iter->first;
00055       report.associations[length].state = iter->second;
00056       length++;
00057     }
00058     this->dr_writer_->write(report, DDS::HANDLE_NIL);
00059   }
00060 }


Member Data Documentation

DataReaderImpl* OpenDDS::DCPS::DRMonitorImpl::dr_ [private]

Definition at line 30 of file DRMonitorImpl.h.

Referenced by report().

OpenDDS::DCPS::DataReaderReportDataWriter_var OpenDDS::DCPS::DRMonitorImpl::dr_writer_ [private]

Definition at line 31 of file DRMonitorImpl.h.

Referenced by report().


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