1 #ifndef OPAL_ADeferred_HH
2 #define OPAL_ADeferred_HH
31 namespace Expressions {
54 explicit ADeferred(
const std::vector<T> &val);
74 virtual void print(std::ostream &)
const;
118 itsLaw(rhs.itsLaw->clone()),
119 itsOverrides(rhs.itsOverrides.size()),
120 in_evaluation(false) {
169 "Recursive expression definitions found.");
171 in_evaluation =
true;
174 if(itsLaw.isValid()) this->value = itsLaw->evaluate();
175 in_evaluation =
false;
176 if(this->value.size() < itsOverrides.size()) {
177 this->value.resize(itsOverrides.size());
181 if(itsOverrides[i].isValid()) {
182 this->value[i] = itsOverrides[i]->evaluate();
186 in_evaluation =
false;
188 "Evaluating expression \"" +
189 this->getImage() +
"\": " + ex.
what());
191 in_evaluation =
false;
193 "Evaluating expression \"" +
194 this->getImage() +
"\": " + ex.
what());
196 in_evaluation =
false;
198 "Standard C++ exception while evaluating \"" +
199 this->getImage() +
"\": " + ex.what());
201 in_evaluation =
false;
203 "Unknown exception while evaluating \"" +
204 this->getImage() +
"\": ");
214 return itsLaw.isValid() || (! itsOverrides.empty());
221 if(itsLaw.isValid()) itsLaw->print(os, 0);
224 if(! itsOverrides.empty()) {
225 os <<
"; overrides: {";
228 while(i != itsOverrides.end()) {
229 if(i->isValid())(*i)->print(os);
230 if(++i == itsOverrides.end())
break;
244 while(
int(itsOverrides.size()) < index) {
248 itsOverrides[index-1] = expr;
253 #endif // OPAL_ADeferred_HH
A pointer to an array expression.
virtual std::vector< T > evaluate()
Evaluate.
Object attribute with a constant array value.
virtual const std::string & what() const
Return the message string for the exception.
The abstract base class for all exceptions in CLASSIC.
virtual const std::string & where() const
Return the name of the method or function which detected the exception.
The base class for all OPAL exceptions.
An array of pointers to scalar expressions.
ArrayOfPtrs< T > itsOverrides
Overrides for single components.
virtual bool isExpression() const
Get expression flag.
virtual void print(std::ostream &) const
Print the attribute value.
void operator=(const ADeferred< T > &)
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special exception
PtrToArray< T > itsLaw
The generating law for the array expression.
void setComponent(int i, const PtrToScalar< T > expr)
Set a component of the value.
Object attribute with a ``deferred'' array value.
A pointer to a scalar expression.
ADeferred()
Default constructor.
virtual ADeferred< T > * clone() const
Make clone.