OpenCurves  0.9
PlotFunctionResult Struct Reference

Result value from a PlotFunction. More...

#include <plotfunctionresult.h>

Public Member Functions

 PlotFunctionResult (double value=0)
 Constructor - both display and logical values are set to value. More...
 
 PlotFunctionResult (double display, double logical)
 Constructor accepting distinct display and logical values. More...
 
 PlotFunctionResult (const PlotFunctionResult &other)
 Copy constructor. More...
 
PlotFunctionResultoperator= (double value)
 Assignment - both display and logical values are set to value. More...
 
PlotFunctionResultoperator= (const PlotFunctionResult &other)
 Assignment - copy. More...
 

Public Attributes

double displayValue
 Value to display.
 
double logicalValue
 Value referenced in further evaluations of the function.
 

Detailed Description

Result value from a PlotFunction.

This structure allows a distinction between the value displayed by the function

  • the displayValue - and that used in future evaluations - the logicalValue.

The displayValue is what is returned in as the current sample value. The logical can prevent bad results in certain calculates, such as the total() function. Actual use depends on the function implementation. In most cases, the logicalValue should be treated as authoritative.

Note that the logicalValue is used in calculating PlotFunctionInfo::total.

The results of evaluation are generally assigned using the assignment operator. This writes to both the display and logical value. In some cases, the logical value may mark an invalid result (NaN or infinite), in which case a different display value may be written (e.g., 0).

Constructor & Destructor Documentation

PlotFunctionResult::PlotFunctionResult ( double  value = 0)
inline

Constructor - both display and logical values are set to value.

Parameters
valueThe value to set.
PlotFunctionResult::PlotFunctionResult ( double  display,
double  logical 
)
inline

Constructor accepting distinct display and logical values.

Parameters
displayThe displayValue to set.
logicalThe logicalValue to set.
PlotFunctionResult::PlotFunctionResult ( const PlotFunctionResult other)
inline

Copy constructor.

Parameters
otherThe object to copy values from.

Member Function Documentation

PlotFunctionResult& PlotFunctionResult::operator= ( double  value)
inline

Assignment - both display and logical values are set to value.

Parameters
valueThe value to set.
PlotFunctionResult& PlotFunctionResult::operator= ( const PlotFunctionResult other)
inline

Assignment - copy.

Parameters
otherThe object to copy values from.

References displayValue, and logicalValue.


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