1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace metric_definition
5 {
6 // clang-format off
7 
8 enum class MetricType{
9     Invalid,
10     Numeric,
11     Discrete,
12     Gauge,
13     Counter,
14     Countdown,
15     String,
16 };
17 
18 enum class ImplementationType{
19     Invalid,
20     PhysicalSensor,
21     Calculated,
22     Synthesized,
23     DigitalMeter,
24 };
25 
26 enum class MetricDataType{
27     Invalid,
28     Boolean,
29     DateTime,
30     Decimal,
31     Integer,
32     String,
33     Enumeration,
34 };
35 
36 enum class Calculable{
37     Invalid,
38     NonCalculatable,
39     Summable,
40     NonSummable,
41 };
42 
43 enum class CalculationAlgorithmEnum{
44     Invalid,
45     Average,
46     Maximum,
47     Minimum,
48     OEM,
49 };
50 
51 NLOHMANN_JSON_SERIALIZE_ENUM(MetricType, {
52     {MetricType::Invalid, "Invalid"},
53     {MetricType::Numeric, "Numeric"},
54     {MetricType::Discrete, "Discrete"},
55     {MetricType::Gauge, "Gauge"},
56     {MetricType::Counter, "Counter"},
57     {MetricType::Countdown, "Countdown"},
58     {MetricType::String, "String"},
59 });
60 
61 NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, {
62     {ImplementationType::Invalid, "Invalid"},
63     {ImplementationType::PhysicalSensor, "PhysicalSensor"},
64     {ImplementationType::Calculated, "Calculated"},
65     {ImplementationType::Synthesized, "Synthesized"},
66     {ImplementationType::DigitalMeter, "DigitalMeter"},
67 });
68 
69 NLOHMANN_JSON_SERIALIZE_ENUM(MetricDataType, {
70     {MetricDataType::Invalid, "Invalid"},
71     {MetricDataType::Boolean, "Boolean"},
72     {MetricDataType::DateTime, "DateTime"},
73     {MetricDataType::Decimal, "Decimal"},
74     {MetricDataType::Integer, "Integer"},
75     {MetricDataType::String, "String"},
76     {MetricDataType::Enumeration, "Enumeration"},
77 });
78 
79 NLOHMANN_JSON_SERIALIZE_ENUM(Calculable, {
80     {Calculable::Invalid, "Invalid"},
81     {Calculable::NonCalculatable, "NonCalculatable"},
82     {Calculable::Summable, "Summable"},
83     {Calculable::NonSummable, "NonSummable"},
84 });
85 
86 NLOHMANN_JSON_SERIALIZE_ENUM(CalculationAlgorithmEnum, {
87     {CalculationAlgorithmEnum::Invalid, "Invalid"},
88     {CalculationAlgorithmEnum::Average, "Average"},
89     {CalculationAlgorithmEnum::Maximum, "Maximum"},
90     {CalculationAlgorithmEnum::Minimum, "Minimum"},
91     {CalculationAlgorithmEnum::OEM, "OEM"},
92 });
93 
94 }
95 // clang-format on
96