JayBeams  0.1
Another project to have fun coding.
Public Member Functions | List of all members
jb::itch5::char_list_validator< validate, V > Struct Template Reference

Define a functor to validate character fields with limited values. More...

#include <char_list_validator.hpp>

Public Member Functions

void operator() (int x) const
 

Detailed Description

template<bool validate, int... V>
struct jb::itch5::char_list_validator< validate, V >

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.

Member Function Documentation

◆ operator()()

template<bool validate, int... V>
void jb::itch5::char_list_validator< validate, V >::operator() ( int  x) const
inline

Definition at line 27 of file char_list_validator.hpp.

References jb::itch5::char_list_validation_failed().


The documentation for this struct was generated from the following file: