1#ifndef OPAL_SRefAttr_HH
2#define OPAL_SRefAttr_HH
55 SRefAttr(
const std::string &oName,
const std::string &aName,
int index);
76 virtual void print(std::ostream &)
const;
80 virtual void set(
const T &)
const;
117 (
const std::string &oName,
const std::string &aName,
int index):
150 std::vector<T> array = value->evaluate();
152 throw ParseError(
"SRefAttr::evaluate()",
"Reference \"" +
153 getImage() +
"\" has index out of range.");
158 throw ParseError(
"SRefAttr::evaluate()",
"Reference \"" +
159 getImage() +
"\" is not an array.");
163 return value->evaluate();
166 "\" is of the wrong type.");
178 "Attribute is not of real type.");
212 throw ParseError(
"Real::get()",
"Attribute \"" +
213 itsAttr->getName() +
"\" is of the wrong type.");
226 "\nThe <variable> \"" +
obj_name +
"\" is unknown.\n");
229 "Object \"" +
obj_name +
"\" is unknown.");
241 "\" is not a variable, constant or vector.");
247 "->" +
att_name +
"\" is unknown.");
Representation objects and parsers for attribute expressions.
std::ostream & operator<<(std::ostream &os, const SRefAttr< T > &a)
A representation of an Object attribute.
std::string getImage() const
Convert to string.
An attribute defined as a reference to a scalar.
static const std::string typeName
void operator=(const SRefAttr &)
const std::string att_name
virtual SRefAttr< T > * clone() const
Make clone.
const std::string obj_name
virtual void set(const T &) const
Store new value.
virtual void print(std::ostream &) const
Print the reference.
virtual void invalidate()
Invalidate.
virtual double getReal()
Return real value.
SRefAttr(const std::string &oName, const std::string &aName, int index)
Constructor.
virtual T evaluate() const
Evaluate.
The base class for all OPAL objects.
Object * find(const std::string &name)
Find entry.
static OpalData * getInstance()
Object attribute with a ``deferred'' array value.
Object attribute with a constant scalar value.