OpenDDS::DCPS::DPMonitorImpl Class Reference

#include <DPMonitorImpl.h>

Inheritance diagram for OpenDDS::DCPS::DPMonitorImpl:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DPMonitorImpl (DomainParticipantImpl *dp, OpenDDS::DCPS::DomainParticipantReportDataWriter_ptr dp_writer)
virtual ~DPMonitorImpl ()
virtual void report ()

Private Attributes

DomainParticipantImpldp_
OpenDDS::DCPS::DomainParticipantReportDataWriter_var dp_writer_
std::string hostname_
pid_t pid_

Detailed Description

Definition at line 22 of file DPMonitorImpl.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::DPMonitorImpl::DPMonitorImpl ( DomainParticipantImpl dp,
OpenDDS::DCPS::DomainParticipantReportDataWriter_ptr  dp_writer 
)

Definition at line 18 of file DPMonitorImpl.cpp.

References hostname_, and pid_.

00020   : dp_(dp),
00021     dp_writer_(DomainParticipantReportDataWriter::_duplicate(dp_writer))
00022 {
00023   char host[256];
00024   ACE_OS::hostname(host, 256);
00025   hostname_ = host;
00026   pid_ = ACE_OS::getpid();
00027 }

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

Definition at line 29 of file DPMonitorImpl.cpp.

00030 {
00031 }


Member Function Documentation

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

Implements OpenDDS::DCPS::Monitor.

Definition at line 34 of file DPMonitorImpl.cpp.

References dp_, dp_writer_, OpenDDS::DCPS::DomainParticipantImpl::get_domain_id(), OpenDDS::DCPS::DomainParticipantImpl::get_id(), OpenDDS::DCPS::DomainParticipantImpl::get_topic_ids(), DDS::HANDLE_NIL, hostname_, and pid_.

00034                       {
00035   if (!CORBA::is_nil(this->dp_writer_.in())) {
00036     DomainParticipantReport report;
00037     report.host       = this->hostname_.c_str();
00038     report.pid        = this->pid_;
00039     report.dp_id      = this->dp_->get_id();
00040     report.domain_id  = this->dp_->get_domain_id();
00041     DomainParticipantImpl::TopicIdVec topics;
00042     this->dp_->get_topic_ids(topics);
00043     CORBA::ULong length = 0;
00044     report.topics.length(static_cast<CORBA::ULong>(topics.size()));
00045     for (DomainParticipantImpl::TopicIdVec::iterator iter = topics.begin();
00046          iter != topics.end();
00047          ++iter) {
00048       report.topics[length++] = *iter;
00049     }
00050     this->dp_writer_->write(report, DDS::HANDLE_NIL);
00051   }
00052 }


Member Data Documentation

DomainParticipantImpl* OpenDDS::DCPS::DPMonitorImpl::dp_ [private]

Definition at line 30 of file DPMonitorImpl.h.

Referenced by report().

OpenDDS::DCPS::DomainParticipantReportDataWriter_var OpenDDS::DCPS::DPMonitorImpl::dp_writer_ [private]

Definition at line 31 of file DPMonitorImpl.h.

Referenced by report().

std::string OpenDDS::DCPS::DPMonitorImpl::hostname_ [private]

Definition at line 32 of file DPMonitorImpl.h.

Referenced by DPMonitorImpl(), and report().

pid_t OpenDDS::DCPS::DPMonitorImpl::pid_ [private]

Definition at line 33 of file DPMonitorImpl.h.

Referenced by DPMonitorImpl(), and 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