NAME

ACE_Timer_Queue

SYNOPSIS

#include <ace/Timer_Queue.h>

class ACE_Timer_Queue { public: ACE_Timer_Queue (void); virtual ~ACE_Timer_Queue (void); virtual int is_empty (void) const = 0; virtual const ACE_Time_Value &earliest_time (void) const = 0; virtual int schedule ( ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, const ACE_Time_Value &interval = ACE_Time_Value::zero ) = 0; virtual int cancel (ACE_Event_Handler *event_handler) = 0; virtual int cancel (int timer_id, const void **arg = 0) = 0; virtual int expire (const ACE_Time_Value &current_time); virtual int expire (void); virtual ACE_Time_Value gettimeofday (void); void gettimeofday (ACE_Time_Value (*gettimeofday)(void)); virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max); void timer_skew (const ACE_Time_Value &skew); const ACE_Time_Value &timer_skew (void) const; virtual void dump (void) const; ACE_ALLOC_HOOK_DECLARE; protected: virtual void reschedule (ACE_Timer_Node *) = 0; virtual ACE_Timer_Queue_Iterator &iter (void) = 0; virtual ACE_Timer_Node *alloc_node (void) = 0; virtual void free_node (ACE_Timer_Node *) = 0; ACE_Recursive_Thread_Mutex lock_; ACE_Time_Value (*gettimeofday_)(void); private: ACE_Time_Value timeout_; ACE_Time_Value timer_skew_; ACE_Timer_Queue (const ACE_Timer_Queue &); void operator= (const ACE_Timer_Queue &); };

DESCRIPTION

This is an abstract base class that provides hook for implementing specialized policies such as ACE_Timer_List and ACE_Timer_Heap.

Initialization and termination methods.

ACE_Timer_Queue (void);

virtual ~ACE_Timer_Queue (void);

virtual int is_empty (void) const = 0;

virtual const ACE_Time_Value &earliest_time (void) const = 0;

virtual int schedule (
    ACE_Event_Handler *event_handler,
    const void *arg,
    const ACE_Time_Value &delay,
    const ACE_Time_Value &interval = ACE_Time_Value::zero
    ) = 0;

virtual int cancel (ACE_Event_Handler *event_handler) = 0;

virtual int cancel (int timer_id, const void **arg = 0) = 0;

virtual int expire (const ACE_Time_Value &current_time);

virtual int expire (void);

virtual ACE_Time_Value gettimeofday (void);

void gettimeofday (ACE_Time_Value (*gettimeofday)(void));

virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max);

Set/get the timer skew for the Timer_Queue.

void timer_skew (const ACE_Time_Value &skew);

const ACE_Time_Value &timer_skew (void) const;

virtual void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

Don't allow these operations for now.

ACE_Timer_Queue (const ACE_Timer_Queue &);

void operator= (const ACE_Timer_Queue &);

AUTHOR

Doug Schmidt

TITLE

Provides an interface to timers.

LIBRARY

ace