40#include <BaServerLib.h>
42#include <DoubleList.h>
46#define BA_TIMER_SLOTS 32
52typedef BaBool (*BaTimer_CB)(
void* data);
87 size_t set(BaTimer_CB cb,
void* data, U32 milliSec);
94 int reset(
size_t tkey, U32 milliSec);
108 DoubleList slots[BA_TIMER_SLOTS];
121BA_API
void BaTimer_constructor(
124BA_API
void BaTimer_destructor(
BaTimer* o);
125BA_API
size_t BaTimer_set(
BaTimer* o, BaTimer_CB cb,
void* data, U32 milliSec);
126BA_API
int BaTimer_reset(
BaTimer* o,
size_t tkey, U32 milliSec);
127BA_API
int BaTimer_cancel(
BaTimer* o,
size_t tkey);
132 BaTimer_constructor(
this, mutex, stackSize, ticklen, priority,alloc);
135 BaTimer_destructor(
this);
138 return BaTimer_set(
this, cb, data, milliSec);
141 return BaTimer_reset(
this, tkey, milliSec);
144 return BaTimer_cancel(
this, tkey);
ThreadPriority
Thread priority list.
Definition: ThreadLib.h:58
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
Timer manager used for one-shot and periodic callbacks.
Definition: BaTimer.h:62
BaTimer(ThreadMutex *mutex, int stackSize, U32 ticklen=10, ThreadPriority priority=ThreadPrioNormal, AllocatorIntf *alloc=0)
Create a BaTimer object and its worker thread.
Definition: BaTimer.h:130
~BaTimer()
Terminate the timer.
Definition: BaTimer.h:134
size_t set(BaTimer_CB cb, void *data, U32 milliSec)
Create a timer event.
Definition: BaTimer.h:137
int reset(size_t tkey, U32 milliSec)
Resets the timer.
Definition: BaTimer.h:140
int cancel(size_t tkey)
Cancels the timer.
Definition: BaTimer.h:143
A mutual exclusion class.
Definition: ThreadLib.h:186
A simple thread class.
Definition: ThreadLib.h:241