opm-common
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  std::string orderSchema() const;
41  bool validOrder( double value1 , double value2) const;
42  bool lookupValid( ) const;
43  bool isDecreasing( ) const;
44  Table::DefaultAction getDefaultMode( ) const;
45  double getDefaultValue( ) const;
46 
47  bool operator==(const ColumnSchema& data) const;
48 
49  template<class Serializer>
50  void serializeOp(Serializer& serializer)
51  {
52  serializer(m_name);
53  serializer(m_order);
54  serializer(m_defaultAction);
55  serializer(m_defaultValue);
56  }
57 
58  private:
59  std::string m_name;
60  Table::ColumnOrderEnum m_order;
61  Table::DefaultAction m_defaultAction;
62  double m_defaultValue;
63  };
64 }
65 
66 #endif
Definition: ColumnSchema.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Class for (de-)serializing.
Definition: Serializer.hpp:94