RealVariable.h 1.58 KB
Newer Older
gsell's avatar
gsell committed
1
//
2 3 4 5 6
// Class RealVariable
//   The REAL VARIABLE definition.
//
// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
gsell's avatar
gsell committed
7
//
8
// This file is part of OPAL.
gsell's avatar
gsell committed
9
//
10 11 12 13
// OPAL 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.
gsell's avatar
gsell committed
14
//
15 16 17 18 19
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#ifndef OPAL_RealVariable_HH
#define OPAL_RealVariable_HH
gsell's avatar
gsell committed
20 21 22 23 24 25 26 27 28 29 30 31

#include "AbstractObjects/ValueDefinition.h"


class RealVariable: public ValueDefinition {

public:

    /// Exemplar constructor.
    RealVariable();

    /// Constructor for built-in variables.
32
    RealVariable(const std::string &name, RealVariable *parent, double value);
gsell's avatar
gsell committed
33 34 35 36 37 38 39 40

    virtual ~RealVariable();

    /// Test for allowed replacement.
    //  True, if [b]rhs[/b] is a real variable.
    virtual bool canReplaceBy(Object *rhs);

    /// Make clone.
41
    virtual RealVariable *clone(const std::string &name);
gsell's avatar
gsell committed
42 43 44 45

    /// Print the variable.
    virtual void print(std::ostream &) const;

46 47 48
    /// Print its value
    virtual void printValue(std::ostream &os) const;

gsell's avatar
gsell committed
49 50 51 52 53 54 55 56 57 58
    /// Return value.
    virtual double getReal() const;

private:

    // Not implemented.
    RealVariable(const RealVariable &);
    void operator=(const RealVariable &);

    // Clone constructor.
59
    RealVariable(const std::string &name, RealVariable *parent);
gsell's avatar
gsell committed
60 61
};

62
#endif // OPAL_RealVariable_HH