ResInsight/ApplicationCode/ReservoirDataModel/RigCaseRealizationParameters.h
2018-05-31 10:24:16 +02:00

71 lines
2.1 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight 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.
//
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"
#include "cvfObject.h"
#include <QString>
#include <map>
#include <memory>
//==================================================================================================
//
//
//==================================================================================================
class RigCaseRealizationParameters
{
public:
// Internal class
class Value
{
enum ValueType { TYPE_NONE, TYPE_NUMERIC, TYPE_TEXT };
public:
Value();
Value(double value);
Value(const QString& value);
void setValue(double value);
void setValue(const QString& value);
bool isValid() const { return m_valueType != TYPE_NONE; }
bool isNumeric() const { return m_valueType == TYPE_NUMERIC; }
bool isText() const { return m_valueType == TYPE_TEXT; }
double numericValue() const;
const QString& textValue() const;
private:
ValueType m_valueType;
double m_numericValue;
QString m_textValue;
};
void addParameter(const QString& name, double value);
void addParameter(const QString& name, const QString& value);
Value parameterValue(const QString& name);
std::map<QString, Value> parameters() const;
private:
std::map<QString, Value> m_parameters;
};