ATLAS Offline Software
Classes | Namespaces | Macros | Functions
StackElement.cxx File Reference
#include <cmath>
#include <iostream>
#include <stdexcept>
#include <algorithm>
#include <cassert>
#include "ExpressionEvaluation/StackElement.h"
Include dependency graph for StackElement.cxx:

Go to the source code of this file.

Classes

class  ExpressionParsing::Helper_eq
 
class  ExpressionParsing::Helper_neq
 
class  ExpressionParsing::Helper_and
 
class  ExpressionParsing::Helper_or
 
class  ExpressionParsing::Helper_gt
 
class  ExpressionParsing::Helper_gte
 
class  ExpressionParsing::Helper_lt
 
class  ExpressionParsing::Helper_lte
 

Namespaces

 ExpressionParsing
 Namespace holding all the expression evaluation code.
 

Macros

#define IMPL_ASSIGN_OP(OP)
 Helper macro implementing the assignment operator specialisations. More...
 
#define UNARY_MATH_FUNCTION(FUNC, BASEFUNC)
 Helper macro for implementing many of the mathematical functions. More...
 

Functions

template<class T_CompHelper , class T >
std::vector< int > ExpressionParsing::compareVector (std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper)
 
template<class T_CompHelper , class T >
std::vector< int > ExpressionParsing::compareVectorAlt (const std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper)
 
template<class T_CompHelper >
std::vector< int > ExpressionParsing::compareVector (std::vector< int > &&a, const std::vector< int > &&b, T_CompHelper helper)
 
template<class T_CompHelper >
std::vector< int > ExpressionParsing::compareVectorAlt (const std::vector< int > &&a, std::vector< int > &&b, T_CompHelper helper)
 
std::ostream & ExpressionParsing::operator<< (std::ostream &os, const StackElement &el)
 Declare an output operator for StackElement objects. More...
 

Macro Definition Documentation

◆ IMPL_ASSIGN_OP

#define IMPL_ASSIGN_OP (   OP)
Value:
StackElement& StackElement::operator OP( StackElement& rhs ) { \
makeVectorIfNecessary( rhs ); \
makeDoubleIfNecessary( rhs ); \
switch( m_type ) { \
case SE_INT: \
m_intVal OP rhs.scalarValue< int >(); \
break; \
case SE_DOUBLE: \
m_doubleVal OP rhs.scalarValue< double >(); \
break; \
case SE_VECINT: \
*this OP rhs.vectorValue< int >( m_vecIntVal.size() ); \
break; \
case SE_VECDOUBLE: \
*this OP rhs.vectorValue< double >( m_vecDoubleVal.size() ); \
break; \
default: \
throw std::runtime_error( "StackElement ill-defined in " \
#OP ); \
break; \
} \
return *this; \
}

Helper macro implementing the assignment operator specialisations.

Definition at line 194 of file StackElement.cxx.

◆ UNARY_MATH_FUNCTION

#define UNARY_MATH_FUNCTION (   FUNC,
  BASEFUNC 
)
Value:
StackElement StackElement::FUNC() { \
if (this->m_moved) throw std::logic_error("Content already moved");\
StackElement temp( std::move(*this) ); \
this->m_moved=true; \
temp.makeDouble(); \
if( temp.m_type == SE_DOUBLE ) { \
temp.m_doubleVal = BASEFUNC( temp.m_doubleVal ); \
return temp; \
} else if( temp.m_type == SE_VECDOUBLE ) { \
for( double& value : temp.m_vecDoubleVal ) { \
value = BASEFUNC( value ); \
} \
return temp; \
} else { \
/* @TODO throw exception */ \
return temp; \
} \
}

Helper macro for implementing many of the mathematical functions.

Definition at line 641 of file StackElement.cxx.

StackElement
void * StackElement
One element of a stack trace.
Definition: stackstash.h:74
athena.value
value
Definition: athena.py:124
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44