Checker< ConverterType, InputType > Class Template Reference

Primary key checker template class. More...

#include <keyvalue/key/Checker.h>


Detailed Description

template<typename ConverterType, typename InputType = typename ConverterType::InputType_>
class keyvalue::key::Checker< ConverterType, InputType >

Primary key checker template class.

As said in Traits documentation, in some circumstances, a value associated to a key must pass some sanity check. This test is one step of the value processing as explained in Record::getProcessedValue() and is done through this template class.

It is easy to see that a specialization for each input type is needed. Indeed, a value::Vector, for instance, may be rejected or validated according to its dimension. On the other hand, checking dimensionality for a value::Single is meaningless. This template class takes the type parameter ConverterType from which it can recover the input type.

Checks are done by specializations methods. Real keys are derived from Traits which, in turn, derives from instantiations of this template class. Therefore, one can set up the checks to be performed by overhiding Check's methods. Bear in mind that, default implementations validate all values.

Parameters:
ConverterType : (template parameter) Defines the container converter.
InputType : Converter's input type. Provided default value must not be changed.