Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_ScalarParameterEntry.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_SCALARPARAMETERENTRY_HPP
11 #define SACADO_SCALARPARAMETERENTRY_HPP
12 
13 #include "Sacado_Traits.hpp"
14 #include "Sacado_mpl_apply.hpp"
15 
16 namespace Sacado {
17 
19 
39  template <class EvalType> struct apply {
40  typedef EvalType type; };
41  };
42 
45  public:
46 
49 
52 
54  virtual void setRealValue(double value) = 0;
55 
57  virtual double getRealValue() const = 0;
58 
60  virtual void print(std::ostream& os) const = 0;
61  };
62 
66  template <typename EvalType, typename EvalTypeTraits = DefaultEvalTypeTraits>
68 
69  public:
70 
71  typedef typename EvalTypeTraits::template apply<EvalType>::type ScalarT;
72 
75 
77  virtual ~ScalarParameterEntry() {}
78 
80 
84  virtual void setValue(const ScalarT& value) = 0;
85 
87  virtual const ScalarT& getValue() const = 0;
88 
90 
93  virtual double getRealValue() const {
95  }
96 
98 
101  virtual void print(std::ostream& os) const {
102  os << getValue();
103  }
104 
105  };
106 }
107 
108 #endif
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
virtual double getRealValue() const =0
Get real parameter value.
EvalTypeTraits::template apply< EvalType >::type ScalarT
virtual void print(std::ostream &os) const =0
Print entry.
virtual void setRealValue(double value)=0
Set real parameter value.
virtual void setValue(const ScalarT &value)=0
Set parameter this object represents to value.
virtual double getRealValue() const
Get real parameter value.
virtual const ScalarT & getValue() const =0
Get parameter value this object represents.
virtual void print(std::ostream &os) const
Print entry.
A base class for scalar parameter values.
int value
Abstract interface for all entries in Sacado::ScalarParameterFamily.
Base traits definition mapping evaluation types to value types.