Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | #include <functional> |
| 3 | #include <org/open_power/Sensor/Aggregation/History/Maximum/server.hpp> |
| 4 | |
| 5 | namespace witherspoon |
| 6 | { |
| 7 | namespace power |
| 8 | { |
| 9 | namespace history |
| 10 | { |
| 11 | |
| 12 | template <typename T> |
| 13 | using ServerObject = typename sdbusplus::server::object::object<T>; |
| 14 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 15 | using MaximumInterface = |
| 16 | sdbusplus::org::open_power::Sensor::Aggregation::History::server::Maximum; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 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 | */ |
| 26 | class Maximum : public ServerObject<MaximumInterface> |
| 27 | { |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 28 | public: |
| 29 | static constexpr auto name = "maximum"; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 30 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 31 | Maximum() = delete; |
| 32 | Maximum(const Maximum&) = delete; |
| 33 | Maximum& operator=(const Maximum&) = delete; |
| 34 | Maximum(Maximum&&) = delete; |
| 35 | Maximum& operator=(Maximum&&) = delete; |
| 36 | ~Maximum() = default; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 37 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 38 | /** |
| 39 | * @brief Constructor |
| 40 | * |
| 41 | * @param[in] bus - D-Bus object |
| 42 | * @param[in] objectPath - the D-Bus object path |
| 43 | */ |
| 44 | Maximum(sdbusplus::bus::bus& bus, const std::string& objectPath) : |
| 45 | ServerObject<MaximumInterface>(bus, objectPath.c_str()) |
| 46 | { |
| 47 | unit(Maximum::Unit::Watts); |
| 48 | scale(0); |
| 49 | } |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 50 | }; |
| 51 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 52 | } // namespace history |
| 53 | } // namespace power |
| 54 | } // namespace witherspoon |