#include <TransportMonitorImpl.h>
Inheritance diagram for OpenDDS::DCPS::TransportMonitorImpl:
Public Member Functions | |
TransportMonitorImpl (TransportImpl *transport, OpenDDS::DCPS::TransportReportDataWriter_ptr transport_writer) | |
virtual | ~TransportMonitorImpl () |
virtual void | report () |
Private Types | |
typedef std::vector< TransportReport > | TransportReportVec |
Private Attributes | |
OpenDDS::DCPS::TransportReportDataWriter_var | transport_writer_ |
std::string | hostname_ |
pid_t | pid_ |
Static Private Attributes | |
static ACE_Recursive_Thread_Mutex | queue_lock_ |
static TransportReportVec | queue_ |
Definition at line 24 of file TransportMonitorImpl.h.
typedef std::vector<TransportReport> OpenDDS::DCPS::TransportMonitorImpl::TransportReportVec [private] |
Definition at line 36 of file TransportMonitorImpl.h.
OpenDDS::DCPS::TransportMonitorImpl::TransportMonitorImpl | ( | TransportImpl * | transport, | |
OpenDDS::DCPS::TransportReportDataWriter_ptr | transport_writer | |||
) |
Definition at line 20 of file TransportMonitorImpl.cpp.
References hostname_, and pid_.
00022 : transport_writer_(TransportReportDataWriter::_duplicate(transport_writer)) 00023 { 00024 char host[256]; 00025 ACE_OS::hostname(host, 256); 00026 hostname_ = host; 00027 pid_ = ACE_OS::getpid(); 00028 }
OpenDDS::DCPS::TransportMonitorImpl::~TransportMonitorImpl | ( | ) | [virtual] |
void OpenDDS::DCPS::TransportMonitorImpl::report | ( | ) | [virtual] |
Implements OpenDDS::DCPS::Monitor.
Definition at line 35 of file TransportMonitorImpl.cpp.
References DDS::HANDLE_NIL, hostname_, pid_, queue_, and transport_writer_.
00035 { 00036 // ACE_DEBUG((LM_DEBUG, "TransportMonitorImpl::report()\n")); 00037 TransportReport report; 00038 report.host = this->hostname_.c_str(); 00039 report.pid = this->pid_; 00040 // TODO: remove/replace 00041 report.transport_id = 0; 00042 report.transport_type = ""; 00043 // ACE_GUARD(ACE_Recursive_Thread_Mutex, guard, queue_lock_); 00044 if (!CORBA::is_nil(this->transport_writer_.in())) { 00045 if (this->queue_.size()) { 00046 // ACE_DEBUG((LM_DEBUG, "TransportMonitorImpl::report(): popping\n")); 00047 for (unsigned int i = 0; i < this->queue_.size(); i++) { 00048 // ACE_DEBUG((LM_DEBUG, "TransportMonitorImpl::report(): writing, id = %d\n", 00049 // this->queue_[i].transport_id)); 00050 this->transport_writer_->write(this->queue_[i], DDS::HANDLE_NIL); 00051 } 00052 this->queue_.clear(); 00053 } 00054 // ACE_DEBUG((LM_DEBUG, "TransportMonitorImpl::report(): writing, id = %d\n", 00055 // report.transport_id)); 00056 this->transport_writer_->write(report, DDS::HANDLE_NIL); 00057 } else { 00058 // ACE_DEBUG((LM_DEBUG, "TransportMonitorImpl::report(): queueing, id = %d\n", 00059 // report.transport_id)); 00060 queue_.push_back(report); 00061 } 00062 }
std::string OpenDDS::DCPS::TransportMonitorImpl::hostname_ [private] |
Definition at line 33 of file TransportMonitorImpl.h.
Referenced by report(), and TransportMonitorImpl().
pid_t OpenDDS::DCPS::TransportMonitorImpl::pid_ [private] |
Definition at line 34 of file TransportMonitorImpl.h.
Referenced by report(), and TransportMonitorImpl().
ACE_Recursive_Thread_Mutex OpenDDS::DCPS::TransportMonitorImpl::queue_lock_ [static, private] |
Definition at line 37 of file TransportMonitorImpl.h.
OpenDDS::DCPS::TransportReportDataWriter_var OpenDDS::DCPS::TransportMonitorImpl::transport_writer_ [private] |