##// END OF EJS Templates
Adds the ability to force an acquisition pending for an operation (2)...
Adds the ability to force an acquisition pending for an operation (2) Handles flag in the test

File last commit:

r697:710e631137a0
r1250:a7d21961e1ef
Show More
ArrayDataIterator.h
74 lines | 2.5 KiB | text/x-c | CLexer
/ core / include / Data / ArrayDataIterator.h
Alexandre Leroux
Creates general iterator for ArrayData
r640 #ifndef SCIQLOP_ARRAYDATAITERATOR_H
#define SCIQLOP_ARRAYDATAITERATOR_H
#include "CoreGlobal.h"
#include "Data/SqpIterator.h"
Alexandre Leroux
Adds method into ArrayData and DataSeries iterator to get all values
r667 #include <QVector>
Alexandre Leroux
Creates general iterator for ArrayData
r640 #include <memory>
/**
* @brief The ArrayDataIteratorValue class represents the current value of an array data iterator.
* It offers standard access methods for the data in the series (at(), first()), but it is up to
* each array data to define its own implementation of how to retrieve this data (one-dim or two-dim
* array), by implementing the ArrayDataIteratorValue::Impl interface
* @sa ArrayDataIterator
*/
class SCIQLOP_CORE_EXPORT ArrayDataIteratorValue {
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
Creates general iterator for ArrayData
r640 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
Creates general iterator for ArrayData
r640 virtual void prev() = 0;
virtual double at(int componentIndex) const = 0;
virtual double first() const = 0;
virtual double min() const = 0;
virtual double max() 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
Creates general iterator for ArrayData
r640 };
explicit ArrayDataIteratorValue(std::unique_ptr<Impl> impl);
ArrayDataIteratorValue(const ArrayDataIteratorValue &other);
ArrayDataIteratorValue &operator=(ArrayDataIteratorValue other);
Alexandre Leroux
Makes random access iterators...
r689 int distance(const ArrayDataIteratorValue &other) const;
Alexandre Leroux
Creates general iterator for ArrayData
r640 bool equals(const ArrayDataIteratorValue &other) const;
Alexandre Leroux
Makes random access iterators...
r689 bool lowerThan(const ArrayDataIteratorValue &other) const;
Alexandre Leroux
Creates general iterator for ArrayData
r640
Alexandre Leroux
Makes random access iterators...
r689 ArrayDataIteratorValue advance(int offset) const;
Alexandre Leroux
Creates general iterator for ArrayData
r640 /// Advances to the next value
Alexandre Leroux
Improves random access iterator performance
r697 void next(int offset = 1);
Alexandre Leroux
Creates general iterator for ArrayData
r640 /// Moves back to the previous value
void prev();
/// Gets value of a specified component
double at(int componentIndex) const;
/// Gets value of first component
double first() const;
/// Gets min value among all components
double min() const;
/// Gets max value among all components
double max() const;
Alexandre Leroux
Adds method into ArrayData and DataSeries iterator to get all values
r667 /// Gets all values
QVector<double> values() const;
Alexandre Leroux
Creates general iterator for ArrayData
r640
Alexandre Leroux
Adapts iterator to be MoveAssignable...
r674 Impl *impl();
friend void swap(ArrayDataIteratorValue &lhs, ArrayDataIteratorValue &rhs)
{
std::swap(lhs.m_Impl, rhs.m_Impl);
}
Alexandre Leroux
Creates general iterator for ArrayData
r640 private:
std::unique_ptr<Impl> m_Impl;
};
using ArrayDataIterator = SqpIterator<ArrayDataIteratorValue>;
#endif // SCIQLOP_ARRAYDATAITERATOR_H