2015-12-21 15:00:40 +01:00
|
|
|
/*
|
|
|
|
|
Copyright 2015 Statoil ASA.
|
|
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2016-04-14 17:19:37 +02:00
|
|
|
#ifndef OPM_TABLE_SCHEMA_HPP
|
|
|
|
|
#define OPM_TABLE_SCHEMA_HPP
|
2015-12-21 15:00:40 +01:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp>
|
2016-10-10 17:20:49 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp>
|
2015-12-21 15:00:40 +01:00
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
|
|
class TableSchema {
|
|
|
|
|
public:
|
2020-03-19 15:21:20 +01:00
|
|
|
static TableSchema serializeObject();
|
|
|
|
|
|
2016-10-10 17:20:49 +02:00
|
|
|
void addColumn( ColumnSchema );
|
|
|
|
|
const ColumnSchema& getColumn( const std::string& name ) const;
|
|
|
|
|
const ColumnSchema& getColumn( size_t columnIndex ) const;
|
2016-01-04 19:31:42 +01:00
|
|
|
bool hasColumn(const std::string&) const;
|
2015-12-21 15:00:40 +01:00
|
|
|
|
|
|
|
|
/* Number of columns */
|
|
|
|
|
size_t size() const;
|
2019-11-29 09:57:25 +01:00
|
|
|
|
|
|
|
|
bool operator==(const TableSchema& data) const;
|
2020-03-17 10:42:22 +01:00
|
|
|
|
|
|
|
|
template<class Serializer>
|
|
|
|
|
void serializeOp(Serializer& serializer)
|
|
|
|
|
{
|
|
|
|
|
m_columns.serializeOp(serializer);
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-21 15:00:40 +01:00
|
|
|
private:
|
2019-03-08 09:00:36 +01:00
|
|
|
OrderedMap<std::string, ColumnSchema> m_columns;
|
2015-12-21 15:00:40 +01:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|