My Project
ColumnSchema.hpp
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 
27 #include <opm/input/eclipse/EclipseState/Tables/TableEnums.hpp>
28 
29 namespace Opm {
30 
31  class ColumnSchema {
32  public:
33  ColumnSchema();
34  ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, Table::DefaultAction defaultAction);
35  ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, double defaultValue);
36 
37  static ColumnSchema serializationTestObject();
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;
45  Table::DefaultAction getDefaultMode( ) 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;
61  Table::ColumnOrderEnum m_order;
62  Table::DefaultAction m_defaultAction;
63  double m_defaultValue;
64  };
65 }
66 
67 #endif
68 
Definition: ColumnSchema.hpp:31
Class for (de-)serializing.
Definition: Serializer.hpp:75
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29