BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Main Page
Related Pages
Data Structures
Files
File List
base
src
model
ModuleID.h
1
#pragma once
2
3
#include <cstdint>
4
#include <string>
5
6
namespace
BeeeOn {
7
8
/*
9
* Represents the identification of a sensor module, type of a measured value
10
* (temperature, pressure, motion, ...).
11
*/
12
class
ModuleID
{
13
public
:
14
/*
15
* Construct ModuleID with default ModuleID.
16
*/
17
ModuleID
();
18
19
ModuleID
(
const
uint16_t &moduleID);
20
21
uint16_t value()
const
22
{
23
return
m_moduleID;
24
}
25
26
static
ModuleID
parse(
const
std::string &s);
27
28
std::string toString()
const
;
29
30
bool
operator !=(
const
ModuleID
&
id
)
const
31
{
32
return
m_moduleID !=
id
.m_moduleID;
33
}
34
35
bool
operator ==(
const
ModuleID
&
id
)
const
36
{
37
return
m_moduleID ==
id
.m_moduleID;
38
}
39
40
bool
operator <(
const
ModuleID
&
id
)
const
41
{
42
return
m_moduleID <
id
.m_moduleID;
43
}
44
45
bool
operator >(
const
ModuleID
&
id
)
const
46
{
47
return
m_moduleID >
id
.m_moduleID;
48
}
49
50
bool
operator <=(
const
ModuleID
&
id
)
const
51
{
52
return
m_moduleID <=
id
.m_moduleID;
53
}
54
55
bool
operator >=(
const
ModuleID
&
id
)
const
56
{
57
return
m_moduleID >=
id
.m_moduleID;
58
}
59
60
operator
unsigned
short()
const
61
{
62
return
m_moduleID;
63
}
64
65
operator
uint16_t()
66
{
67
return
m_moduleID;
68
}
69
70
private
:
71
uint16_t m_moduleID;
72
};
73
74
}
BeeeOn::ModuleID
Definition:
ModuleID.h:12
Generated by
1.8.5