blob: e1fbffccf27ef1a878483427681629d8da2d5c4a [file] [log] [blame]
Matt Spinler7d24ee82018-01-18 13:56:12 -06001#pragma once
2#include <functional>
3#include <org/open_power/Sensor/Aggregation/History/Maximum/server.hpp>
4
5namespace witherspoon
6{
7namespace power
8{
9namespace history
10{
11
12template <typename T>
13using ServerObject = typename sdbusplus::server::object::object<T>;
14
15using MaximumInterface = sdbusplus::org::open_power::
16 Sensor::Aggregation::History::server::Maximum;
17
18/**
19 * @class Maximum
20 *
21 * Implements Sensor.Aggregation.History.Maximum
22 *
23 * This includes a property that is an array of timestamp/maximum tuples
24 * and a property to specify the scale.
25 */
26class Maximum : public ServerObject<MaximumInterface>
27{
28 public:
29
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,
46 const std::string& objectPath) :
47 ServerObject<MaximumInterface>(bus, objectPath.c_str())
48 {
49 unit(Maximum::Unit::Watts);
50 scale(0);
51 }
52};
53
54
55}
56}
57}