opm-common
TableSchema.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_TABLE_SCHEMA_HPP
22 #define OPM_TABLE_SCHEMA_HPP
23 
24 #include <opm/input/eclipse/EclipseState/Tables/ColumnSchema.hpp>
25 #include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
26 
27 #include <cstddef>
28 #include <string>
29 
30 namespace Opm {
31 
32  class TableSchema {
33  public:
34  static TableSchema serializationTestObject();
35 
36  void addColumn(const ColumnSchema&);
37  const ColumnSchema& getColumn(const std::string& name) const;
38  const ColumnSchema& getColumn(std::size_t columnIndex) const;
39  bool hasColumn(const std::string&) const;
40 
41  /* Number of columns */
42  std::size_t size() const;
43 
44  bool operator==(const TableSchema& data) const;
45 
46  template<class Serializer>
47  void serializeOp(Serializer& serializer)
48  {
49  serializer(m_columns);
50  }
51 
52  private:
53  OrderedMap<ColumnSchema> m_columns;
54  };
55 }
56 
57 #endif
Definition: TableSchema.hpp:32
Definition: ColumnSchema.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
A map with iteration in the order of insertion.
Definition: OrderedMap.hpp:118
Class for (de-)serializing.
Definition: Serializer.hpp:94