#include <DPMonitorImpl.h>
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 24 of file DPMonitorImpl.h.
OpenDDS::DCPS::DPMonitorImpl::DPMonitorImpl | ( | DomainParticipantImpl * | dp, | |
OpenDDS::DCPS::DomainParticipantReportDataWriter_ptr | dp_writer | |||
) |
Definition at line 19 of file DPMonitorImpl.cpp.
References _duplicate(), ACE_OS::getpid(), ACE_OS::hostname(), hostname_, and pid_.
00021 : dp_(dp), 00022 dp_writer_(DomainParticipantReportDataWriter::_duplicate(dp_writer)) 00023 { 00024 char host[256]; 00025 ACE_OS::hostname(host, 256); 00026 hostname_ = host; 00027 pid_ = ACE_OS::getpid(); 00028 }
OpenDDS::DCPS::DPMonitorImpl::~DPMonitorImpl | ( | ) | [virtual] |
Definition at line 30 of file DPMonitorImpl.cpp.
void OpenDDS::DCPS::DPMonitorImpl::report | ( | void | ) | [virtual] |
Implements OpenDDS::DCPS::Monitor.
Definition at line 35 of file DPMonitorImpl.cpp.
References OpenDDS::DCPS::DomainParticipantReport::domain_id, dp_, OpenDDS::DCPS::DomainParticipantReport::dp_id, dp_writer_, OpenDDS::DCPS::DomainParticipantImpl::get_domain_id(), OpenDDS::DCPS::DomainParticipantImpl::get_id(), OpenDDS::DCPS::DomainParticipantImpl::get_topic_ids(), DDS::HANDLE_NIL, OpenDDS::DCPS::DomainParticipantReport::host, hostname_, CORBA::is_nil(), OpenDDS::DCPS::DomainParticipantReport::pid, pid_, and OpenDDS::DCPS::DomainParticipantReport::topics.
00035 { 00036 if (!CORBA::is_nil(this->dp_writer_.in())) { 00037 DomainParticipantReport report; 00038 report.host = this->hostname_.c_str(); 00039 report.pid = this->pid_; 00040 report.dp_id = this->dp_->get_id(); 00041 report.domain_id = this->dp_->get_domain_id(); 00042 DomainParticipantImpl::TopicIdVec topics; 00043 this->dp_->get_topic_ids(topics); 00044 CORBA::ULong length = 0; 00045 report.topics.length(static_cast<CORBA::ULong>(topics.size())); 00046 for (DomainParticipantImpl::TopicIdVec::iterator iter = topics.begin(); 00047 iter != topics.end(); 00048 ++iter) { 00049 report.topics[length++] = *iter; 00050 } 00051 this->dp_writer_->write(report, DDS::HANDLE_NIL); 00052 } 00053 }
Definition at line 32 of file DPMonitorImpl.h.
Referenced by report().
OpenDDS::DCPS::DomainParticipantReportDataWriter_var OpenDDS::DCPS::DPMonitorImpl::dp_writer_ [private] |
Definition at line 33 of file DPMonitorImpl.h.
Referenced by report().
std::string OpenDDS::DCPS::DPMonitorImpl::hostname_ [private] |
Definition at line 34 of file DPMonitorImpl.h.
Referenced by DPMonitorImpl(), and report().
pid_t OpenDDS::DCPS::DPMonitorImpl::pid_ [private] |
Definition at line 35 of file DPMonitorImpl.h.
Referenced by DPMonitorImpl(), and report().