ColumnSchema.hpp
Go to the documentation of this file.
1/*
2 Copyright 2015 Statoil ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef OPM_COLUMN_SCHEMA_HPP
22#define OPM_COLUMN_SCHEMA_HPP
23
24#include <string>
25#include <vector>
26
28
29namespace Opm {
30
32 public:
35 ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, double defaultValue);
36
38
39 const std::string& name() const;
40 bool validOrder( double value1 , double value2) const;
41 bool lookupValid( ) const;
42 bool acceptsDefault( ) const;
43 bool isIncreasing( ) const;
44 bool isDecreasing( ) const;
46 double getDefaultValue( ) const;
47
48 bool operator==(const ColumnSchema& data) const;
49
50 template<class Serializer>
51 void serializeOp(Serializer& serializer)
52 {
53 serializer(m_name);
54 serializer(m_order);
55 serializer(m_defaultAction);
56 serializer(m_defaultValue);
57 }
58
59 private:
60 std::string m_name;
62 Table::DefaultAction m_defaultAction;
63 double m_defaultValue;
64 };
65}
66
67#endif
68
const char *const string
Definition: cJSON.h:170
Definition: ColumnSchema.hpp:31
ColumnSchema(const std::string &name, Table::ColumnOrderEnum order, double defaultValue)
bool operator==(const ColumnSchema &data) const
bool validOrder(double value1, double value2) const
bool acceptsDefault() const
const std::string & name() const
static ColumnSchema serializeObject()
ColumnSchema(const std::string &name, Table::ColumnOrderEnum order, Table::DefaultAction defaultAction)
void serializeOp(Serializer &serializer)
Definition: ColumnSchema.hpp:51
Table::DefaultAction getDefaultMode() const
double getDefaultValue() const
bool isDecreasing() const
bool lookupValid() const
bool isIncreasing() const
Definition: Serializer.hpp:38
ColumnOrderEnum
Definition: TableEnums.hpp:26
DefaultAction
Definition: TableEnums.hpp:34
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022