Repository navigation
Expand file tree
/
Copy pathEventID.cpp
More file actions
126 lines (109 loc) · 2.9 KB
/
Copy pathEventID.cpp
File metadata and controls
126 lines (109 loc) · 2.9 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*************************************************************
EventID
*************************************************************/
#include "EventID.h"
#if ENABLE_DEBUG_STRINGS == 1
EventID::EventID(const long _event_id) : debug_name(NULL){
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = pChar[2];
};
EventID::EventID(const int _event_id) : debug_name(NULL){
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = 0;
};
EventID::EventID(const long _event_id, _FLASH_STRING &_debug_name) : debug_name(&_debug_name) {
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = 0;
};
EventID::EventID(const int _event_id, _FLASH_STRING &_debug_name) : debug_name(&_debug_name) {
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = 0;
};
#else
EventID::EventID(const long _event_id){
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = pChar[2];
};
EventID::EventID(const int _event_id){
char* pChar;
pChar = (char*)&_event_id;
id[0] = pChar[0];
id[1] = pChar[1];
id[2] = 0;
};
#endif // ENABLE_DEBUG_STRINGS
bool EventID::operator> (const EventID &f) const {
return (long) * this > (long)f;
};
bool EventID::operator>=(const EventID &f) const {
return (long) * this >= (long)f;
};
bool EventID::operator==(const EventID &f) const {
return (long) * this == (long)f;
};
bool EventID::operator<=(const EventID &f) const {
return (long) * this <= (long)f;
};
bool EventID::operator< (const EventID &f) const {
return (long) * this < (long)f;
};
EventID EventID::operator| (const EventID &f) const {
return EventID((long) * this | (long)f);
};
EventID EventID::operator& (const EventID &f) const {
return EventID((long) * this & (long)f);
};
bool EventID::operator> (const long &i) const {
return (long) * this > i;
};
bool EventID::operator>=(const long &i) const {
return (long) * this >= i;
};
bool EventID::operator==(const long &i) const {
return (long) * this == i;
};
bool EventID::operator<=(const long &i) const {
return (long) * this <= i;
};
bool EventID::operator< (const long &i) const {
return (long) * this < i;
};
long EventID::operator| (const long &i) const {
return (long) *this | i;
};
long EventID::operator& (const long &i) const {
return (long) *this & i;
};
EventID::operator long () const {
return ((long)id[2] << 16) | ((long)id[1] << 8) | ((long)id[0] << 0);
};
bool operator> (const long &i, const EventID &f) {
return i > (long)f;
};
bool operator>=(const long &i, const EventID &f) {
return i >= (long)f;
};
bool operator==(const long &i, const EventID &f) {
return i == (long)f;
};
bool operator<=(const long &i, const EventID &f) {
return i <= (long)f;
};
bool operator< (const long &i, const EventID &f) {
return i < (long)f;
};