OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
RealConstant.h
Go to the documentation of this file.
1//
2// Class RealConstant
3// The REAL CONSTANT 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_RealConstant_HH
19#define OPAL_RealConstant_HH
20
22
24public:
27
29 RealConstant(const std::string& name, RealConstant* parent, double value);
30
31 virtual ~RealConstant();
32
34 // Always false for constants.
35 virtual bool canReplaceBy(Object* object);
36
38 virtual RealConstant* clone(const std::string& name);
39
41 virtual void print(std::ostream&) const;
42
44 virtual void printValue(std::ostream& os) const;
45
47 virtual double getReal() const;
48
49private:
50 // Not implemented.
52 void operator=(const RealConstant&);
53
54 // Clone constructor.
55 RealConstant(const std::string& name, RealConstant* parent);
56};
57
58#endif // OPAL_RealConstant_HH
The base class for all OPAL objects.
Definition Object.h:45
virtual void print(std::ostream &) const
Print the constant.
virtual ~RealConstant()
RealConstant()
Exemplar constructor.
virtual double getReal() const
Return value.
virtual void printValue(std::ostream &os) const
Print its value.
virtual bool canReplaceBy(Object *object)
Test if object can be replaced.
virtual RealConstant * clone(const std::string &name)
Make clone.
RealConstant(const RealConstant &)
void operator=(const RealConstant &)
The base class for all OPAL value definitions.
Attribute & value()
Return the attribute representing the value of the definition.