OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ValueDefinition.h
Go to the documentation of this file.
1#ifndef OPAL_ValueDefinition_HH
2#define OPAL_ValueDefinition_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: ValueDefinition.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: ValueDefinition
13//
14// ------------------------------------------------------------------------
15//
16// $Date: 2000/03/27 09:33:35 $
17// $Author: Andreas Adelmann $
18//
19// ------------------------------------------------------------------------
20
22
23// Class ValueDefinition
24// ------------------------------------------------------------------------
26// It implements the common behaviour of scalar and vector variables,
27// it can also be used via dynamic casting to determine whether an object
28// represents a variable.
29
30class ValueDefinition : public Object {
31public:
32 virtual ~ValueDefinition();
33
35 // Return the string "VARIABLE".
36 virtual const std::string getCategory() const;
37
39 // If true, the object's execute() function should be traced.
40 // Always false for value definitions.
41 virtual bool shouldTrace() const;
42
44 // If true, the data structure should be updated before calling execute().
45 // Always false for value definitions.
46 virtual bool shouldUpdate() const;
47
49 // The default version throws OpalException.
50 virtual bool getBool() const;
51
53 // The default version throws OpalException.
54 virtual bool getBoolComponent(int) const;
55
57 // The default version throws OpalException.
58 virtual double getReal() const;
59
61 // The default version throws OpalException.
62 virtual double getRealComponent(int) const;
63
65 // The default version throws OpalException.
66 virtual std::string getString() const;
67
69 // The default version throws OpalException.
70 virtual std::string getStringComponent(int) const;
71
73 // Version for non-constant object.
75
77 // Version for constant object.
78 const Attribute& value() const;
79
80protected:
82 ValueDefinition(int size, const char* name, const char* help);
83
85 ValueDefinition(const std::string& name, ValueDefinition* parent);
86
88 // A string representing the value type in OPAL-9 input format:
89 // "BOOL", "REAL", "REAL CONST", "REAL VECTOR", etc.
90 const std::string itsPrefix;
91
92private:
93 // Not implemented.
97};
98
99#endif // OPAL_ValueDefinition_HH
A representation of an Object attribute.
Definition Attribute.h:52
The base class for all OPAL objects.
Definition Object.h:45
The base class for all OPAL value definitions.
virtual double getReal() const
Return real value.
virtual bool shouldTrace() const
Trace flag.
virtual bool getBool() const
Return logical value.
Attribute & value()
Return the attribute representing the value of the definition.
virtual double getRealComponent(int) const
Return indexed real value.
virtual const std::string getCategory() const
Return the object category as a string.
ValueDefinition(const ValueDefinition &)
virtual std::string getStringComponent(int) const
Return indexed string value.
virtual std::string getString() const
Return string value.
const std::string itsPrefix
The declaration prefix.
void operator=(const ValueDefinition &)
virtual bool getBoolComponent(int) const
Return indexed logical value.
virtual ~ValueDefinition()
virtual bool shouldUpdate() const
Update flag.