Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# OsclTimer< Alloc > Class Template Reference

`#include <oscl_timer.h>`

Inheritance diagram for OsclTimer< Alloc >:

## Public Types
typedef CallbackTimer< Alloc > | callback_timer_type
## Public Methods
| OsclTimer (const char *name, uint32 frequency=1, int32 priority=OsclActiveObject::EPriorityNominal)
virtual | ~OsclTimer ()
void | SetObserver (OsclTimerObserver *obs)
void | SetFrequency (uint32 frequency)
void | SetExactFrequency (uint32 frequency)
void | Request (int32 timerID, int32 timeoutInfo, int32 cycles, OsclTimerObserver *obs=0, bool recurring=0)
void | Cancel (int32 timerID, int32 timeoutInfo=-1)
void | Clear ()
## Protected Methods
void | TimerBaseElapsed ()
## Friends
class | CallbackTimer< Alloc >

### template<class Alloc>
class OsclTimer< Alloc >

## Member Typedef Documentation

template<class Alloc>
typedef CallbackTimer<Alloc> OsclTimer< Alloc >::callback_timer_type

## Constructor & Destructor Documentation

template<class Alloc>
OsclTimer< Alloc >::OsclTimer | ( | const char * | name,
|  | uint32 | frequency = 1,
|  | int32 | priority = OsclActiveObject::EPriorityNominal
| ) |

  | Constructor Parameters:
  frequency | The frequency of the timer in cycles/second. A value of 1 means the timer will cycle in 1 second intervals.

template<class Alloc>
OsclTimer< Alloc >::~OsclTimer | ( |  | ) | `[virtual]`

## Member Function Documentation

template<class Alloc>
void OsclTimer< Alloc >::Cancel | ( | int32 | timerID,
|  | int32 | timeoutInfo = -1
| ) |

  | Cancel a timer Parameters:
  timerID | used to identify the timer to cancel.
  timeoutInfo | if not set to -1, this value will be used as additional matching criteria to cancel a timer.

template<class Alloc>
void OsclTimer< Alloc >::Clear | ( |  | ) |

| Cancel all pending timers.

template<class Alloc>
void OsclTimer< Alloc >::Request | ( | int32 | timerID,
|  | int32 | timeoutInfo,
|  | int32 | cycles,
|  | OsclTimerObserver * | obs = 0,
|  | bool | recurring = 0
| ) |

  | Request a timer Parameters:
  timerID | used to identify the timer for cancellation. This value will be returned as part of the timeout event.
  timeoutInfo | for user info. Returned to the observer on a timeout event
  cycles | the number of cycles to wait before a timeout event. If the timer frequency is 1 and the cycles are set to 2, then the timeout event will occur in 2 seconds.
  obs | a local observer object to be called on a timeout event. This observer overides the global observer if set.

template<class Alloc>
void OsclTimer< Alloc >::SetExactFrequency | ( | uint32 | frequency | ) |

  | Set the exact frequency of the timer in microsecond. Parameters:
  frequency | A value of 1 means the timer will cycle in one microsecond intervals, 1000 means millisecond intervals, etc.

template<class Alloc>
void OsclTimer< Alloc >::SetFrequency | ( | uint32 | frequency | ) |

  | Set the frequency of the timer in cycles/second. Parameters:
  frequency | A value of 1 means the timer will cycle in one second intervals, 1000 means millisecond intervals, etc.

template<class Alloc>
void OsclTimer< Alloc >::SetObserver | ( | OsclTimerObserver * | obs | ) | `[inline]`

  | Set the global observer. Each timer can request a local observer, which if set overrides the global observer. Parameters:
  obs | observer object.

template<class Alloc>
void OsclTimer< Alloc >::TimerBaseElapsed | ( |  | ) | `[protected, virtual]`

| Implements CallbackTimerObserver.

## Friends And Related Function Documentation

template<class Alloc>
friend class CallbackTimer< Alloc >`[friend]`

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

- oscl_timer.h