Files
Upsilon/apps/statistics/data.h
Émilie Feral 2b9026db76 [apps/statistics] Improve the data model
Change-Id: I1efa7394a99c1eb397433d493a7ce7cbc162bf1f
2017-01-09 15:08:53 +01:00

40 lines
1.0 KiB
C++

#ifndef STATISTICS_DATA_H
#define STATISTICS_DATA_H
#include "../curve_view_window.h"
namespace Statistics {
class Data : public CurveViewWindow {
public:
Data();
// Delete the implicit copy constructor: the object is heavy
Data(const Data&) = delete;
int numberOfPairs() const;
float binWidth();
float valueAtIndex(int index);
int sizeAtIndex(int index);
void setValueAtIndex(float value, int index);
void setSizeAtIndex(int size, int index);
void deletePairAtIndex(int index);
int sizeAtValue(float value);
float xMin() override;
// if the range of value is to wide, value max returns valueMin + 10
float xMax() override;
float yMin() override;
float yMax() override;
float xGridUnit() override;
// TODO: decide the max number of elements after optimization
constexpr static int k_maxNumberOfPairs = 500;
private:
constexpr static int k_maxRangeValue = 320;
int m_sizes[k_maxNumberOfPairs];
float m_values[k_maxNumberOfPairs];
int m_numberOfPairs;
float m_binWidth;
};
}
#endif