aboutsummaryrefslogtreecommitdiff
path: root/Src/timer/timerapi.cpp
blob: d0ed1f8737dd93fee46636d8743e7878a8bbd2bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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