6 #ifndef PLOTUNARYOPERATOR_H_
7 #define PLOTUNARYOPERATOR_H_
9 #include "plotsconfig.h"
11 #include "plotexpression.h"
13 #include <QTextStream>
67 template <
class Operator>
85 virtual inline double sample(
double sampleTime)
const
92 inline const QString &
opStr()
const {
return _opStr; }
96 inline void setOpStr(
const QString &str) { _opStr = str; }
109 virtual QString stringExpression()
const
112 QTextStream stream(&str);
120 #endif // PLOTUNARYOPERATOR_H_
void setOperand(PlotExpression *operand)
Set the operand expression.
Definition: plotunaryoperator.h:32
PlotUnaryOperatorT()
Default constructor: operand is null.
Definition: plotunaryoperator.h:72
virtual void unbind()
Unbind the operand.
virtual PlotExpression * clone() const
Deep clone.
Definition: plotunaryoperator.h:99
An extension of PlotExpression defining a unary operation.
Definition: plotunaryoperator.h:20
Supports multiple bindings of the same expression to different curves.
Definition: plotbindingtracker.h:34
const QString & opStr() const
Return the string used to prefix the operand.
Definition: plotunaryoperator.h:92
const PlotExpression * operand() const
Get the operand expression.
Definition: plotunaryoperator.h:36
Core data for binding a PlotExpression.
Definition: plotexpressionbinddomain.h:49
virtual PlotExpression * clone() const =0
Performs a deep clone of the PlotExpression.
BindResult
Return values for the PlotExpression::bind() method.
Definition: plotexpressionbinddomain.h:15
PlotUnaryOperator(PlotExpression *operand)
Create a binary operator on the given left and right expressions.
Definition: plotunaryoperator.h:25
void setOpStr(const QString &str)
Sets the string used to prefix the operand.
Definition: plotunaryoperator.h:96
virtual double sample(double sampleTime) const
Sample the operand and evaluate the Operator.
Definition: plotunaryoperator.h:85
bool explicitTime() const override
Is the generated expression sensitive to changes in the time domain?
QString toString() const
Converts the PlotExpression into a parseable string form.
Definition: plotexpression.h:147
PlotUnaryOperatorT(PlotExpression *operand)
Constructor.
Definition: plotunaryoperator.h:76
~PlotUnaryOperator()
Destructor, destroying the child.
A template unary operator, using a functional object to evaluate the expression.
Definition: plotunaryoperator.h:68
virtual double sample(double sampleTime) const =0
Called to generate a sample at sampleTime.
A PlotExpression represents an operation in a plot equation.
Definition: plotexpression.h:91
virtual BindResult bind(const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &domain, bool repeatLastBinding=false)
Binds the operand expression.