From 56ae875861ab260b80a030f50c4aff9f9dc8fff0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:32:39 +0200 Subject: Adding upstream version 2.14.2. Signed-off-by: Daniel Baumann --- lib/livestatus/aggregator.hpp | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/livestatus/aggregator.hpp (limited to 'lib/livestatus/aggregator.hpp') diff --git a/lib/livestatus/aggregator.hpp b/lib/livestatus/aggregator.hpp new file mode 100644 index 0000000..1c0f778 --- /dev/null +++ b/lib/livestatus/aggregator.hpp @@ -0,0 +1,44 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +#ifndef AGGREGATOR_H +#define AGGREGATOR_H + +#include "livestatus/i2-livestatus.hpp" +#include "livestatus/table.hpp" +#include "livestatus/filter.hpp" + +namespace icinga +{ + +/** + * @ingroup livestatus + */ +struct AggregatorState +{ + virtual ~AggregatorState(); +}; + +/** + * @ingroup livestatus + */ +class Aggregator : public Object +{ +public: + DECLARE_PTR_TYPEDEFS(Aggregator); + + virtual void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) = 0; + virtual double GetResultAndFreeState(AggregatorState *state) const = 0; + void SetFilter(const Filter::Ptr& filter); + +protected: + Aggregator() = default; + + Filter::Ptr GetFilter() const; + +private: + Filter::Ptr m_Filter; +}; + +} + +#endif /* AGGREGATOR_H */ -- cgit v1.2.3