Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Async_Timer_Queue_Adapter Class Template Reference

Adapts a <TQ> to be run asynchronously. More...

`#include <Timer_Queue_Adapters.h>`

Inheritance diagram for ACE_Async_Timer_Queue_Adapter:

[legend]
Collaboration diagram for ACE_Async_Timer_Queue_Adapter:

[legend]
List of all members.

## Public Types
typedef TQ | TIMER_QUEUE
## Public Methods
| ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask=0)
| Register the SIGALRM handler. More...
long | schedule (ACE_Event_Handler *type, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval=ACE_Time_Value::zero)
| This timer gets dispatched via a signal, rather than by a user calling <expire>. More...
int | cancel (long timer_id, const void **act=0)
| Cancel the <timer_id> and pass back the <act> if an address is passed in. More...
int | expire (void)
| Dispatch all timers whose values are <= <cur_time>. Returns the number of timers canceled. More...
TQ & | timer_queue (void)
| Access the underlying <TIMER_QUEUE>. More...
## Private Methods
virtual int | schedule_ualarm (void)
| Perform the logic to compute the new ualarm(2) setting. More...
virtual int | handle_signal (int signum, siginfo_t *, ucontext_t *)
| Called back by <SIGALRM> handler. More...
## Private Attributes
ACE_Sig_Handler | sig_handler_
| Handler for the <SIGALRM> signal, so that we can access our state without requiring any global variables. More...
TQ | timer_queue_
| Implementation of the timer queue (e.g., <ACE_Timer_List>, <ACE_Timer_Heap>, etc.). More...
ACE_Sig_Set | mask_
| Mask of signals to be blocked when we're servicing <SIGALRM>. More...

## Detailed Description

### template<class TQ>
class ACE_Async_Timer_Queue_Adapter< TQ >

Adapts a <TQ> to be run asynchronously.

This implementation uses the <ualarm> call, which generates the SIGARLM signal that is caught by this class.

## Member Typedef Documentation

template<class TQ>
typedef TQ ACE_Async_Timer_Queue_Adapter::TIMER_QUEUE

## Constructor & Destructor Documentation

template<class TQ>
ACE_Async_Timer_Queue_Adapter< TQ >::ACE_Async_Timer_Queue_Adapter | ( | ACE_Sig_Set * | mask = 0 | ) |

| Register the SIGALRM handler. If <mask> == 0 then block all signals when <SIGALRM> is run. Otherwise, just block the signals indicated in <mask>.

## Member Function Documentation

template<class TQ>
int ACE_Async_Timer_Queue_Adapter< TQ >::cancel | ( | long | timer_id,
|  | const void ** | act = 0
| ) |

| Cancel the <timer_id> and pass back the <act> if an address is passed in.

template<class TQ>
int ACE_Async_Timer_Queue_Adapter< TQ >::expire | ( | void |  | ) |

| Dispatch all timers whose values are <= <cur_time>. Returns the number of timers canceled.

template<class TQ>
int ACE_Async_Timer_Queue_Adapter< TQ >::handle_signal | ( | int | signum,
|  | siginfo_t * | siginfo,
|  | ucontext_t * | ucontext
| ) | `[private, virtual]`

| Called back by <SIGALRM> handler. Reimplemented from ACE_Event_Handler.

template<class TQ>
long ACE_Async_Timer_Queue_Adapter< TQ >::schedule | ( | ACE_Event_Handler * | eh,
|  | const void * | act,
|  | const ACE_Time_Value & | future_time,
|  | const ACE_Time_Value & | interval = ACE_Time_Value::zero
| ) |

| This timer gets dispatched via a signal, rather than by a user calling <expire>. Note that interval timers are not implemented yet.

template<class TQ>
int ACE_Async_Timer_Queue_Adapter< TQ >::schedule_ualarm | ( | void |  | ) | `[private, virtual]`

| Perform the logic to compute the new ualarm(2) setting.

template<class TQ>
TQ & ACE_Async_Timer_Queue_Adapter< TQ >::timer_queue | ( | void |  | ) |

| Access the underlying <TIMER_QUEUE>.

## Member Data Documentation

template<class TQ>
ACE_Sig_Set ACE_Async_Timer_Queue_Adapter::mask_`[private]`

| Mask of signals to be blocked when we're servicing <SIGALRM>.

template<class TQ>
ACE_Sig_Handler ACE_Async_Timer_Queue_Adapter::sig_handler_`[private]`

| Handler for the <SIGALRM> signal, so that we can access our state without requiring any global variables.

template<class TQ>
TQ ACE_Async_Timer_Queue_Adapter::timer_queue_`[private]`

| Implementation of the timer queue (e.g., <ACE_Timer_List>, <ACE_Timer_Heap>, etc.).

The documentation for this class was generated from the following files:

- Timer_Queue_Adapters.h
- Timer_Queue_Adapters.cpp