OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay Struct Reference

Collaboration diagram for OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TimedDelay (RtpsUdpDataLink *outer, PMF function, const ACE_Time_Value &timeout)
void schedule ()
void cancel ()
int handle_timeout (const ACE_Time_Value &, const void *)

Public Attributes

RtpsUdpDataLinkouter_
PMF function_
ACE_Time_Value timeout_
bool scheduled_

Detailed Description

Definition at line 352 of file RtpsUdpDataLink.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::TimedDelay ( RtpsUdpDataLink outer,
PMF  function,
const ACE_Time_Value &  timeout 
) [inline]

Definition at line 354 of file RtpsUdpDataLink.h.

00356       : outer_(outer), function_(function), timeout_(timeout), scheduled_(false)
00357     {}


Member Function Documentation

void OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::cancel (  ) 

Definition at line 2518 of file RtpsUdpDataLink.cpp.

References OpenDDS::DCPS::RtpsUdpDataLink::get_reactor(), outer_, and scheduled_.

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::stop_i().

02519 {
02520   if (scheduled_) {
02521     outer_->get_reactor()->cancel_timer(this);
02522     scheduled_ = false;
02523   }
02524 }

int OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::handle_timeout ( const ACE_Time_Value &  ,
const void *   
) [inline]

Definition at line 362 of file RtpsUdpDataLink.h.

00363     {
00364       scheduled_ = false;
00365       (outer_->*function_)();
00366       return 0;
00367     }

void OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::schedule (  ) 

Definition at line 2503 of file RtpsUdpDataLink.cpp.

References OpenDDS::DCPS::RtpsUdpDataLink::get_reactor(), outer_, scheduled_, and timeout_.

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::received().

02504 {
02505   if (!scheduled_) {
02506     const long timer = outer_->get_reactor()->schedule_timer(this, 0, timeout_);
02507 
02508     if (timer == -1) {
02509       ACE_DEBUG((LM_ERROR, "(%P|%t) RtpsUdpDataLink::TimedDelay::schedule "
02510         "failed to schedule timer %p\n", ACE_TEXT("")));
02511     } else {
02512       scheduled_ = true;
02513     }
02514   }
02515 }


Member Data Documentation

PMF OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::function_

Definition at line 370 of file RtpsUdpDataLink.h.

RtpsUdpDataLink* OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::outer_

Definition at line 369 of file RtpsUdpDataLink.h.

Referenced by cancel(), and schedule().

bool OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::scheduled_

Definition at line 372 of file RtpsUdpDataLink.h.

Referenced by cancel(), and schedule().

ACE_Time_Value OpenDDS::DCPS::RtpsUdpDataLink::TimedDelay::timeout_

Definition at line 371 of file RtpsUdpDataLink.h.

Referenced by schedule().


The documentation for this struct was generated from the following files:
Generated on Fri Feb 12 20:06:36 2016 for OpenDDS by  doxygen 1.4.7