ParameterMapItem.hpp
Go to the documentation of this file.
1 //===========================================================================
2 //
3 // File: ParameterMapItem.hpp
4 //
5 // Created: Tue Jun 2 19:05:54 2009
6 //
7 // Author(s): Bård Skaflestad <bard.skaflestad@sintef.no>
8 // Atgeirr F Rasmussen <atgeirr@sintef.no>
9 //
10 // $Date$
11 //
12 // $Revision$
13 //
14 //===========================================================================
15 
16 /*
17  Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
18  Copyright 2009, 2010 Statoil ASA.
19 
20  This file is part of the Open Porous Media project (OPM).
21 
22  OPM is free software: you can redistribute it and/or modify
23  it under the terms of the GNU General Public License as published by
24  the Free Software Foundation, either version 3 of the License, or
25  (at your option) any later version.
26 
27  OPM is distributed in the hope that it will be useful,
28  but WITHOUT ANY WARRANTY; without even the implied warranty of
29  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  GNU General Public License for more details.
31 
32  You should have received a copy of the GNU General Public License
33  along with OPM. If not, see <http://www.gnu.org/licenses/>.
34 */
35 
36 #ifndef OPM_PARAMETERMAPITEM_HEADER
37 #define OPM_PARAMETERMAPITEM_HEADER
38 
39 #include <string>
40 
41 namespace Opm {
42  namespace parameter {
50  ParameterMapItem() : used_(false) {}
51 
53  virtual ~ParameterMapItem() {}
54 
57  virtual std::string getTag() const = 0;
58  void setUsed() const { used_ = true; }
59  bool used() const { return used_; }
60  private:
61  mutable bool used_;
62  };
63 
64  template<typename T>
66  static T convert(const ParameterMapItem&,
67  std::string& conversion_error);
68  static std::string type();
69  };
70  } // namespace parameter
71 } // namespace Opm
72 
73 #endif // OPM_PARAMETERMAPITEM_HEADER
Definition: AnisotropicEikonal.hpp:43
void setUsed() const
Definition: ParameterMapItem.hpp:58
virtual std::string getTag() const =0
This function returns a string describing the ParameterMapItem.
Definition: ParameterMapItem.hpp:48
bool used() const
Definition: ParameterMapItem.hpp:59
Definition: ParameterMapItem.hpp:65
ParameterMapItem()
Default constructor.
Definition: ParameterMapItem.hpp:50
virtual ~ParameterMapItem()
Destructor.
Definition: ParameterMapItem.hpp:53
static T convert(const ParameterMapItem &, std::string &conversion_error)