2#define OPAL_ASUnary_HH 1
67 virtual void print(std::ostream &,
int precedence = 99)
const;
86 template <
class T>
inline
93 template <
class T>
inline
100 template <
class T>
inline
105 template <
class T>
inline
111 template <
class T>
inline
114 const std::vector<T> arg =
opr->evaluate();
115 T result = (*
fun.function)(arg);
125 if(result ==
T(0))
return result;
136 template <
class T>
inline
141 bool isConst = oper->isConstant();
144 if(function.precedence != -2) {
157 template <
class T>
inline
159 if(
fun.precedence >= 0) {
160 if(
fun.precedence <= precedence) os <<
"(";
162 opr->print(os,
fun.precedence);
163 if(
fun.precedence <= precedence) os <<
")";
165 os <<
fun.name <<
"(";
Representation objects and parsers for attribute expressions.
A function of one U, returning a T.
A pointer to a scalar expression.
A pointer to an array expression.
virtual void print(std::ostream &, int precedence=99) const
Print expression.
static PtrToScalar< T > make(const TFunction1< T, const std::vector< T > & > &function, PtrToArray< T > &oper)
Make new expression.
virtual T evaluate() const
Evaluate expression.
void operator=(const ASUnary &)
ASUnary(const TFunction1< T, const std::vector< T > & > &function, PtrToArray< T > &oper)
Constructor.
virtual Scalar< T > * clone() const
Make clone.
const TFunction1< T, const std::vector< T > & > & fun
A scalar constant expression.
Object * release()
Release ownership.