AmpGen 2.1
Loading...
Searching...
No Matches
AmpGen::Ternary Class Reference

Detailed Description

The equivalent c++ code would be

return a ? b : c

Definition at line 233 of file Expression.h.

Public Member Functions

 Ternary (const Expression &cond, const Expression &v1, const Expression &v2)
 
std::string to_string (const ASTResolver *resolver=nullptr) const override
 Called to convert the Expression tree into source code.
 
void resolve (ASTResolver &resolver) const override
 Resolve the dependencies of a tree using an ASTResolver, which keeps track of parameters, dependent sub-trees, etc.
 
 operator Expression () const
 
complex_t operator() () const override
 Evaluate the expression using the tree, will generally be very slow but ocassionally useful for debugging.
 
Inheritance diagram for AmpGen::Ternary:
AmpGen::IExpression

Constructor & Destructor Documentation

◆ Ternary()

AmpGen::Ternary::Ternary ( const Expression & cond,
const Expression & v1,
const Expression & v2 )

Member Function Documentation

◆ operator Expression()

AmpGen::Ternary::operator Expression ( ) const

◆ operator()()

complex_t AmpGen::Ternary::operator() ( ) const
inlineoverridevirtual

Implements AmpGen::IExpression.

Definition at line 239 of file Expression.h.

◆ resolve()

void AmpGen::Ternary::resolve ( ASTResolver & resolver) const
overridevirtual
Parameters
resolverresolver object to use

Implements AmpGen::IExpression.

◆ to_string()

std::string AmpGen::Ternary::to_string ( const ASTResolver * resolver = nullptr) const
overridevirtual
Returns
The source code as a string

Implements AmpGen::IExpression.


The documentation for this class was generated from the following file: