forked from pa-pa/AskSinPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alarm.h
51 lines (41 loc) · 1 KB
/
Alarm.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//- -----------------------------------------------------------------------------------------------------------------------
// AskSin++
// 2016-10-31 papa Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//- -----------------------------------------------------------------------------------------------------------------------
#ifndef __ALARM_H__
#define __ALARM_H__
#include "Link.h"
namespace as {
class AlarmClock;
class Alarm: public Link {
protected:
~Alarm() {}
bool m_Async : 4;
bool m_Active : 4;
public:
uint32_t tick : 24;
virtual void trigger(AlarmClock&) = 0;
Alarm(uint32_t t) :
m_Async(false), m_Active(0), tick(t) {
}
Alarm(uint32_t t,bool asynch) :
m_Async(asynch), m_Active(0), tick(t) {
}
void set(uint32_t t) {
tick = t;
}
void async(bool value) {
m_Async = value;
}
bool async() const {
return m_Async;
}
void active(bool value) {
m_Active = value;
}
bool active () const {
return m_Active;
}
};
}
#endif