icinga2/lib/livestatus/aggregator.hpp

45 lines
762 B
C++
Raw Normal View History

/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef AGGREGATOR_H
#define AGGREGATOR_H
2015-02-26 09:02:45 +01:00
#include "livestatus/i2-livestatus.hpp"
2014-05-25 16:23:35 +02:00
#include "livestatus/table.hpp"
#include "livestatus/filter.hpp"
namespace icinga
{
/**
* @ingroup livestatus
*/
2017-12-31 07:22:16 +01:00
struct AggregatorState
{
virtual ~AggregatorState();
};
/**
* @ingroup livestatus
*/
2017-12-31 07:22:16 +01:00
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;
2017-12-13 12:54:14 +01:00
Filter::Ptr GetFilter() const;
2017-12-13 12:54:14 +01:00
private:
Filter::Ptr m_Filter;
};
}
#endif /* AGGREGATOR_H */