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 | |
RtpsUdpDataLink * | outer_ |
PMF | function_ |
bool | enabled_ |
Classes | |
struct | ScheduleEnableCommand |
Definition at line 376 of file RtpsUdpDataLink.h.
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) {}
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] |
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 }
Definition at line 405 of file RtpsUdpDataLink.h.