xref: /openbmc/pldm/common/types.hpp (revision f7f5da97)
1 #pragma once
2 
3 #include <stdint.h>
4 
5 #include <set>
6 #include <string>
7 #include <variant>
8 #include <vector>
9 
10 namespace pldm
11 {
12 
13 namespace dbus
14 {
15 
16 using ObjectPath = std::string;
17 using Service = std::string;
18 using Interface = std::string;
19 using Interfaces = std::vector<std::string>;
20 using Property = std::string;
21 using PropertyType = std::string;
22 using Value = std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
23                            int64_t, uint64_t, double, std::string>;
24 
25 } // namespace dbus
26 
27 namespace pdr
28 {
29 
30 using TerminusHandle = uint16_t;
31 using TerminusID = uint16_t;
32 using SensorID = uint16_t;
33 using EntityType = uint16_t;
34 using EntityInstance = uint16_t;
35 using ContainerID = uint16_t;
36 using CompositeCount = uint8_t;
37 using SensorOffset = uint8_t;
38 using EventState = uint8_t;
39 
40 //!< Subset of the State Set that is supported by a effecter/sensor
41 using PossibleStates = std::set<uint8_t>;
42 //!< Subset of the State Set that is supported by each effecter/sensor in a
43 //!< composite efffecter/sensor
44 using CompositeSensorStates = std::vector<PossibleStates>;
45 using EntityInfo = std::tuple<ContainerID, EntityType, EntityInstance>;
46 using SensorInfo = std::tuple<EntityInfo, CompositeSensorStates>;
47 
48 } // namespace pdr
49 
50 } // namespace pldm
51