Workspace 6.21.5
Public Member Functions | List of all members
DataSeriesMapper Class Referenceabstract

Base class defining an interface for mapping a data series' values to other values.

#include <DataAnalysis/DataStructures/dataseriesmapper.h>

Inheritance diagram for DataSeriesMapper:
[legend]

Public Member Functions

DataSeriesMapperclone () const override=0
 
virtual Application::Memento::DatacreateMementoData (const DataSeries &dataSeries) const =0
 
virtual bool getValue (int index, double srcValue, double &destValue, Application::Memento::Data &mementoData) const =0
 
void logText (const QString &msg) const
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Member Function Documentation

◆ clone()

DataSeriesMapper * clone ( ) const
overridepure virtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

Implements Clonable.

Implemented in ScriptedDataSeriesMapper, and UnchangedDataSeriesMapper.

◆ createMementoData()

virtual Application::Memento::Data * createMementoData ( const DataSeries dataSeries) const
pure virtual
Parameters
dataSeriesThe model that will be used for mapping nodes to values.
Returns
A memento object which client code cannot do anything useful with except pass it around. The memento is ultimately only useful to the getValue() function. It holds internal data the mapper will use to perform the required mapping.

Implemented in ScriptedDataSeriesMapper, and UnchangedDataSeriesMapper.

◆ getValue()

virtual bool getValue ( int  index,
double  srcValue,
double &  destValue,
Application::Memento::Data mementoData 
) const
pure virtual
Parameters
indexThe index of the item being mapped.
srcValueThe value of the source data series at the specified index.
destValueThe mapped value should be assigned to this before returning.
mementoDataMust be the same object supplied by a previous call to createMementoData().
Returns
True if the srcValue could be mapped. If there was some kind of error, false should be returned and the caller should not attempt to continue mapping values.

Implemented in ScriptedDataSeriesMapper, and UnchangedDataSeriesMapper.

◆ logText()

void logText ( const QString &  msg) const
Parameters
msgThe message to log.

This function forwards the msg to the main application log stream.