OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ConcreteVar.h
Go to the documentation of this file.
1 #ifndef OPAL_ConcreteVar_HH
2 #define OPAL_ConcreteVar_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ConcreteVar.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ConcreteVar
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:43 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Match/AbstractVar.h"
23 #include "Match/MatchLimits.h"
24 
25 
26 // Class ConcreteVar
27 // ------------------------------------------------------------------------
29 // Implements the setting and retrieving of the value in the system
30 // to be adjusted. Upper and lower limits are implemented by variable
31 // transformations which map the infinite range to the limited range.
32 
33 class ConcreteVar: public AbstractVar {
34 
35 public:
36 
38  // Uses the following arguments:
39  // [ol]
40  // [li] The variable name.
41  // [li] An attribute containing a reference to thevalue to be adjusted.
42  // [li] A code for limit values: 0=no limit, 1=lower, 2=upper, 3=both.
43  // [li] Value, lower, upper, and step.
44  // [/ol]
45  ConcreteVar(const std::string &name, Attribute &data,
46  int limits, double pars[4]);
47 
48  virtual ~ConcreteVar();
49 
51  // The internal value is unlimited, it maps to the external value
52  // so as to keep the latter constrained.
53  virtual double getInternalValue() const;
54 
56  // The internal value is unlimited, it maps to the external value
57  // so as to keep the latter constrained.
58  virtual void setInternalValue(double);
59 
61  // The external value should be consistent with the given limits.
62  virtual double getExternalValue() const;
63 
65  // The external value should be consistent with the given limits.
66  virtual void setExternalValue(double);
67 
69  virtual void print(std::ostream &) const;
70 
71 private:
72 
73  // Not implemented.
74  ConcreteVar();
75  ConcreteVar(const ConcreteVar &);
76  void operator=(const ConcreteVar &);
77 
78  // The attribute to be manipulated.
80 
81  // The current internal parameter step.
82  double itsStep;
83 
84  // The fixed parameter limits.
85  int itsLimits;
86  double itsMin;
87  double itsMax;
88 };
89 
90 #endif // OPAL_ConcreteVar_HH
double itsStep
Definition: ConcreteVar.h:82
A representation of an Object attribute.
Definition: Attribute.h:55
Concrete class for a matching variable.
Definition: ConcreteVar.h:33
virtual void setExternalValue(double)
Set the current external parameter value.
virtual double getInternalValue() const
Get the current internal parameter value.
Definition: ConcreteVar.cpp:69
virtual double getExternalValue() const
Get the current external parameter value.
double itsMin
Definition: ConcreteVar.h:86
Attribute itsAttr
Definition: ConcreteVar.h:79
virtual void print(std::ostream &) const
Print the variable name and value.
const std::string name
void operator=(const ConcreteVar &)
virtual void setInternalValue(double)
Set the current internal parameter value.
Definition: ConcreteVar.cpp:89
Abstract base for a matching variable.
Definition: AbstractVar.h:31
virtual ~ConcreteVar()
Definition: ConcreteVar.cpp:65
double itsMax
Definition: ConcreteVar.h:87