##// END OF EJS Templates
Some WIP refactoring, trying to remove TimeController object...
Some WIP refactoring, trying to remove TimeController object SciQLOP core should be usable OOTB without creating controllers objects. Time range should be given on variable creation not taken from a global object. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r864:05c98ddf38b8
r1345:ce477e992869
Show More
DataSeriesBuilders.h
74 lines | 2.2 KiB | text/x-c | CLexer
/ core / tests / Data / DataSeriesBuilders.h
#ifndef SCIQLOP_DATASERIESBUILDERS_H
#define SCIQLOP_DATASERIESBUILDERS_H
#include <memory>
#include <vector>
class ScalarSeries;
class SpectrogramSeries;
class VectorSeries;
/**
* @brief The ScalarBuilder class aims to facilitate the creation of a ScalarSeries for unit tests
* @sa ScalarSeries
*/
class ScalarBuilder {
public:
/// Sets x-axis data of the series
ScalarBuilder & setX(std::vector<double> xData);
/// Sets values data of the series
ScalarBuilder & setValues(std::vector<double> valuesData);
/// Creates the series
std::shared_ptr<ScalarSeries> build();
private:
std::vector<double> m_XAxisData{};
std::vector<double> m_ValuesData{};
};
/**
* @brief The SpectrogramBuilder class aims to facilitate the creation of a SpectrogramSeries for unit tests
* @sa SpectrogramSeries
*/
class SpectrogramBuilder {
public:
/// Sets x-axis data of the series
SpectrogramBuilder & setX(std::vector<double> xData);
/// Sets y-axis data of the series
SpectrogramBuilder & setY(std::vector<double> yData);
/// Sets values data of the series
SpectrogramBuilder & setValues(std::vector<double> valuesData);
/// Creates the series
std::shared_ptr<SpectrogramSeries> build();
private:
std::vector<double> m_XAxisData{};
std::vector<double> m_YAxisData{};
std::vector<double> m_ValuesData{};
};
/**
* @brief The VectorBuilder class aims to facilitate the creation of a VectorSeries for unit tests
* @sa VectorSeries
*/
class VectorBuilder {
public:
/// Sets x-axis data of the series
VectorBuilder & setX(std::vector<double> xData);
/// Sets x-values data of the series
VectorBuilder & setXValues(std::vector<double> xValuesData);
/// Sets y-values data of the series
VectorBuilder & setYValues(std::vector<double> yValuesData);
/// Sets z-values data of the series
VectorBuilder & setZValues(std::vector<double> zValuesData);
/// Creates the series
std::shared_ptr<VectorSeries> build();
private:
std::vector<double> m_XAxisData{};
std::vector<double> m_XValuesData{};
std::vector<double> m_YValuesData{};
std::vector<double> m_ZValuesData{};
};
#endif // SCIQLOP_DATASERIESBUILDERS_H