Gaia
gaia2::Applier Class Referenceabstract

The Applier abstract base class. More...

#include <applier.h>

Inheritance diagram for gaia2::Applier:
gaia2::AddFieldApplier gaia2::Distribute gaia2::DotProduct gaia2::EnumerateApplier gaia2::ExtractApplier gaia2::FixLengthApplier gaia2::MatMult gaia2::Merge gaia2::MergeRegionApplier gaia2::RemoveDesc gaia2::RenameApplier gaia2::SelectDesc gaia2::SVMPredict

Public Member Functions

 Applier (const Transformation &transfo)
 
void checkLayout (const PointLayout &layout) const
 Check that the given layout is the same as the one that was used during the analysis part of this transformation. More...
 
void checkLayout (const DataSet *dataset) const
 Check that the given dataset has the same layout as the one that was used during the analysis part of this transformation. More...
 
virtual PointmapPoint (const Point *p) const =0
 Ownership of resulting point is handed to caller of this function.
 
virtual DataSetmapDataSet (const DataSet *dataset) const
 Provides a default function that maps a whole dataset but which can be overriden in derived classes to provide a more efficient implementation.
 

Protected Member Functions

void transferHistory (const DataSet *original, DataSet *destination) const
 This method tranfers the transformation history from the original dataset to the one being created, and adds itself at the end of the history.
 
void addPointsNoLayoutCheck (DataSet *dataset, const QVector< Point * > &points) const
 Adds the given points to a DataSet without checking for the layout to be correct. More...
 

Protected Attributes

Transformation _transfo
 

Detailed Description

The Applier abstract base class.

Derived classes will have to implement a constructor taking all its arguments as a string, and a mapPoint method. They will also have to set _originalDimension and _targetDimension in the constructor, as well as the other specific params they need for themselves. A helper function checkSize should be called at the very beginning of the mapPoint method to ensure consistency in error reporting. Do not forget as well to call the transferHistory() helper method at the end of your mapDataSet() function, or you might end up with invalid datasets (NB: it needs to be at the end, not at the beginning).

Member Function Documentation

void gaia2::Applier::addPointsNoLayoutCheck ( DataSet dataset,
const QVector< Point * > &  points 
) const
protected

Adds the given points to a DataSet without checking for the layout to be correct.

The guarantee that it is correct is provided by the Applier algorithm.

References gaia2::DataSet::addPoints().

void gaia2::Applier::checkLayout ( const PointLayout layout) const

Check that the given layout is the same as the one that was used during the analysis part of this transformation.

Exceptions
GaiaExceptionif the layout was different than the current one.

References gaia2::PointLayout::symmetricDifferenceWith().

Referenced by checkLayout(), and gaia2::DotProduct::mapPoint().

void gaia2::Applier::checkLayout ( const DataSet dataset) const

Check that the given dataset has the same layout as the one that was used during the analysis part of this transformation.

Also check that the dataset is consistent.

Exceptions
GaiaExceptionif the layout was different than the current one.

References gaia2::DataSet::checkAllPointsShareSameLayout(), checkLayout(), and gaia2::DataSet::layout().


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