iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::ValidValuesSpecBase< T > Class Template Referenceabstract

#include <nrt/Core/Typing/ValidValuesSpec.H>

template<class T>
class nrt::ValidValuesSpecBase< T >

Base class for specifying a set of valid values for a type.

Note when defining new derived valid values specs: make sure you define operator<<() and also that the copy constructor works as intended (which means that you may have to define it explicitly if your data members are complicated).

Definition at line 60 of file ValidValuesSpec.H.

Inheritance diagram for nrt::ValidValuesSpecBase< T >:
nrt::ValidValuesSpecList< T > nrt::ValidValuesSpecNone< T > nrt::ValidValuesSpecRange< T > nrt::ValidValuesSpecRegex< T >

Public Member Functions

 ValidValuesSpecBase ()
 Construct, for the base class this is a no-op. More...
 
virtual ~ValidValuesSpecBase ()
 Destructor.
 
virtual bool checkValueValidity (T const &val) const =0
 Check whether a proposed value is valid, here always returns true.
 
virtual std::string const str () const =0
 Convert to a readable string. More...
 

Constructor & Destructor Documentation

template<class T >
nrt::ValidValuesSpecBase< T >::ValidValuesSpecBase ( )
inlineexplicit

Construct, for the base class this is a no-op.

Note that we make the constructor explicit otherwise we get false hits against strings and what not in our operator<< defined on various ValidValueSpec derivatives.

Definition at line 46 of file ValidValuesSpecImpl.H.

Member Function Documentation

template<class T >
virtual std::string const nrt::ValidValuesSpecBase< T >::str ( ) const
pure virtual

Convert to a readable string.

Caution, the GUI may wish to parse this string so keep the format tight. Typically, type:[valuesdescription], e.g., see derived classes for None:[], List:[A|B|C], etc.

Implemented in nrt::ValidValuesSpecRegex< T >, nrt::ValidValuesSpecRange< T >, nrt::ValidValuesSpecList< T >, and nrt::ValidValuesSpecNone< T >.


The documentation for this class was generated from the following files: