26#include <boost/regex.hpp>
61 virtual std::string
const str()
const = 0;
81 virtual std::string
const str()
const;
104 virtual std::string
const str()
const;
112 template <
typename T>
129 virtual std::string
const str()
const;
137 template <
typename T>
154 virtual std::string
const str()
const;
174 template <
typename T>
192 virtual std::string
const str()
const;
203#include <jevois/Component/details/ValidValuesSpecImpl.H>
A generic range class with a step.
Base class for specifying a set of valid values for a type.
virtual ~ValidValuesSpecBase()
Destructor.
virtual std::string const str() const =0
Convert the specification of valid values to a readable string.
ValidValuesSpecBase()
Construct, for the base class this is a no-op.
virtual bool checkValueValidity(T const &val) const =0
Check whether a proposed value is valid, return true if it is.
Finite list valid values spec, everything listed at construction is valid, anything else is not.
virtual ~ValidValuesSpecList()
Destructor.
std::vector< T > const itsValidList
Our list of valid values.
virtual bool checkValueValidity(T const &val) const
Check whether a proposed value is valid, returns true iff value is in our list.
ValidValuesSpecList()=delete
No default constructor, always need to provide a list.
ValidValuesSpecList(std::vector< T > const &valid_list)
Construct from a given list of valid values in a vector.
virtual std::string const str() const
Convert to a readable string.
Open/None valid values spec, anything that T can take is valid.
virtual ~ValidValuesSpecNone()
Destructor.
ValidValuesSpecNone()
Construct with no specification, any value that T can take goes.
virtual std::string const str() const
Convert to a readable string.
virtual bool checkValueValidity(T const &val) const
Check whether a proposed value is valid, here always returns true.
Range-based valid values spec, bounds are included.
virtual bool checkValueValidity(T const &val) const
Check whether a proposed value is valid, returns true iff value is in our range (bounds included)
ValidValuesSpecRange(Range< T > const &valid_range)
Construct from a Range of valid values (convention: bounds are inclusive)
virtual ~ValidValuesSpecRange()
Destructor.
ValidValuesSpecRange()=delete
No default constructor, always need to provide a range.
Range< T > const itsValidRange
Our range of valid values.
virtual std::string const str() const
Convert to a readable string: Range:[MIN-MAX] where MIN and MAX are replaced by the actual range boun...
Regex-based valid values spec, everything that is a match to the regex is considered valid.
ValidValuesSpecRegex(boost::regex const &valid_regex)
Construct from a given regex that specifies valid values.
ValidValuesSpecRegex()=delete
No default constructor, always need to provide a regex.
boost::regex const itsValidRegex
The regex that defines our valid values.
virtual bool checkValueValidity(T const &val) const
Check whether a proposed value is valid, returns true iff value is a match against our regex.
virtual std::string const str() const
Convert to a readable string.
virtual ~ValidValuesSpecRegex()
Destructor.
StepRange-based valid values spec, bounds are included.
virtual ~ValidValuesSpecStepRange()
Destructor.
ValidValuesSpecStepRange()=delete
No default constructor, always need to provide a range.
virtual bool checkValueValidity(T const &val) const
Check whether a proposed value is valid, returns true iff value is in our range (bounds included)
StepRange< T > const itsValidStepRange
Our step-range of valid values.
ValidValuesSpecStepRange(StepRange< T > const &valid_range)
Construct from a StepRange of valid values (convention: bounds are inclusive)
virtual std::string const str() const
Convert to a readable string: StepRange:[MIN-STEP-MAX] where MIN, STEP and MAX are replaced by actual...
Main namespace for all JeVois classes and functions.