Basic Image AlgorithmS Library
2.8.0
|
this class represents a progress counter which multiple processes can use. More...
#include <Base/Common/ProgressSemaphore.hh>
Public Member Functions | |
float | GetProgress () |
returns current progress state in standard intervall More... | |
void | IncrementStep () |
Increment the current step. More... | |
bool | IsTerminationRequested () |
Tells whether the termination flag is set. More... | |
ProgressSemaphore () | |
void | Reset () |
Resets all values. More... | |
void | ResetTerminateFlag () |
Chancels the termination flag. More... | |
void | SetCurrentStep (unsigned int CurrentStep) |
Set the current step. More... | |
void | SetNumSteps (unsigned int steps) |
Set the number of steps to progress will need to complete. More... | |
void | SetTerminateFlag () |
Sets a termination flag to inform e.g. More... | |
~ProgressSemaphore () | |
destructor More... | |
Protected Attributes | |
unsigned int | CurrentStep_ |
pthread_mutex_t | Lock_ |
unsigned int | NumSteps_ |
bool | Terminate_ |
this class represents a progress counter which multiple processes can use.
It is implemented using locked access to the progress variables using pthread mutexes An example is that one thread starts a progress and has to wait till this progress is done and wants to display a progress bar. In the meanwhile the working progress can update the progress values in the ProgressSemaphore to inform the waiting progress about its progress.
Definition at line 45 of file ProgressSemaphore.hh.
ProgressSemaphore::ProgressSemaphore | ( | ) |
Definition at line 31 of file ProgressSemaphore.cpp.
ProgressSemaphore::~ProgressSemaphore | ( | ) |
destructor
Definition at line 40 of file ProgressSemaphore.cpp.
float ProgressSemaphore::GetProgress | ( | ) |
returns current progress state in standard intervall
Definition at line 44 of file ProgressSemaphore.cpp.
References CurrentStep_, Lock_, and NumSteps_.
void ProgressSemaphore::IncrementStep | ( | ) |
Increment the current step.
Definition at line 86 of file ProgressSemaphore.cpp.
References CurrentStep_, Lock_, and NumSteps_.
bool ProgressSemaphore::IsTerminationRequested | ( | ) |
Tells whether the termination flag is set.
Definition at line 121 of file ProgressSemaphore.cpp.
References Lock_, and Terminate_.
void ProgressSemaphore::Reset | ( | ) |
Resets all values.
Definition at line 134 of file ProgressSemaphore.cpp.
References CurrentStep_, Lock_, NumSteps_, and Terminate_.
Referenced by ProgressSemaphore().
void ProgressSemaphore::ResetTerminateFlag | ( | ) |
Chancels the termination flag.
Definition at line 110 of file ProgressSemaphore.cpp.
References Lock_, and Terminate_.
void ProgressSemaphore::SetCurrentStep | ( | unsigned int | CurrentStep | ) |
Set the current step.
Definition at line 74 of file ProgressSemaphore.cpp.
References CurrentStep_, Lock_, and NumSteps_.
void ProgressSemaphore::SetNumSteps | ( | unsigned int | steps | ) |
Set the number of steps to progress will need to complete.
Definition at line 62 of file ProgressSemaphore.cpp.
void ProgressSemaphore::SetTerminateFlag | ( | ) |
Sets a termination flag to inform e.g.
another process that an abort is requested
Definition at line 99 of file ProgressSemaphore.cpp.
References Lock_, and Terminate_.
|
protected |
Definition at line 74 of file ProgressSemaphore.hh.
Referenced by GetProgress(), IncrementStep(), Reset(), and SetCurrentStep().
|
protected |
Definition at line 71 of file ProgressSemaphore.hh.
Referenced by GetProgress(), IncrementStep(), IsTerminationRequested(), ProgressSemaphore(), Reset(), ResetTerminateFlag(), SetCurrentStep(), SetNumSteps(), and SetTerminateFlag().
|
protected |
Definition at line 73 of file ProgressSemaphore.hh.
Referenced by GetProgress(), IncrementStep(), Reset(), SetCurrentStep(), and SetNumSteps().
|
protected |
Definition at line 75 of file ProgressSemaphore.hh.
Referenced by IsTerminationRequested(), Reset(), ResetTerminateFlag(), and SetTerminateFlag().