PrevUpHomeNext

Concepts

Policy classes
Reporter classes

The architecture is based in policies.

Policy classes

Policies define how a check is performed and calls the reporter for notification when check fails. The reporter class is received by template parameter.

  • CHECK policies receive a template parameter with the wrapped floating point datatype and implement the validations as pair of functions: pre_operator_check and post_operator_check. Each operator calls the pre and post checks defined. Post conditions are those doing the actual validation, pre conditions are used to collect required information for evaluating the post condition and setup of flags if required.

    CHECK policies also receive a template parameter with a reporter class. The static method report is called on the reporter class when a check fails.

Reporter classes

Reporter classes are used for reporting check failures in policies.

<itemizedList> <listitem>

The reporter classes define how the user would to be notified in the case a CHECK fails. A single static method is required from these classes, report_failure on which a exception can be thrown, a message can be output on std::cerr, a unexpected could be returned, an abort can be executed, or any other behavior decided by the user.

</listitem>
</itemizedList>

PrevUpHomeNext