14 #include <type_traits> 17 #include <unordered_map> 19 inline double Abs(
double val)
21 return val < 0 ? -val : val;
59 typedef typename std::deque<Point>::iterator
Iterator;
69 _name = std::move(other._name);
70 _points = std::move(other._points);
86 virtual size_t size()
const;
92 const Point &
at(
size_t index)
const;
144 std::unordered_map<std::string, PlotData>
numeric;
147 std::unordered_map<std::string, PlotData>::iterator
addNumeric(
const std::string&
name)
149 return numeric.emplace( std::piecewise_construct,
150 std::forward_as_tuple(name),
151 std::forward_as_tuple(name)
158 return user_defined.emplace( std::piecewise_construct,
159 std::forward_as_tuple(name),
160 std::forward_as_tuple(name)
168 template<
typename Value>
171 if( prefix.empty() )
return;
173 std::unordered_map<std::string, Value> temp;
178 key.reserve( prefix.size() + 2 + it.first.size() );
179 if( it.first.front() ==
'/' )
181 key = prefix + it.first;
184 key = prefix +
"/" + it.first;
187 auto new_plot = temp.emplace( std::piecewise_construct,
188 std::forward_as_tuple(key),
189 std::forward_as_tuple(key) ).first;
191 new_plot->second.swapData( it.second );
204 template<
typename Time,
typename Value>
210 static_assert( std::is_arithmetic<Time>::value ,
"Only numbers can be used as time");
213 template <
typename Time,
typename Value>
228 if( std::isinf( point.
y ) || std::isnan( point.
y ) )
241 template <
typename Time,
typename Value>
249 {
return a.
x <
b.x; } );
250 auto index = std::distance(
_points.begin(), lower);
275 template <
typename Time,
typename Value>
286 template <
typename Time,
typename Value>
293 template <
typename Time,
typename Value>
300 template<
typename Time,
typename Value>
307 template <
typename Time,
typename Value>
313 template <
typename Time,
typename Value>
319 template <
typename Time,
typename Value>
326 template <
typename Time,
typename Value>
std::deque< Point >::const_iterator ConstIterator
void swap(any &x, any &y) any_noexcept
std::unordered_map< std::string, PlotData > numeric
const Point & operator[](size_t index) const
void setMaximumRangeX(Time max_range)
PlotDataGeneric(const std::string &name)
const Point & at(size_t index) const
virtual ~PlotDataGeneric()
int getIndexFromX(Time x) const
std::deque< Point > _points
std::unordered_map< std::string, PlotDataAny >::iterator addUserDefined(const std::string &name)
const std::string & name() const
std::unordered_map< std::string, PlotDataAny > user_defined
PlotDataGeneric & operator=(const PlotDataGeneric< Time, Value > &other)=delete
void swapData(PlotDataGeneric< Time, Value > &other)
ConstIterator begin() const
void resize(size_t new_size)
Point & operator[](size_t index)
const Point & front() const
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE const tfScalar & x() const
std::deque< Point >::iterator Iterator
virtual size_t size() const
QColor getColorHint() const
nonstd::optional< RangeValue > RangeValueOpt
nonstd::optional< Value > getYfromX(Time x) const
std::unordered_map< std::string, PlotData >::iterator addNumeric(const std::string &name)
void AddPrefixToPlotData(const std::string &prefix, std::unordered_map< std::string, Value > &data)
PlotDataGeneric< double, nonstd::any > PlotDataAny
const Point & back() const
void setColorHint(QColor color)
PlotDataGeneric(PlotDataGeneric &&other)
nonstd::optional< RangeTime > RangeTimeOpt
PlotDataGeneric< double, double > PlotData
Time maximumRangeX() const
ConstIterator end() const