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