OpenDDS::DCPS::Watchdog Class Reference

Watchdog abstract base class. More...

#include <Watchdog.h>

Inheritance diagram for OpenDDS::DCPS::Watchdog:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::Watchdog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void reset_interval (const ACE_Time_Value &interval)
long schedule_timer (const void *act, const ACE_Time_Value &interval)
long schedule_timer (const void *act, const ACE_Time_Value &delay, const ACE_Time_Value &interval)
int cancel_timer (long timer_id)
 Cancel a specific timer.
void cancel_all ()
 Cancel all associated timers.
int reset_timer_interval (long timer_id)
 Reset interval for a specific timer.

Protected Member Functions

 Watchdog (const ACE_Time_Value &interval)
virtual ~Watchdog ()

Protected Attributes

ACE_Time_Value interval_
 Current time interval.

Private Member Functions

virtual void reschedule_deadline ()=0
 Re-schedule timer with new interval.
bool reactor_is_shut_down () const

Detailed Description

Watchdog abstract base class.

A Watchdog object executes an operation each time a corresponding timer expires. The timer is managed by this class. However, it is the responsibility of the Watchdog owner, for example, to run the ACE_Reactor event loop. The Watchdog timer will not fire, otherwise.

Definition at line 35 of file Watchdog.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::Watchdog::Watchdog ( const ACE_Time_Value interval  )  [explicit, protected]

Definition at line 86 of file Watchdog.cpp.

00087   : ReactorInterceptor(TheServiceParticipant->reactor(),
00088                        TheServiceParticipant->reactor_owner())
00089   , interval_(interval)
00090 {
00091 }

OpenDDS::DCPS::Watchdog::~Watchdog (  )  [protected, virtual]

Definition at line 93 of file Watchdog.cpp.

00094 {
00095 }


Member Function Documentation

void OpenDDS::DCPS::Watchdog::cancel_all (  ) 

Cancel all associated timers.

Definition at line 131 of file Watchdog.cpp.

References c, and OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue().

00132 {
00133   CancelCommand c(this, -1);
00134   execute_or_enqueue(c);
00135 }

Here is the call graph for this function:

int OpenDDS::DCPS::Watchdog::cancel_timer ( long  timer_id  ) 

Cancel a specific timer.

Definition at line 124 of file Watchdog.cpp.

References c, and OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue().

00125 {
00126   CancelCommand c(this, timer_id);
00127   execute_or_enqueue(c);
00128   return 1;
00129 }

Here is the call graph for this function:

bool OpenDDS::DCPS::Watchdog::reactor_is_shut_down (  )  const [private, virtual]

Implements OpenDDS::DCPS::ReactorInterceptor.

Definition at line 97 of file Watchdog.cpp.

References TheServiceParticipant.

00098 {
00099   return TheServiceParticipant->is_shut_down();
00100 }

virtual void OpenDDS::DCPS::Watchdog::reschedule_deadline (  )  [private, pure virtual]

Re-schedule timer with new interval.

Implemented in OpenDDS::DCPS::DataReaderImpl_T< MessageType >::FilterDelayedHandler, OpenDDS::DCPS::OfferedDeadlineWatchdog, and OpenDDS::DCPS::RequestedDeadlineWatchdog.

Referenced by reset_interval().

Here is the caller graph for this function:

void OpenDDS::DCPS::Watchdog::reset_interval ( const ACE_Time_Value interval  ) 

Reset the Watchdog timer interval, i.e. time between recurring timer expirations.

Note:
The new interval takes effect after the next expiration. This behavior is dictated by the ACE_Reactor.

Definition at line 102 of file Watchdog.cpp.

References interval_, and reschedule_deadline().

00103 {
00104   if (this->interval_ != interval) {
00105     this->interval_ = interval;
00106     this->reschedule_deadline();
00107   }
00108 }

Here is the call graph for this function:

int OpenDDS::DCPS::Watchdog::reset_timer_interval ( long  timer_id  ) 

Reset interval for a specific timer.

Definition at line 137 of file Watchdog.cpp.

References c, OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue(), and interval_.

00138 {
00139   ResetCommand c(this, timer_id, interval_);
00140   execute_or_enqueue(c);
00141   return 0;
00142 }

Here is the call graph for this function:

long OpenDDS::DCPS::Watchdog::schedule_timer ( const void *  act,
const ACE_Time_Value delay,
const ACE_Time_Value interval 
)

Schedule with the Watchdog timer delay and timer interval, i.e. time between recurring timer expirations.

Definition at line 115 of file Watchdog.cpp.

References c, OpenDDS::DCPS::ReactorInterceptor::execute_or_enqueue(), and OpenDDS::DCPS::ReactorInterceptor::wait().

00116 {
00117   long timer_id = -1;
00118   ScheduleCommand c(this, act, delay, interval, &timer_id);
00119   execute_or_enqueue(c);
00120   wait();
00121   return timer_id;
00122 }

Here is the call graph for this function:

long OpenDDS::DCPS::Watchdog::schedule_timer ( const void *  act,
const ACE_Time_Value interval 
)

Schedule with the Watchdog timer interval, i.e. time between recurring timer expirations.

Definition at line 110 of file Watchdog.cpp.

00111 {
00112   return schedule_timer(act, interval, interval);
00113 }


Member Data Documentation


The documentation for this class 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