OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat Struct Reference

Inheritance diagram for OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat:
Collaboration graph
[legend]

List of all members.

Classes

struct  ScheduleEnableCommand

Public Member Functions

 HeartBeat (ACE_Reactor *reactor, ACE_thread_t owner, RtpsUdpDataLink *outer, PMF function)
void schedule_enable ()
int handle_timeout (const ACE_Time_Value &, const void *)
bool reactor_is_shut_down () const
void enable ()
void disable ()

Public Attributes

RtpsUdpDataLinkouter_
PMF function_
bool enabled_

Detailed Description

Definition at line 406 of file RtpsUdpDataLink.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::HeartBeat ( ACE_Reactor reactor,
ACE_thread_t  owner,
RtpsUdpDataLink outer,
PMF  function 
) [inline, explicit]

Definition at line 408 of file RtpsUdpDataLink.h.

00409       : ReactorInterceptor(reactor, owner)
00410       , outer_(outer)
00411       , function_(function)
00412       , enabled_(false) {}


Member Function Documentation

void OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::disable (  ) 

Definition at line 2791 of file RtpsUdpDataLink.cpp.

References ACE_Reactor::cancel_timer(), enabled_, OpenDDS::DCPS::RtpsUdpDataLink::get_reactor(), and outer_.

02792 {
02793   if (enabled_) {
02794     outer_->get_reactor()->cancel_timer(this);
02795     enabled_ = false;
02796   }
02797 }

Here is the call graph for this function:

void OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::enable (  ) 

Definition at line 2774 of file RtpsUdpDataLink.cpp.

References ACE_TEXT(), OpenDDS::DCPS::RtpsUdpDataLink::config(), enabled_, OpenDDS::DCPS::RtpsUdpDataLink::get_reactor(), OpenDDS::DCPS::RtpsUdpInst::heartbeat_period_, LM_ERROR, outer_, ACE_Reactor::schedule_timer(), and ACE_Time_Value::zero.

02775 {
02776   if (!enabled_) {
02777     const ACE_Time_Value& per = outer_->config().heartbeat_period_;
02778     const long timer =
02779       outer_->get_reactor()->schedule_timer(this, 0, ACE_Time_Value::zero, per);
02780 
02781     if (timer == -1) {
02782       ACE_ERROR((LM_ERROR, "(%P|%t) RtpsUdpDataLink::HeartBeat::enable"
02783         " failed to schedule timer %p\n", ACE_TEXT("")));
02784     } else {
02785       enabled_ = true;
02786     }
02787   }
02788 }

Here is the call graph for this function:

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

Reimplemented from ACE_Event_Handler.

Definition at line 420 of file RtpsUdpDataLink.h.

00421     {
00422       (outer_->*function_)();
00423       return 0;
00424     }

bool OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::reactor_is_shut_down (  )  const [inline, virtual]

Implements OpenDDS::DCPS::ReactorInterceptor.

Definition at line 426 of file RtpsUdpDataLink.h.

00427     {
00428       return outer_->reactor_is_shut_down();
00429     }

void OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::schedule_enable (  )  [inline]

Definition at line 414 of file RtpsUdpDataLink.h.

References c.

00415     {
00416       ScheduleEnableCommand c(this);
00417       execute_or_enqueue(c);
00418     }


Member Data Documentation

Definition at line 436 of file RtpsUdpDataLink.h.

Referenced by disable(), and enable().

Definition at line 435 of file RtpsUdpDataLink.h.

Definition at line 434 of file RtpsUdpDataLink.h.

Referenced by disable(), and enable().


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1