DevNode.h
Go to the documentation of this file.
1 
20 #pragma once
21 
22 #include <Data/BitSet.h>
23 #include <vector>
24 
25 namespace IO
26 {
30 struct DevNode {
31  using List = std::vector<DevNode>;
32  using ID = uint16_t;
33  ID id{};
34 
35  // For a normal on/off output node
36  enum class State {
37  off,
38  on,
39  someon,
40  unknown,
41  MAX,
42  };
43 
44  using States = BitSet<uint8_t, State, size_t(State::MAX)>;
45 
46  bool operator==(const DevNode& other) const
47  {
48  return id == other.id;
49  }
50 };
51 
52 // Special value to indicate all nodes
53 static constexpr DevNode DevNode_ALL{0xFFFF};
54 
56 
57 } // namespace IO
Manage a set of bit values using enumeration.
Definition: BitSet.h:45
Definition: IOControl/include/IO/Controller.h:26
DevNode::State getState(DevNode::States states)
static constexpr DevNode DevNode_ALL
Definition: DevNode.h:53
Identifies a device node.
Definition: DevNode.h:30
bool operator==(const DevNode &other) const
Definition: DevNode.h:46
std::vector< DevNode > List
Definition: DevNode.h:31
ID id
Definition: DevNode.h:33
uint16_t ID
Definition: DevNode.h:32
State
Definition: DevNode.h:36