eLynx SDK
v3.0.1 C++ image processing API reference |
#include <ProgressNotifier.h>
Public Member Functions | |
ProgressNotifier (uint32 iPhases=1, float iSensitivity=0.01f) | |
virtual | ~ProgressNotifier () |
Virtual destructor. | |
uint32 | GetPhaseCount () const |
float | GetSensitivity () const |
void | SetSensitivity (float iSensitivity) |
float | GetCurrentProgress () const |
uint32 | GetCurrentPhase () const |
void | SetProgress (float iProgress, uint32 iPhase=0) |
void | Log (const char *iprString, uint32 iPhase=0) |
void | PushCurrentPhase (bool iIncrement) |
void | PopCurrentPhase () |
Removes the phase offset from the stack and increments current phase. | |
void | RequestCancel () |
bool | IsCanceled () const |
Returns true if caller requested operation to cancel itself. | |
Protected Member Functions | |
virtual void | Notify (float iProgress, uint32 iPhase) |
virtual void | Notify (const char *iprString, uint32 iPhase) |
Definition at line 52 of file ProgressNotifier.h.
eLynx::ProgressNotifier::ProgressNotifier | ( | uint32 | iPhases = 1 , |
|
float | iSensitivity = 0.01f | |||
) |
Constructor, creates progress notifier with given number of phases and sensitivity.
iPhases | the number of operation progress phases. | |
iSensitivity | the sensitivity of progress notification. |
virtual eLynx::ProgressNotifier::~ProgressNotifier | ( | ) | [virtual] |
Virtual destructor.
uint32 eLynx::ProgressNotifier::GetPhaseCount | ( | ) | const |
Returns the number of phases. This value is the same as specified in constructor. It is not affected by phase offset stack.
float eLynx::ProgressNotifier::GetSensitivity | ( | ) | const |
Returns progress sensitivity. If the difference between actual and new progress is bigger than this value, NotifyProgress would be invoked.
void eLynx::ProgressNotifier::SetSensitivity | ( | float | iSensitivity | ) |
Sets progress sensitivity. If the difference between actual and new progress is bigger than this value, NotifyProgress would be invoked.
float eLynx::ProgressNotifier::GetCurrentProgress | ( | ) | const |
Returns the progress of current phase as number in interval <0, 1>.
uint32 eLynx::ProgressNotifier::GetCurrentPhase | ( | ) | const |
Returns the number of current phase (zero-based). It is a number between 0 and GetPhaseCount()-1. Current phase offset (if any) is already included in this value.
void eLynx::ProgressNotifier::SetProgress | ( | float | iProgress, | |
uint32 | iPhase = 0 | |||
) |
Sets the current phase and progress. The number of the phase is taken relative to the current phase offset (offset is added to the iPhase value). If the difference between actual and new progress is bigger than sensitivity, NotifyProgress is invoked.
void eLynx::ProgressNotifier::Log | ( | const char * | iprString, | |
uint32 | iPhase = 0 | |||
) |
void eLynx::ProgressNotifier::PushCurrentPhase | ( | bool | iIncrement | ) |
Pushes current phase into the stack to became new phase offset and (if required) increments it. Subsequent calls to SetProgress will increment phase number with this offset. Should be called before ProgressNotifier is passed to another operation, which also accepts ProgressNotifier. After that, PopCurrentPhase should be called to switch to next phase.
iIncrement | if true, current phase number is incremented before pushed into the stack. Should be false if subsequent operation is first operation at all. Otherwise, if true, it saves caller from necessity to update progress phase before passing notifier to subsequent call. |
void eLynx::ProgressNotifier::PopCurrentPhase | ( | ) |
Removes the phase offset from the stack and increments current phase.
void eLynx::ProgressNotifier::RequestCancel | ( | ) |
Request operation cancel. After calling this method, IsCanceled will start returning true. It is operation responsibility to check this method and return ASAP, if cancel is requested.
bool eLynx::ProgressNotifier::IsCanceled | ( | ) | const [inline] |
Returns true if caller requested operation to cancel itself.
Definition at line 118 of file ProgressNotifier.h.
virtual void eLynx::ProgressNotifier::Notify | ( | float | iProgress, | |
uint32 | iPhase | |||
) | [protected, virtual] |
that is called by SetProgress method. This method should be redefined to perform appropriate actions (like updating progress bar control or writing info to the console).
iProgress | the progress of current phase in interval <0, 1> | |
iPhase | the number fo current phase |
virtual void eLynx::ProgressNotifier::Notify | ( | const char * | iprString, | |
uint32 | iPhase | |||
) | [protected, virtual] |