OpenCurves  0.9
PlotBinaryOperator Class Reference

An extension of PlotExpression defining a binary operation. More...

#include <plotbinaryoperator.h>

Inheritance diagram for PlotBinaryOperator:
PlotExpression PlotBinaryOperatorT< Operator > PlotBinaryOperatorT< Power< double > > PlotBinaryOperatorT< std::divides< double > > PlotBinaryOperatorT< std::minus< double > > PlotBinaryOperatorT< std::multiplies< double > > PlotBinaryOperatorT< std::plus< double > > PlotIndexExpression PlotPower PlotDivide PlotSubtract PlotMultiply PlotAdd

Public Member Functions

 PlotBinaryOperator (PlotExpression *left, PlotExpression *right)
 Create a binary operator on the given left and right expressions. More...
 
 ~PlotBinaryOperator ()
 Destructor, destroying left and right.
 
void setLeft (PlotExpression *left)
 Set the left branch. More...
 
const PlotExpressionleft () const
 Get the left branch. More...
 
void setRight (PlotExpression *right)
 Set the right branch. More...
 
const PlotExpressionright () const
 Get the right branch. More...
 
virtual BindResult bind (const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &domain, bool repeatLastBinding=false)
 Binds the left and right branch expressions. More...
 
virtual void unbind ()
 Unbind left and right branches.
 
bool explicitTime () const override
 Is the generated expression sensitive to changes in the time domain? More...
 
- Public Member Functions inherited from PlotExpression
 PlotExpression ()
 Empty constructor.
 
virtual ~PlotExpression ()
 Empty, virtual destructor.
 
virtual double sample (double sampleTime) const =0
 Called to generate a sample at sampleTime. More...
 
virtual PlotExpressionclone () const =0
 Performs a deep clone of the PlotExpression. More...
 
QString toString () const
 Converts the PlotExpression into a parseable string form. More...
 

Detailed Description

An extension of PlotExpression defining a binary operation.

This is essentially a binary in the expression tree.

This tracks the branches and manages binding, but derivations are required to implement the sample() function.

Constructor & Destructor Documentation

PlotBinaryOperator::PlotBinaryOperator ( PlotExpression left,
PlotExpression right 
)
inline

Create a binary operator on the given left and right expressions.

Parameters
leftThe left expression.
rightThe right expression.

Member Function Documentation

virtual BindResult PlotBinaryOperator::bind ( const QList< PlotInstance * > &  curves,
PlotBindingTracker bindTracker,
PlotExpressionBindDomain domain,
bool  repeatLastBinding = false 
)
virtual

Binds the left and right branch expressions.

Handles exhaustive binding.

Implements PlotExpression.

bool PlotBinaryOperator::explicitTime ( ) const
overridevirtual

Is the generated expression sensitive to changes in the time domain?

Returns
True if any child returns true.

Reimplemented from PlotExpression.

const PlotExpression* PlotBinaryOperator::left ( ) const
inline
const PlotExpression* PlotBinaryOperator::right ( ) const
inline
void PlotBinaryOperator::setLeft ( PlotExpression left)
inline

Set the left branch.

Does not release the existing branch.

Parameters
leftThe new branch.

References left().

void PlotBinaryOperator::setRight ( PlotExpression right)
inline

Set the right branch.

Does not release the existing branch.

Parameters
rightThe new branch.

References right().


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