8#ifndef EXPRESSIONEVALUATION_STACKELEMENT_H
9#define EXPRESSIONEVALUATION_STACKELEMENT_H
53 friend std::ostream&
operator<<( std::ostream& os,
126 template<
typename T >
129 template<
typename T >
133 template<
typename T >
136 template<
typename T >
140 template<
typename T >
143 template<
typename T >
147 template<
typename T >
150 template<
typename T >
155 template<
typename T >
159 template<
typename T >
163 template<
typename T >
167 template<
typename T >
192 template<
typename T >
195 template<
typename T >
219 template <
class T_CompHelper>
237 template<
typename T >
295 template<
typename T >
297 template<
typename T >
Class describing a single element in a text expression.
std::string m_varName
The name/definition of the variable.
int asInt() const
Get the internal value of the object as an integer.
bool isVector() const
Check if the object describes a vector value.
IProxyLoader * m_proxyLoader
Loader for the described variable.
StackElement operator+(StackElement &rhs)
Operator adding a value to the object.
StackElement _atanh()
Function taking the arc tangent hyperbolic value of the object.
std::vector< double > m_vecDoubleVal
The value of the object represented as a vector of doubles.
std::vector< T > vectorValue(std::size_t sizeIfScalar=0)
Evaluate the value of the object into the requested vector type.
StackElement & operator-=(const T &rhs)
StackElement _cos()
Function taking the cosine value of the object.
StackElement _gt(StackElement &other)
StackElement _acosh()
Function taking the arc cosine hyperbolic value of the object.
void makeDouble()
Function constructing internal double values in case integer values were given to the object initiall...
StackElement(double val)
Constructor creating the object with a double value.
StackElement _comparisonOp(StackElement &other, T_CompHelper comp_helper)
StackElement operator!()
NOT operator.
StackElement(const StackElement &a)
bool isProxy() const
Check if the object takes its value from a StoreGate object.
StackElement _tan()
Function taking the tangent value of the object.
StackElement _lt(StackElement &other)
std::atomic< bool > m_moved
StackElement operator*(const T &rhs)
StackElement & operator=(int rhs)
Operator assigning an integer value to the object.
StackElement _asin()
Function taking the arc sinus value of the object.
StackElement operator-(const T &rhs)
StackElement _pow(const T &n)
Function raising the object's value to the n'th power.
bool asBool() const
Get the internal value of the object as a boolean.
StackElement & operator*=(StackElement &rhs)
Multiply the object by a scalar type.
StackElement & operator-=(const std::vector< T > &rhs)
Subtract a vector type from the object.
StackElement & operator+=(StackElement &rhs)
Add a scalar type to the object.
StackElement operator/(StackElement &rhs)
Operator dividing the object by a value.
StackElement & operator*=(const std::vector< T > &rhs)
Multiply the object by a vector type.
StackElement operator-(StackElement &rhs)
Operator subtracting a value from the object.
T scalarValue() const
Evaluate the value of the object into the requested scalar type.
StackElement _eq(StackElement &other)
bool isScalar() const
Check if the object describes a scalar value.
ElementType
Type of the data held by this object.
@ SE_UNK
The type is not known, or not applicable.
@ SE_INT
The type is an integer.
@ SE_DOUBLE
The type is a double.
@ SE_VECINT
The type is a vector of integers.
@ SE_VECDOUBLE
The type is a vector of doubles.
friend std::ostream & operator<<(std::ostream &os, const StackElement &el)
Declare the print operator as a friend of the class.
StackElement _asinh()
Function taking the arc sinus hyperbolic value of the object.
StackElement & operator-=(StackElement &rhs)
Subtract a scalar type from the object.
StackElement(unsigned int val)
Constructor creating the object with an unsigned integer value.
StackElement operator/(const T &rhs)
void makeVectorIfNecessary(const StackElement &other)
The macro is not needed anymore:
StackElement _neq(StackElement &other)
StackElement _abs()
Function taking the absolute value of the object.
StackElement _or(StackElement &other)
StackElement(int val)
Constructor creating the object with a signed integer value.
StackElement _and(StackElement &other)
StackElement & operator=(StackElement &&rhs)
StackElement & operator+=(const std::vector< T > &rhs)
Add a vector type to the object.
StackElement(const std::vector< int > &val)
Constructor creating the object with a vector of integers value.
StackElement(const std::vector< double > &val)
Constructor creating the object with a vector of doubles value.
StackElement _tanh()
Function taking the tangent hyperbolic value of the object.
StackElement _sqrt()
Function taking the square root of the object.
StackElement _sum()
Function calculating a sum value.
StackElement operator*(StackElement &rhs)
Operator multiplying the object by a value.
void ensureCompatibleVectors(const T &other) const
StackElement _cosh()
Function taking the cosine hyperbolic value of the object.
StackElement _atan()
Function taking the arc tangent value of the object.
ElementType m_type
The type of the variable held by the object.
StackElement & operator*=(const T &rhs)
StackElement _sin()
Function taking the sinus value of the object.
StackElement(StackElement &&a)
StackElement _acos()
Function taking the arc cosine value of the object.
StackElement _cbrt()
Function taking the cubic root of the object.
int m_intVal
The value of the object represented as an integer.
StackElement(std::vector< int > &&val)
Constructor creating the object with a vector of integers value.
StackElement valueFromProxy() const
Set the internal variables of the object based on the objects in SG.
StackElement _exp()
Function taking the natural exponent of the object.
StackElement operator-()
Inverse operator.
void makeVector(std::size_t n)
Function converting a possibly scalar value into a vector.
StackElement _count()
Function counting elements.
ElementType getType() const
Get the variable type of the object.
StackElement(const std::string &val, IProxyLoader *proxyLoader)
Constructor creating the object from a text expression.
StackElement _log()
Function taking the logarithm of the object.
StackElement & operator/=(StackElement &rhs)
Divide the object by a scalar type.
StackElement()
Default constructor.
StackElement _sinh()
Function taking the sinus hyperbolic value of the object.
void ensureCompatibleVectors(const std::vector< T > &other) const
void ensureCompatible(const StackElement &other) const
std::atomic< bool > m_determinedVariableType
Internal flag showing whether the type of the variable was already determined.
StackElement & operator/=(const std::vector< T > &rhs)
Divide the object by a vector type.
const std::string & proxyVarName() const
std::vector< int > m_vecIntVal
The value of the object represented as a vector of integers.
StackElement & operator+=(const T &rhs)
StackElement _gte(StackElement &other)
StackElement(std::vector< double > &&val)
Constructor creating the object with a vector of doubles value.
StackElement & operator/=(const T &rhs)
void makeInt()
Function constructing internal integer values in case double values were given to the object initiall...
double m_doubleVal
The value of the object represented as a double.
std::atomic< IProxyLoader::VariableType > m_variableType
Type of the variable provided by the proxy loader.
void makeDoubleIfNecessary(const StackElement &other)
StackElement _lte(StackElement &other)
StackElement operator+(const T &rhs)
Namespace holding all the expression evaluation code.
std::ostream & operator<<(std::ostream &os, const StackElement &el)
Declare an output operator for StackElement objects.