NAME

ACE_Timer_Hash_T - Provides a hash table of BUCKETs as an implementation for a timer queue.

SYNOPSIS

#include <ace/Timer_Hash_T.h>

template<class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET> class ACE_Timer_Hash_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> { public: typedef ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> HASH_ITERATOR; friend class ACE_Timer_Hash_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET>; typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> INHERITED; ACE_Timer_Hash_T ( size_t table_size, FUNCTOR *upcall_functor = 0, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0 ); ACE_Timer_Hash_T ( FUNCTOR *upcall_functor = 0, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0 ); virtual ~ACE_Timer_Hash_T (void); virtual int is_empty (void) const; virtual const ACE_Time_Value &earliest_time (void) const; virtual long schedule ( const TYPE &type, const void *act, const ACE_Time_Value &delay, const ACE_Time_Value &interval = ACE_Time_Value::zero ); virtual int reset_interval ( long timer_id, const ACE_Time_Value &interval ); virtual int cancel ( const TYPE &type, int dont_call_handle_close = 1 ); virtual int cancel ( long timer_id, const void **act = 0, int dont_call_handle_close = 1 ); virtual int expire (void); virtual int expire (const ACE_Time_Value &current_time); virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &iter ( void ); virtual ACE_Timer_Node_T<TYPE> *remove_first (void); virtual void dump (void) const; virtual ACE_Timer_Node_T<TYPE> *get_first (void); private: virtual void reschedule (ACE_Timer_Node_T<TYPE> *); void find_new_earliest (void); size_t size_; BUCKET **table_; size_t table_size_; ACE_Timer_Hash_Upcall<TYPE, FUNCTOR, ACE_LOCK> table_functor_; size_t earliest_position_; HASH_ITERATOR *iterator_; inline ACE_UNIMPLEMENTED_FUNC ( ACE_Timer_Hash_T (const ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> &) ); };

DESCRIPTION

This implementation uses a hash table of BUCKETs. The hash is based on the time_value of the event. Unlike other Timer Queues, ACE_Timer_Hash does not expire events in order.

Initialization and termination methods.

ACE_Timer_Hash_T (
    size_t table_size,
    FUNCTOR *upcall_functor = 0,
    ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0
    );

ACE_Timer_Hash_T (
    FUNCTOR *upcall_functor = 0,
    ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0
    );

virtual ~ACE_Timer_Hash_T (void);

virtual int is_empty (void) const;

virtual const ACE_Time_Value &earliest_time (void) const;

virtual long schedule (
    const TYPE &type,
    const void *act,
    const ACE_Time_Value &delay,
    const ACE_Time_Value &interval = ACE_Time_Value::zero
    );

virtual int reset_interval (
    long timer_id,
    const ACE_Time_Value &interval
    );

virtual int cancel (const TYPE &type, int dont_call_handle_close = 1);

virtual int cancel (
    long timer_id,
    const void **act = 0,
    int dont_call_handle_close = 1
    );

virtual int expire (void);

virtual int expire (const ACE_Time_Value &current_time);

virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &iter (
    void
    );

virtual ACE_Timer_Node_T<TYPE> *remove_first (void);

virtual void dump (void) const;

virtual ACE_Timer_Node_T<TYPE> *get_first (void);

Don't allow these operations for now.

inline ACE_UNIMPLEMENTED_FUNC (
    ACE_Timer_Hash_T (const ACE_Timer_Hash_T<TYPE, FUNCTOR, ACE_LOCK, BUCKET> &)
    );

AUTHOR

Darrell Brunsch brunsch@cs.wustl.edu

LIBRARY

ace