##// END OF EJS Templates
Creates DataSeriesUtils file that will contain methods for handling data holes...
Creates DataSeriesUtils file that will contain methods for handling data holes Renames DataSeriesUtils file in unit tests to avoid conflicts

File last commit:

r697:710e631137a0
r1019:fce4a3cd44f3
Show More
DataSeriesIterator.h
78 lines | 2.6 KiB | text/x-c | CLexer
/ core / include / Data / DataSeriesIterator.h
Alexandre Leroux
Defines an iterator for a data series...
r595 #ifndef SCIQLOP_DATASERIESITERATOR_H
#define SCIQLOP_DATASERIESITERATOR_H
#include "CoreGlobal.h"
Alexandre Leroux
Updates DataSeriesIterator to make an iterator general to SciQlop
r639 #include "Data/SqpIterator.h"
Alexandre Leroux
Defines an iterator for a data series...
r595
Alexandre Leroux
Adds method into ArrayData and DataSeries iterator to get all values
r667 #include <QVector>
Alexandre Leroux
Defines an iterator for a data series...
r595 #include <memory>
/**
* @brief The DataSeriesIteratorValue class represents the current value of a data series iterator.
* It offers standard access methods for the data in the series (x-axis, values), but it is up to
* each series to define its own implementation of how to retrieve this data, by implementing the
* DataSeriesIteratorValue::Impl interface
*
* @sa DataSeriesIterator
*/
class SCIQLOP_CORE_EXPORT DataSeriesIteratorValue {
public:
struct Impl {
virtual ~Impl() noexcept = default;
virtual std::unique_ptr<Impl> clone() const = 0;
Alexandre Leroux
Makes random access iterators...
r689 virtual int distance(const Impl &other) const = 0;
Alexandre Leroux
Defines an iterator for a data series...
r595 virtual bool equals(const Impl &other) const = 0;
Alexandre Leroux
Makes random access iterators...
r689 virtual bool lowerThan(const Impl &other) const = 0;
virtual std::unique_ptr<Impl> advance(int offset) const = 0;
Alexandre Leroux
Improves random access iterator performance
r697 virtual void next(int offset) = 0;
Alexandre Leroux
Defines an iterator for a data series...
r595 virtual void prev() = 0;
virtual double x() const = 0;
virtual double value() const = 0;
virtual double value(int componentIndex) const = 0;
Alexandre Leroux
Implements method to get min/max values of a dataseries giving a range (2)
r609 virtual double minValue() const = 0;
virtual double maxValue() const = 0;
Alexandre Leroux
Adds method into ArrayData and DataSeries iterator to get all values
r667 virtual QVector<double> values() const = 0;
Alexandre Leroux
Adapts iterator to be MoveAssignable...
r674
virtual void swap(Impl &other) = 0;
Alexandre Leroux
Defines an iterator for a data series...
r595 };
explicit DataSeriesIteratorValue(std::unique_ptr<Impl> impl);
DataSeriesIteratorValue(const DataSeriesIteratorValue &other);
DataSeriesIteratorValue &operator=(DataSeriesIteratorValue other);
Alexandre Leroux
Makes random access iterators...
r689 int distance(const DataSeriesIteratorValue &other) const;
Alexandre Leroux
Defines an iterator for a data series...
r595 bool equals(const DataSeriesIteratorValue &other) const;
Alexandre Leroux
Makes random access iterators...
r689 bool lowerThan(const DataSeriesIteratorValue &other) const;
Alexandre Leroux
Defines an iterator for a data series...
r595
Alexandre Leroux
Makes random access iterators...
r689 DataSeriesIteratorValue advance(int offset) const;
Alexandre Leroux
Defines an iterator for a data series...
r595 /// Advances to the next value
Alexandre Leroux
Improves random access iterator performance
r697 void next(int offset = 1);
Alexandre Leroux
Defines an iterator for a data series...
r595 /// Moves back to the previous value
void prev();
/// Gets x-axis data
double x() const;
/// Gets value data
double value() const;
/// Gets value data depending on an index
double value(int componentIndex) const;
Alexandre Leroux
Implements method to get min/max values of a dataseries giving a range (2)
r609 /// Gets min of all values data
double minValue() const;
/// Gets max of all values data
double maxValue() const;
Alexandre Leroux
Adds method into ArrayData and DataSeries iterator to get all values
r667 /// Gets all values data
QVector<double> values() const;
Alexandre Leroux
Defines an iterator for a data series...
r595
Alexandre Leroux
Adapts iterator to be MoveAssignable...
r674 Impl *impl();
friend void swap(DataSeriesIteratorValue &lhs, DataSeriesIteratorValue &rhs)
{
std::swap(lhs.m_Impl, rhs.m_Impl);
}
Alexandre Leroux
Defines an iterator for a data series...
r595 private:
std::unique_ptr<Impl> m_Impl;
};
Alexandre Leroux
Updates DataSeriesIterator to make an iterator general to SciQlop
r639 using DataSeriesIterator = SqpIterator<DataSeriesIteratorValue>;
Alexandre Leroux
Defines an iterator for a data series...
r595
#endif // SCIQLOP_DATASERIESITERATOR_H