OpenCurves
0.9
|
A template unary operator, using a functional object to evaluate the expression. More...
#include <plotunaryoperator.h>
Public Member Functions | |
PlotUnaryOperatorT () | |
Default constructor: operand is null. | |
PlotUnaryOperatorT (PlotExpression *operand) | |
Constructor. More... | |
virtual double | sample (double sampleTime) const |
Sample the operand and evaluate the Operator . More... | |
const QString & | opStr () const |
Return the string used to prefix the operand. More... | |
void | setOpStr (const QString &str) |
Sets the string used to prefix the operand. More... | |
virtual PlotExpression * | clone () const |
Deep clone. | |
![]() | |
PlotUnaryOperator (PlotExpression *operand) | |
Create a binary operator on the given left and right expressions. More... | |
~PlotUnaryOperator () | |
Destructor, destroying the child. | |
void | setOperand (PlotExpression *operand) |
Set the operand expression. More... | |
const PlotExpression * | operand () const |
Get the operand expression. More... | |
virtual BindResult | bind (const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &domain, bool repeatLastBinding=false) |
Binds the operand expression. | |
virtual void | unbind () |
Unbind the operand. | |
bool | explicitTime () const override |
Is the generated expression sensitive to changes in the time domain? More... | |
![]() | |
PlotExpression () | |
Empty constructor. | |
virtual | ~PlotExpression () |
Empty, virtual destructor. | |
QString | toString () const |
Converts the PlotExpression into a parseable string form. More... | |
A template unary operator, using a functional object to evaluate the expression.
This class extends the PlotUnaryOperator
to create a concrete derivation which uses Operator
evaluate the expression. The Operator
type must be an object supporting the bracket operator accepting one double
argument and returning a double
. The operator performs the expression calculations. For example, std::negate<double>
.
As a convenience, the object supports a opStr()
, which is used when toString()
is called. Essentially, the complete string is formed by: opStr() + operand()->toString()
.
Operator | The functional object used to evaluate the expression. |
|
inline |
Constructor.
operand | Operand expression. |
|
inline |
Return the string used to prefix the operand.
|
inlinevirtual |
Sample the operand and evaluate the Operator
.
Evaluates operand
at sampleTime
, and passes the result to Operator
for evaluation.
sampleTime | The time to sample at. |
Operator
. Implements PlotExpression.
|
inline |
Sets the string used to prefix the operand.
str | The operation string. |
Referenced by PlotUnaryOperatorT< std::negate< double > >::clone().