JayBeams
0.1
Another project to have fun coding.
|
Define a functor to validate character fields with limited values. More...
#include <char_list_validator.hpp>
Public Member Functions | |
void | operator() (int x) const |
Define a functor to validate character fields with limited values.
Many ITCH-5.0 fields are single character wide (on the wire) and are only supposed to take a limited set of values. We want a functor to validate these fields against their list of values, but also to disable the validation if not needed.
Typically this validators would be used as: typedef char_list_validator<true,u'A',u'B',u'C'> validator; or typedef char_list_validator<false,u'A',u'B',u'C'> validator;
The first template parameter defines if the validator actually performs any checking at all, in production one probably wants its value to be 'false'. The remaining template parameters define the list of possible values to be accepted.
Definition at line 26 of file char_list_validator.hpp.
|
inline |
Definition at line 27 of file char_list_validator.hpp.
References jb::itch5::char_list_validation_failed().