OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ValueDefinition.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: ValueDefinition.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.1.1.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class: ValueDefinition
10// The abstract base class for all OPAL value definitions.
11//
12// ------------------------------------------------------------------------
13//
14// $Date: 2000/03/27 09:33:35 $
15// $Author: Andreas Adelmann $
16//
17// ------------------------------------------------------------------------
18
23
24// Class ValueDefinition
25// ------------------------------------------------------------------------
26
28
29const std::string ValueDefinition::getCategory() const { return "VARIABLE"; }
30
31bool ValueDefinition::shouldTrace() const { return false; }
32
33bool ValueDefinition::shouldUpdate() const { return false; }
34
36 throw OpalException(
37 "ValueDefinition::getBool()",
38 "You cannot get a logical value from \"" + getOpalName() + "\".");
39}
40
42 throw OpalException(
43 "ValueDefinition::getBoolComponent()",
44 "You cannot get an indexed logical value from \"" + getOpalName() + "\".");
45}
46
48 throw OpalException(
49 "ValueDefinition::getReal()",
50 "You cannot get a real value from \"" + getOpalName() + "\".");
51}
52
54 throw OpalException(
55 "ValueDefinition::getReal()",
56 "You cannot get an indexed real value from \"" + getOpalName() + "\".");
57}
58
59std::string ValueDefinition::getString() const {
60 throw OpalException(
61 "ValueDefinition::getString()",
62 "You cannot get a string value from \"" + getOpalName() + "\".");
63}
64
66 throw OpalException(
67 "ValueDefinition::getString()",
68 "You cannot get an indexed string value from \"" + getOpalName() + "\".");
69}
70
72
73const Attribute& ValueDefinition::value() const { return itsAttr[0]; }
74
75ValueDefinition::ValueDefinition(int size, const char* name, const char* help)
76 : Object(size, name, help) {}
77
78ValueDefinition::ValueDefinition(const std::string& name, ValueDefinition* parent)
79 : Object(name, parent) {}
A representation of an Object attribute.
Definition Attribute.h:52
The base class for all OPAL objects.
Definition Object.h:45
const std::string & getOpalName() const
Return object name.
Definition Object.cpp:267
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:210
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.
virtual std::string getStringComponent(int) const
Return indexed string value.
virtual std::string getString() const
Return string value.
virtual bool getBoolComponent(int) const
Return indexed logical value.
virtual ~ValueDefinition()
virtual bool shouldUpdate() const
Update flag.