Module: check_mk
Branch: master
Commit: 61f7fa7c664788d0c259d2c1db55fbc137f1a8d9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=61f7fa7c664788…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Aug 10 09:23:11 2017 +0200
Const-corrected DoubleColumn::getValue().
Change-Id: I7acbe250c20c4671e327a6c0481bfc9574dc2cbf
---
livestatus/src/DoubleColumn.h | 2 +-
livestatus/src/DoublePointerColumn.h | 2 +-
livestatus/src/HostSpecialDoubleColumn.cc | 2 +-
livestatus/src/HostSpecialDoubleColumn.h | 2 +-
livestatus/src/OffsetDoubleColumn.cc | 2 +-
livestatus/src/OffsetDoubleColumn.h | 2 +-
livestatus/src/ServiceSpecialDoubleColumn.cc | 2 +-
livestatus/src/ServiceSpecialDoubleColumn.h | 2 +-
livestatus/src/TableEventConsole.h | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/livestatus/src/DoubleColumn.h b/livestatus/src/DoubleColumn.h
index 6988e51..696fe93 100644
--- a/livestatus/src/DoubleColumn.h
+++ b/livestatus/src/DoubleColumn.h
@@ -42,7 +42,7 @@ public:
int indirect_offset, int extra_offset, int extra_extra_offset)
: Column(name, description, indirect_offset, extra_offset,
extra_extra_offset) {}
- virtual double getValue(Row data) = 0;
+ virtual double getValue(Row data) const = 0;
void output(Row row, RowRenderer &r, contact *auth_user) override;
ColumnType type() const override { return ColumnType::double_; }
std::unique_ptr<Filter> createFilter(RelationalOperator relOp,
diff --git a/livestatus/src/DoublePointerColumn.h b/livestatus/src/DoublePointerColumn.h
index 316e8f2..f1b8de1 100644
--- a/livestatus/src/DoublePointerColumn.h
+++ b/livestatus/src/DoublePointerColumn.h
@@ -34,7 +34,7 @@ public:
const double *number)
: DoubleColumn(name, description, -1, -1, -1), _number(number) {}
- double getValue(Row) override { return *_number; }
+ double getValue(Row) const override { return *_number; }
private:
const double *const _number;
diff --git a/livestatus/src/HostSpecialDoubleColumn.cc
b/livestatus/src/HostSpecialDoubleColumn.cc
index 22771eb..aca26bd 100644
--- a/livestatus/src/HostSpecialDoubleColumn.cc
+++ b/livestatus/src/HostSpecialDoubleColumn.cc
@@ -29,7 +29,7 @@
extern int interval_length;
-double HostSpecialDoubleColumn::getValue(Row row) {
+double HostSpecialDoubleColumn::getValue(Row row) const {
if (auto hst = columnData<host>(row)) {
switch (_type) {
case Type::staleness: {
diff --git a/livestatus/src/HostSpecialDoubleColumn.h
b/livestatus/src/HostSpecialDoubleColumn.h
index d8345de..ca3a861 100644
--- a/livestatus/src/HostSpecialDoubleColumn.h
+++ b/livestatus/src/HostSpecialDoubleColumn.h
@@ -41,7 +41,7 @@ public:
: DoubleColumn(name, description, indirect, extra_offset,
extra_extra_offset)
, _type(hsdc_type) {}
- double getValue(Row row) override;
+ double getValue(Row row) const override;
private:
Type _type;
diff --git a/livestatus/src/OffsetDoubleColumn.cc b/livestatus/src/OffsetDoubleColumn.cc
index fb68961..3435cce 100644
--- a/livestatus/src/OffsetDoubleColumn.cc
+++ b/livestatus/src/OffsetDoubleColumn.cc
@@ -26,7 +26,7 @@
#include "Column.h"
#include "Row.h"
-double OffsetDoubleColumn::getValue(Row row) {
+double OffsetDoubleColumn::getValue(Row row) const {
if (auto p = columnData<void>(row)) {
return *offset_cast<double>(p, _offset);
}
diff --git a/livestatus/src/OffsetDoubleColumn.h b/livestatus/src/OffsetDoubleColumn.h
index f923d5e..a690030 100644
--- a/livestatus/src/OffsetDoubleColumn.h
+++ b/livestatus/src/OffsetDoubleColumn.h
@@ -38,7 +38,7 @@ public:
: DoubleColumn(name, description, indirect_offset, extra_offset,
extra_extra_offset)
, _offset(offset) {}
- double getValue(Row row) override;
+ double getValue(Row row) const override;
protected:
const int _offset;
diff --git a/livestatus/src/ServiceSpecialDoubleColumn.cc
b/livestatus/src/ServiceSpecialDoubleColumn.cc
index f51cc50..747543d 100644
--- a/livestatus/src/ServiceSpecialDoubleColumn.cc
+++ b/livestatus/src/ServiceSpecialDoubleColumn.cc
@@ -30,7 +30,7 @@
extern int interval_length;
-double ServiceSpecialDoubleColumn::getValue(Row row) {
+double ServiceSpecialDoubleColumn::getValue(Row row) const {
if (auto svc = columnData<service>(row)) {
switch (_type) {
case Type::staleness: {
diff --git a/livestatus/src/ServiceSpecialDoubleColumn.h
b/livestatus/src/ServiceSpecialDoubleColumn.h
index 48ca45f..7000a30 100644
--- a/livestatus/src/ServiceSpecialDoubleColumn.h
+++ b/livestatus/src/ServiceSpecialDoubleColumn.h
@@ -41,7 +41,7 @@ public:
: DoubleColumn(name, description, indirect, extra_offset,
extra_extra_offset)
, _type(ssdc_type) {}
- double getValue(Row row) override;
+ double getValue(Row row) const override;
private:
Type _type;
diff --git a/livestatus/src/TableEventConsole.h b/livestatus/src/TableEventConsole.h
index 7357d03..70d8c59 100644
--- a/livestatus/src/TableEventConsole.h
+++ b/livestatus/src/TableEventConsole.h
@@ -122,7 +122,7 @@ protected:
: DoubleColumn(name, description, -1, -1, -1)
, _ecc(*this, 0, [](std::string x) { return atof(x.c_str()); }) {}
- double getValue(Row row) override { return _ecc.getValue(row); }
+ double getValue(Row row) const override { return _ecc.getValue(row); }
};
class TimeEventConsoleColumn : public TimeColumn {