Namespace eat::process::validation
Contents
Detailed Description
This implements validation for ADM documents.
To use this as a process, see eat::process::make_validate().
To use it directly, see make_profile_validator() and
make_emission_profile_validator() to make a validator,
ProfileValidator::run() to run it, and any_messages() and
format_results() to interpret the results.
In general, validation checks are implemented as a struct whose members configure the check, and which has a run function which performs the check
Run yields a vector of message objects, and the type of these corresponds
with the type of the check. For example, the NumElements check
results in NumElementsMessage messages.
These are combined together with variants, so a Check is one of any
known checks, and a Message is one of any known message.
Both checks and message types have additional functions to enable meta-programming:
A static name method gives the name of the check or message (the same as the class name)
A visit function accepts a callback and calls it once for each member with the name of the member and a reference to the member.
These can be used to serialise and de-serialise checks and messages to JSON, for example.