Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
32
Src/timer/timerapi.cpp
Normal file
32
Src/timer/timerapi.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "api.h"
|
||||
#include "timerapi.h"
|
||||
#include "tmultiplex.h"
|
||||
|
||||
//timer_api *timerApi = NULL;
|
||||
|
||||
TimerApi::TimerApi()
|
||||
{
|
||||
}
|
||||
|
||||
TimerApi::~TimerApi()
|
||||
{
|
||||
multiplex.shutdown();
|
||||
}
|
||||
|
||||
TimerToken TimerApi::timer_add(TimerClient *client, intptr_t id, int ms)
|
||||
{
|
||||
multiplex.add(client, id, ms);
|
||||
return id;
|
||||
}
|
||||
|
||||
void TimerApi::timer_remove(TimerClient *client, TimerToken id)
|
||||
{
|
||||
multiplex.remove(client, id);
|
||||
}
|
||||
|
||||
#define CBCLASS TimerApi
|
||||
START_DISPATCH;
|
||||
CB(TIMER_API_ADD, timer_add);
|
||||
VCB(TIMER_API_REMOVE, timer_remove);
|
||||
END_DISPATCH;
|
||||
#undef CBCLASS
|
Loading…
Add table
Add a link
Reference in a new issue