#include <DPMonitorImpl.h>
Inheritance diagram for OpenDDS::DCPS::DPMonitorImpl:
Public Member Functions | |
DPMonitorImpl (DomainParticipantImpl *dp, OpenDDS::DCPS::DomainParticipantReportDataWriter_ptr dp_writer) | |
virtual | ~DPMonitorImpl () |
virtual void | report () |
Private Attributes | |
DomainParticipantImpl * | dp_ |
OpenDDS::DCPS::DomainParticipantReportDataWriter_var | dp_writer_ |
std::string | hostname_ |
pid_t | pid_ |
Definition at line 22 of file DPMonitorImpl.h.
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] |
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 }
OpenDDS::DCPS::DomainParticipantReportDataWriter_var OpenDDS::DCPS::DPMonitorImpl::dp_writer_ [private] |
std::string OpenDDS::DCPS::DPMonitorImpl::hostname_ [private] |
pid_t OpenDDS::DCPS::DPMonitorImpl::pid_ [private] |