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.

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_

Classes

struct  ScheduleEnableCommand

Detailed Description

Definition at line 376 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 378 of file RtpsUdpDataLink.h.

00379       : ReactorInterceptor(reactor, owner)
00380       , outer_(outer)
00381       , function_(function)
00382       , enabled_(false) {}


Member Function Documentation

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

Definition at line 2544 of file RtpsUdpDataLink.cpp.

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

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::send_heartbeats(), and OpenDDS::DCPS::RtpsUdpDataLink::stop_i().

02545 {
02546   if (enabled_) {
02547     outer_->get_reactor()->cancel_timer(this);
02548     enabled_ = false;
02549   }
02550 }

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

Definition at line 2527 of file RtpsUdpDataLink.cpp.

References OpenDDS::DCPS::RtpsUdpDataLink::config_, enabled_, OpenDDS::DCPS::RtpsUdpDataLink::get_reactor(), OpenDDS::DCPS::RtpsUdpInst::heartbeat_period_, and outer_.

02528 {
02529   if (!enabled_) {
02530     const ACE_Time_Value& per = outer_->config_->heartbeat_period_;
02531     const long timer =
02532       outer_->get_reactor()->schedule_timer(this, 0, ACE_Time_Value::zero, per);
02533 
02534     if (timer == -1) {
02535       ACE_DEBUG((LM_ERROR, "(%P|%t) RtpsUdpDataLink::HeartBeat::enable"
02536         " failed to schedule timer %p\n", ACE_TEXT("")));
02537     } else {
02538       enabled_ = true;
02539     }
02540   }
02541 }

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

Definition at line 390 of file RtpsUdpDataLink.h.

00391     {
00392       (outer_->*function_)();
00393       return 0;
00394     }

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

Implements OpenDDS::DCPS::ReactorInterceptor.

Definition at line 396 of file RtpsUdpDataLink.h.

00397     {
00398       return outer_->reactor_is_shut_down();
00399     }

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

Definition at line 384 of file RtpsUdpDataLink.h.

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::associated(), OpenDDS::DCPS::RtpsUdpDataLink::register_for_reader(), and OpenDDS::DCPS::RtpsUdpDataLink::register_for_writer().

00385     {
00386       ScheduleEnableCommand c(this);
00387       execute_or_enqueue(c);
00388     }


Member Data Documentation

bool OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::enabled_

Definition at line 406 of file RtpsUdpDataLink.h.

Referenced by disable(), and enable().

PMF OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::function_

Definition at line 405 of file RtpsUdpDataLink.h.

RtpsUdpDataLink* OpenDDS::DCPS::RtpsUdpDataLink::HeartBeat::outer_

Definition at line 404 of file RtpsUdpDataLink.h.

Referenced by disable(), and enable().


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