44#ifndef OPAL_Expressions_HH
45#define OPAL_Expressions_HH 1
93 virtual void print(std::ostream&,
int precedence = 99)
const = 0;
120 explicit operator bool()
const {
return ptr_m !=
nullptr; }
127 mutable std::unique_ptr<Scalar<T>>
ptr_m;
170 virtual void print(std::ostream&,
int precedence = 99)
const = 0;
197 explicit operator bool()
const {
return ptr_m !=
nullptr; }
204 mutable std::unique_ptr<OArray<T>>
ptr_m;
326 ptr_m = std::move(rhs.
ptr_m);
371 ptr_m = std::move(rhs.
ptr_m);
An array of pointers to scalar expressions.
virtual bool isConstant() const
Test for constant.
virtual OArray< T > * clone() const =0
Copy expression.
virtual std::vector< T > evaluate() const =0
Evaluate.
virtual void print(std::ostream &, int precedence=99) const =0
Print expression.
void operator=(const OArray &)
A pointer to an array expression.
PtrToArray(OArray< T > *rhs)
Constructor from object just created.
PtrToArray & operator=(const PtrToArray< T > &)
PtrToArray(PtrToArray &&rhs) noexcept=default
std::unique_ptr< OArray< T > > ptr_m
PtrToArray & operator=(PtrToArray &&) noexcept=default
PtrToArray(const PtrToArray &rhs)
OArray< T > * get() const
OArray< T > & operator*() const
A pointer to a scalar expression.
PtrToScalar & operator=(PtrToScalar &&) noexcept=default
std::unique_ptr< Scalar< T > > ptr_m
Scalar< T > & operator*() const
Scalar< T > * get() const
PtrToScalar(PtrToScalar &&rhs) noexcept=default
PtrToScalar(Scalar< T > *rhs)
Constructor from an object just created.
PtrToScalar(const PtrToScalar &rhs)
PtrToScalar & operator=(const PtrToScalar &)
An attribute defined as a reference to a scalar.
void operator=(const Scalar &)
virtual T evaluate() const =0
Evaluate.
virtual Scalar< T > * clone() const =0
Copy scalar expression.
virtual bool isConstant() const
Test for constant.
virtual void print(std::ostream &, int precedence=99) const =0
Print expression.
Representation of a place within a beam line or sequence.
Representation of a range within a beam line or sequence.
Interface for statements.
Representation of a table row reference.
The base class for all OPAL tables.
Representation objects and parsers for attribute expressions.
std::string parseStringValue(Statement &, const char msg[])
PtrToScalar< bool > parseBool(Statement &)
Parse boolean expression.
PtrToScalar< double > parseReal(Statement &)
Parse real expression.
PtrToArray< double > parseRealConstArray(Statement &)
Parse real array constant.
std::vector< std::string > parseStringArray(Statement &)
Parse string array.
RangeRep parseRange(Statement &)
Parse range specification.
PlaceRep parsePlace(Statement &)
Parse place specification.
SRefAttr< double > * parseReference(Statement &)
Parse variable reference.
std::vector< std::list< Token > > parseTokenListArray(Statement &)
Parse a token list array (for LIST commands).
PtrToArray< double > parseRealArray(Statement &)
Parse real array expression.
PtrToScalar< double > parseTableExpression(Statement &, const Table *)
Parse table expression (depends on a table's rows).
std::list< Token > parseTokenList(Statement &)
Parse a token list (for macro argument and the like).
TableRowRep parseTableRow(Statement &)
Parse a token list (for macro argument and the like).
std::string parseString(Statement &, const char msg[])
Parse string value.
void parseDelimiter(Statement &stat, char delim)
Test for one-character delimiter.
double parseRealConst(Statement &)
Parse real constant.
PtrToArray< bool > parseBoolArray(Statement &)
Parse boolean array expression.