OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
RealVariable.h
Go to the documentation of this file.
1 //
2 // Class RealVariable
3 // The REAL VARIABLE definition.
4 //
5 // Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // This file is part of OPAL.
9 //
10 // OPAL is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17 //
18 #ifndef OPAL_RealVariable_HH
19 #define OPAL_RealVariable_HH
20 
22 
23 
25 
26 public:
27 
29  RealVariable();
30 
32  RealVariable(const std::string &name, RealVariable *parent, double value);
33 
34  virtual ~RealVariable();
35 
37  // True, if [b]rhs[/b] is a real variable.
38  virtual bool canReplaceBy(Object *rhs);
39 
41  virtual RealVariable *clone(const std::string &name);
42 
44  virtual void print(std::ostream &) const;
45 
47  virtual void printValue(std::ostream &os) const;
48 
50  virtual double getReal() const;
51 
52 private:
53 
54  // Not implemented.
56  void operator=(const RealVariable &);
57 
58  // Clone constructor.
59  RealVariable(const std::string &name, RealVariable *parent);
60 };
61 
62 #endif // OPAL_RealVariable_HH
const std::string name
The base class for all OPAL objects.
Definition: Object.h:48
The base class for all OPAL value definitions.
Attribute & value()
Return the attribute representing the value of the definition.
virtual RealVariable * clone(const std::string &name)
Make clone.
virtual void print(std::ostream &) const
Print the variable.
virtual void printValue(std::ostream &os) const
Print its value.
void operator=(const RealVariable &)
RealVariable(const RealVariable &)
RealVariable()
Exemplar constructor.
virtual ~RealVariable()
virtual double getReal() const
Return value.
virtual bool canReplaceBy(Object *rhs)
Test for allowed replacement.