76 explicit StepRange(T
const mini, T
const stepi, T
const maxi);
122 T itsMin, itsStep, itsMax;
131 template <
typename T>
136 template <
typename T>
151 template <
typename T>
156 template <
typename T>
162#include <jevois/Types/details/StepRangeImpl.H>
A generic range class with a step.
StepRange(T const mini, T const stepi, T const maxi)
Constructor.
std::ostream & operator<<(std::ostream &out, StepRange< T > const &r)
Stream out as "min...(step)...max".
StepRange(StepRange< T > const &other)=default
Copy constructor.
bool operator==(StepRange< T > const &range1, StepRange< T > const &range2)
Equality test: StepRange<T> == StepRange<T>
bool operator!=(StepRange< T > const &range1, StepRange< T > const &range2)
Inequality test: StepRange<T> != StepRange<T>
StepRange(StepRange< T > &&other)=default
Move constructor.
void paramStringToVal(std::string const &valstring, StepRange< T > &result)
Machine-readable input from a string, for use in jevois::Parameter: reads min...step....
bool isValueValid(T const val) const
Return true if a value is valid (i.e., it is min, min+step, min+step*2, ... or max)
T const & min() const
Return the minimum value.
void paramValToString(StepRange< T > const &val, std::string &result)
Machine-readable output to a string, for use in jevois::Parameter: outputs min...step....
StepRange< T > & operator=(StepRange< T > const &other)=default
Assignment.
bool empty() const
Return whether min() == max()
StepRange(StepRange< U > const &other)
Copy-conversion constructor, uses jevois::clamped_convert<T,U> internally.
StepRange()
Default constructor, range is [0 .. (0) .. 0].
std::istream & operator>>(std::istream &in, StepRange< T > &r)
Stream in as "min...(step)...max".
T const & max() const
Return the maximum value.
T const & step() const
Return the step value.
StepRange< T > & operator=(StepRange< T > &&other)=default
Move assignment.
Main namespace for all JeVois classes and functions.