]> granicus.if.org Git - icinga2/blobdiff - lib/livestatus/column.hpp
Move CompatUtility::GetCheckableInCheckPeriod() into Livestatus feature
[icinga2] / lib / livestatus / column.hpp
index 6bd3a814e069adfde3155b7a6634a3909c4661d8..4cc132ab7bc940dfe1f68d0d8190edff18f69056 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * 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;