famouso::mw::afp::shared::OverflowErrorChecking Class Reference
Policy: Overflow error checking. More...
#include <OverflowErrorChecking.h>
Public Member Functions | |
OverflowErrorChecking () | |
Constructor. | |
bool | error () |
Return whether an error occured. | |
template<class T1 , class T2 > | |
void | check_smaller (T1 v1, T2 v2) |
Check if v1 < v2. Else there is an error. | |
template<class T1 , class T2 > | |
void | check_smaller_or_equal (T1 v1, T2 v2) |
Check if v1 <= v2. Else there is an error. | |
template<class T1 , class T2 > | |
void | check_equal (T1 v1, T2 v2) |
Check if v1 == v2. Else there is an error. | |
void | set_error () |
Make error() returning true. | |
void | reset () |
Make error() returning false. |
Detailed Description
Policy: Overflow error checking.
Use this policy in AFP config to include overflow error checking code into AFP implementation. This is useful to detect overflows, underflows and other effects that may occur when AFP is configured to use too small integer types.
Alternatives: NoOverflowErrorChecking
Constructor & Destructor Documentation
famouso::mw::afp::shared::OverflowErrorChecking::OverflowErrorChecking | ( | ) | [inline] |
Constructor.
Member Function Documentation
template<class T1 , class T2 >
void famouso::mw::afp::shared::OverflowErrorChecking::check_equal | ( | T1 | v1, | |
T2 | v2 | |||
) | [inline] |
Check if v1 == v2. Else there is an error.
template<class T1 , class T2 >
void famouso::mw::afp::shared::OverflowErrorChecking::check_smaller | ( | T1 | v1, | |
T2 | v2 | |||
) | [inline] |
Check if v1 < v2. Else there is an error.
template<class T1 , class T2 >
void famouso::mw::afp::shared::OverflowErrorChecking::check_smaller_or_equal | ( | T1 | v1, | |
T2 | v2 | |||
) | [inline] |
Check if v1 <= v2. Else there is an error.
bool famouso::mw::afp::shared::OverflowErrorChecking::error | ( | ) | [inline] |
Return whether an error occured.
void famouso::mw::afp::shared::OverflowErrorChecking::reset | ( | ) | [inline] |
Make error() returning false.
void famouso::mw::afp::shared::OverflowErrorChecking::set_error | ( | ) | [inline] |
Make error() returning true.
The documentation for this class was generated from the following file:
- include/mw/afp/shared/OverflowErrorChecking.h