summaryrefslogtreecommitdiffstats
path: root/nci/jni/IntervalTimer.h
blob: 0f1095f72a2360f00412975926531130a5258546 (plain)
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
/*****************************************************************************
**
**  Name:           IntervalTimer.h
**
**  Description:    Asynchronous interval timer.
**
**  Copyright (c) 2012, Broadcom Corp., All Rights Reserved.
**  Proprietary and confidential.
**
*****************************************************************************/

#include <time.h>


class IntervalTimer
{
public:
    typedef void (*TIMER_FUNC) (union sigval);

    IntervalTimer();
    ~IntervalTimer();
    bool set(int ms, TIMER_FUNC cb);
    void kill();
    bool create(TIMER_FUNC );
    
private:
    timer_t mTimerId;
    TIMER_FUNC mCb;
};