blob: 6b667f228f5996e2359c2a9f70597a69ab71e898 [file] [log] [blame]
#pragma once
#include <org/open_power/Sensor/Aggregation/History/Average/server.hpp>
#include <functional>
namespace witherspoon
{
namespace power
{
namespace history
{
template <typename T>
using ServerObject = typename sdbusplus::server::object_t<T>;
using AverageInterface =
sdbusplus::org::open_power::Sensor::Aggregation::History::server::Average;
/**
* @class Average
*
* Implements Sensor.Aggregation.History.Average
*
* This includes a property that is an array of timestamp/average tuples
* and a property to specify the scale.
*/
class Average : public ServerObject<AverageInterface>
{
public:
static constexpr auto name = "average";
Average() = delete;
Average(const Average&) = delete;
Average& operator=(const Average&) = delete;
Average(Average&&) = delete;
Average& operator=(Average&&) = delete;
~Average() = default;
/**
* @brief Constructor
*
* @param[in] bus - D-Bus object
* @param[in] objectPath - the D-Bus object path
*/
Average(sdbusplus::bus_t& bus, const std::string& objectPath) :
ServerObject<AverageInterface>(bus, objectPath.c_str())
{
unit(Average::Unit::Watts);
scale(0);
}
};
} // namespace history
} // namespace power
} // namespace witherspoon