Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 1 | #pragma once |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 2 | #include <org/open_power/Sensor/Aggregation/History/Maximum/server.hpp> |
| 3 | |
Patrick Williams | 2c4fbc4 | 2020-06-26 15:33:11 -0500 | [diff] [blame] | 4 | #include <functional> |
| 5 | |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 6 | namespace witherspoon |
| 7 | { |
| 8 | namespace power |
| 9 | { |
| 10 | namespace history |
| 11 | { |
| 12 | |
| 13 | template <typename T> |
| 14 | using ServerObject = typename sdbusplus::server::object::object<T>; |
| 15 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 16 | using MaximumInterface = |
| 17 | sdbusplus::org::open_power::Sensor::Aggregation::History::server::Maximum; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 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 | { |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 29 | public: |
| 30 | static constexpr auto name = "maximum"; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 31 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 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; |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 38 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 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 | } |
Matt Spinler | 7d24ee8 | 2018-01-18 13:56:12 -0600 | [diff] [blame] | 51 | }; |
| 52 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 53 | } // namespace history |
| 54 | } // namespace power |
| 55 | } // namespace witherspoon |