OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Expressions::SBinary< T, U > Class Template Reference

A scalar expression with two scalar operands. More...

#include <SBinary.h>

Inheritance diagram for Expressions::SBinary< T, U >:
Collaboration diagram for Expressions::SBinary< T, U >:

Public Member Functions

 SBinary (const TFunction2< T, U > &function, PtrToScalar< U > left, PtrToScalar< U > right)
 Constructor.
 SBinary (const SBinary< T, U > &)
virtual ~SBinary ()
virtual Scalar< T > * clone () const
 Make clone.
virtual T evaluate () const
 Evaluate.
virtual void print (std::ostream &str, int precedence=99) const
 Print expression.
virtual bool isConstant () const
 Test for constant.

Static Public Member Functions

static Scalar< T > * make (const TFunction2< T, U > &, PtrToScalar< U > left, PtrToScalar< U > right)
 Make a new expression.

Private Member Functions

 SBinary ()
void operator= (const SBinary &)

Private Attributes

const TFunction2< T, U > & fun
PtrToScalar< U > lft
PtrToScalar< U > rgt

Detailed Description

template<class T, class U>
class Expressions::SBinary< T, U >

A scalar expression with two scalar operands.

Definition at line 39 of file SBinary.h.

Constructor & Destructor Documentation

◆ SBinary() [1/3]

template<class T, class U>
Expressions::SBinary< T, U >::SBinary ( const TFunction2< T, U > & function,
PtrToScalar< U > left,
PtrToScalar< U > right )
inline

Constructor.

Definition at line 93 of file SBinary.h.

References fun, lft, and rgt.

Referenced by clone(), make(), operator=(), and SBinary().

◆ SBinary() [2/3]

template<class T, class U>
Expressions::SBinary< T, U >::SBinary ( const SBinary< T, U > & rhs)
inline

Definition at line 86 of file SBinary.h.

References clone(), fun, lft, rgt, SBinary(), and Expressions::Scalar< T >::Scalar().

Here is the call graph for this function:

◆ ~SBinary()

template<class T, class U>
Expressions::SBinary< T, U >::~SBinary ( )
inlinevirtual

Definition at line 100 of file SBinary.h.

◆ SBinary() [3/3]

template<class T, class U>
Expressions::SBinary< T, U >::SBinary ( )
private

Member Function Documentation

◆ clone()

template<class T, class U>
Scalar< T > * Expressions::SBinary< T, U >::clone ( ) const
inlinevirtual

Make clone.

Implements Expressions::Scalar< T >.

Definition at line 105 of file SBinary.h.

References SBinary(), and Expressions::Scalar< T >::Scalar().

Referenced by SBinary().

Here is the call graph for this function:

◆ evaluate()

template<class T, class U>
T Expressions::SBinary< T, U >::evaluate ( ) const
inlinevirtual

Evaluate.

Implements Expressions::Scalar< T >.

Definition at line 111 of file SBinary.h.

References fun, lft, and rgt.

◆ isConstant()

template<class T>
bool Expressions::Scalar< T >::isConstant ( ) const
inlinevirtualinherited

Test for constant.

Reimplemented in Expressions::SConstant< T >.

Definition at line 282 of file AbstractObjects/Expressions.h.

◆ make()

template<class T, class U>
Scalar< T > * Expressions::SBinary< T, U >::make ( const TFunction2< T, U > & function,
PtrToScalar< U > left,
PtrToScalar< U > right )
inlinestatic

Make a new expression.

Definition at line 135 of file SBinary.h.

References OwnPtr< Object >::release(), SBinary(), and Expressions::Scalar< T >::Scalar().

Referenced by Line::parse(), Expressions::parseAnd(), Expressions::parseBool(), Expressions::parseFactor(), Expressions::parsePrimary(), Expressions::parseReal(), Expressions::parseRelation(), and Expressions::parseTerm().

Here is the call graph for this function:

◆ operator=()

template<class T, class U>
void Expressions::SBinary< T, U >::operator= ( const SBinary< T, U > & )
private

References SBinary().

Here is the call graph for this function:

◆ print()

template<class T, class U>
void Expressions::SBinary< T, U >::print ( std::ostream & str,
int precedence = 99 ) const
inlinevirtual

Print expression.

Implements Expressions::Scalar< T >.

Definition at line 156 of file SBinary.h.

References fun, lft, and rgt.

Member Data Documentation

◆ fun

template<class T, class U>
const TFunction2<T, U>& Expressions::SBinary< T, U >::fun
private

Definition at line 74 of file SBinary.h.

Referenced by evaluate(), print(), SBinary(), and SBinary().

◆ lft

template<class T, class U>
PtrToScalar<U> Expressions::SBinary< T, U >::lft
private

Definition at line 77 of file SBinary.h.

Referenced by evaluate(), print(), SBinary(), and SBinary().

◆ rgt

template<class T, class U>
PtrToScalar<U> Expressions::SBinary< T, U >::rgt
private

Definition at line 78 of file SBinary.h.

Referenced by evaluate(), print(), SBinary(), and SBinary().


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