/******************************************************************************
* Icinga 2 *
- * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org) *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
#ifndef COLUMN_H
#define COLUMN_H
+#include "livestatus/i2-livestatus.hpp"
#include "base/value.hpp"
-#include <boost/function.hpp>
using namespace icinga;
namespace icinga
{
+enum LivestatusGroupByType {
+ LivestatusGroupByNone,
+ LivestatusGroupByHostGroup,
+ LivestatusGroupByServiceGroup
+};
+
class Column
{
public:
- typedef boost::function<Value (const Value&)> ValueAccessor;
- typedef boost::function<Value (const Value&)> ObjectAccessor;
+ typedef std::function<Value (const Value&)> ValueAccessor;
+ typedef std::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
- Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor);
+ Column(ValueAccessor valueAccessor, ObjectAccessor objectAccessor);
- Value ExtractValue(const Value& urow) const;
+ Value ExtractValue(const Value& urow, LivestatusGroupByType groupByType = LivestatusGroupByNone, const Object::Ptr& groupByObject = Empty) const;
private:
ValueAccessor m_ValueAccessor;