#include <maxRecorder.h>
Public Member Functions | |
MaxRecorder () | |
Default constructor initializes max to a very small number (either std::numeric_limits<Type>::min(), -stdnumeric_limits<Type>::max(), depending on the signedness of Type), and sets the payload to it's default value. | |
MaxRecorder (Type const &maxValue, Payload const &payload) | |
This constructor allows the user to explicitly set the starting maxValue, and the default payload. | |
bool | test (const Type &value, const Payload &payload) |
This member function compares its first argument with the saved maximum value, and updates the saved maximum (and payload) if the argument is larger. | |
const Type & | getMax () |
This member function returns the saved maximum. | |
const Payload & | getPayload () |
This member function returns the saved "payload". | |
void | reset () |
This member function resets the saved maximum just as if *this were freshly constructed with the default constructor. |
WARNING: This interface may change slightly in subsequent releases.
Definition at line 30 of file maxRecorder.h.
dlr::numeric::MaxRecorder< Type, Payload >::MaxRecorder | ( | ) | [inline] |
Default constructor initializes max to a very small number (either std::numeric_limits<Type>::min(), -stdnumeric_limits<Type>::max(), depending on the signedness of Type), and sets the payload to it's default value.
Definition at line 40 of file maxRecorder.h.
References dlr::numeric::MaxRecorder< Type, Payload >::reset().
dlr::numeric::MaxRecorder< Type, Payload >::MaxRecorder | ( | Type const & | maxValue, | |
Payload const & | payload | |||
) | [inline] |
This constructor allows the user to explicitly set the starting maxValue, and the default payload.
Definition at line 47 of file maxRecorder.h.
const Type& dlr::numeric::MaxRecorder< Type, Payload >::getMax | ( | ) | [inline] |
This member function returns the saved maximum.
Definition at line 85 of file maxRecorder.h.
const Payload& dlr::numeric::MaxRecorder< Type, Payload >::getPayload | ( | ) | [inline] |
This member function returns the saved "payload".
Definition at line 97 of file maxRecorder.h.
void dlr::numeric::MaxRecorder< Type, Payload >::reset | ( | ) | [inline] |
This member function resets the saved maximum just as if *this were freshly constructed with the default constructor.
Definition at line 105 of file maxRecorder.h.
Referenced by dlr::numeric::MaxRecorder< Type, Payload >::MaxRecorder().
bool dlr::numeric::MaxRecorder< Type, Payload >::test | ( | const Type & | value, | |
const Payload & | payload | |||
) | [inline] |
This member function compares its first argument with the saved maximum value, and updates the saved maximum (and payload) if the argument is larger.
value | This argument will be compared to the saved maximum, and copied into the saved maximum if doing so will increase the saved maximum. | |
payload | This argument is copied into the saved payload if and only if the saved maximum was updated. |
Definition at line 67 of file maxRecorder.h.