1 #pragma once
2 #include <org/open_power/Sensor/Aggregation/History/Maximum/server.hpp>
3 
4 #include <functional>
5 
6 namespace phosphor
7 {
8 namespace power
9 {
10 namespace history
11 {
12 
13 template <typename T>
14 using ServerObject = typename sdbusplus::server::object::object<T>;
15 
16 using MaximumInterface =
17     sdbusplus::org::open_power::Sensor::Aggregation::History::server::Maximum;
18 
19 /**
20  * @class Maximum
21  *
22  * Implements Sensor.Aggregation.History.Maximum
23  *
24  * This includes a property that is an array of timestamp/maximum tuples
25  * and a property to specify the scale.
26  */
27 class Maximum : public ServerObject<MaximumInterface>
28 {
29   public:
30     static constexpr auto name = "maximum";
31 
32     Maximum() = delete;
33     Maximum(const Maximum&) = delete;
34     Maximum& operator=(const Maximum&) = delete;
35     Maximum(Maximum&&) = delete;
36     Maximum& operator=(Maximum&&) = delete;
37     ~Maximum() = default;
38 
39     /**
40      * @brief Constructor
41      *
42      * @param[in] bus - D-Bus object
43      * @param[in] objectPath - the D-Bus object path
44      */
45     Maximum(sdbusplus::bus::bus& bus, const std::string& objectPath) :
46         ServerObject<MaximumInterface>(bus, objectPath.c_str())
47     {
48         unit(Maximum::Unit::Watts);
49         scale(0);
50     }
51 };
52 
53 } // namespace history
54 } // namespace power
55 } // namespace phosphor
56