1#ifndef OPAL_ARefExpr_HH
2#define OPAL_ARefExpr_HH
49 ARefExpr(
const std::string &objName,
const std::string &attName);
58 virtual std::vector<T>
evaluate()
const;
61 virtual void print(std::ostream &os,
int precedence = 99)
const;
89 (
const std::string &objName,
const std::string &attName):
90 obj_name(objName), att_name(attName),
91 itsObject(0), itsAttr(0)
98 obj_name(rhs.obj_name), att_name(rhs.att_name),
99 itsObject(rhs.itsObject), itsAttr(rhs.itsAttr)
105 if(itsObject) itsObject->unregisterReference(
this);
121 return value->evaluate();
123 return std::vector<T>(1, value->evaluate());
126 getImage() +
"\" is not an array.");
129 return std::vector<T>();
136 std::ostringstream os;
146 if(! att_name.empty()) os <<
"->" << att_name;
156 "Object \"" + obj_name +
"\" is unknown.");
161 itsObject->registerReference(
const_cast<ARefExpr<T>*
>(
this));
163 if(att_name.empty()) {
164 itsAttr = itsObject->findAttribute(
"VALUE");
166 throw OpalException(
"ARefExpr::fill()",
"Object \"" + obj_name +
167 "\" is not a variable, constant or vector.");
170 itsAttr = itsObject->findAttribute(att_name);
172 throw OpalException(
"ARefExpr::fill()",
"Attribute \"" + obj_name +
173 "->" + att_name +
"\" is unknown.");
Representation objects and parsers for attribute expressions.
A representation of an Object attribute.
Abstract base class for attribute values of different types.
Abstract base class for references which must be invalidated when an.
The base class for all OPAL objects.
Object * find(const std::string &name)
Find entry.
static OpalData * getInstance()
An expression defined as a reference to an array.
const std::string getImage() const
virtual OArray< T > * clone() const
Make clone.
ARefExpr(const std::string &objName, const std::string &attName)
Constructor.
void operator=(const ARefExpr &)
const std::string obj_name
const std::string att_name
virtual std::vector< T > evaluate() const
Evaluate the reference and return the value referred to.
virtual void print(std::ostream &os, int precedence=99) const
Print expression.
Object attribute with a constant array value.
Object attribute with a constant scalar value.
The base class for all OPAL exceptions.