Go to the documentation of this file.
7 #ifndef PJ_TIMESERIES_H
8 #define PJ_TIMESERIES_H
15 template <
typename Value>
69 bool need_sorting = (!
_points.empty() && p.x < this->
back().x);
74 [](
const auto& a,
const auto& b) { return a.x < b.x; });
89 auto const back_point_x =
_points.back().x;
105 template <
typename Value>
108 if (_points.size() == 0)
113 std::lower_bound(_points.begin(), _points.end(),
Point(
x, {}), TimeCompare);
114 auto index = std::distance(_points.begin(), lower);
116 if (index >= _points.size())
118 return _points.size() - 1;
125 if (index > 0 && (abs(_points[index - 1].
x -
x) < abs(_points[index].
x -
x)))
std::optional< Value > getYfromX(double x) const
void pushBack(const Point &p) override
TimeseriesBase & operator=(const TimeseriesBase &other)=delete
const PlotGroup::Ptr & group() const
const Point & back() const
std::shared_ptr< PlotGroup > Ptr
const T & move(const T &v)
static bool TimeCompare(const Point &a, const Point &b)
void setMaximumRangeX(double max_range)
void pushBack(Point &&p) override
typename PlotDataBase< double, StringRef >::Point Point
int getIndexFromX(double x) const
virtual void insert(Iterator it, Point &&p)
virtual void pushBack(const Point &p)
double maximumRangeX() const
std::deque< Point > _points
static constexpr nullopt_t nullopt
nullopt is a constant of type nullopt_t that is used to indicate optional type with uninitialized sta...
virtual bool isTimeseries() const override
TimeseriesBase(const std::string &name, PlotGroup::Ptr group)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:47