Generic class for progress indication. More...
#include <cmtkProgress.h>
Classes | |
class | Range |
Class to current progress range, which can be nested. More... | |
Public Types | |
enum | ResultEnum { OK, INTERRUPT, TIMEOUT, FAILED } |
Status code returned by SetPercentDone() method. More... | |
typedef Progress | Self |
This class. | |
Public Member Functions | |
Progress () | |
Constructor. | |
virtual | ~Progress () |
Virtual (dummy) destructor. | |
virtual ResultEnum | UpdateProgress ()=0 |
Set number of tasks completed. | |
void | SetProgressCurrent (const double progress) |
Set number of tasks completed. | |
Static Public Member Functions | |
static void | Begin (const double start, const double end, const double increment, const std::string &taskName=std::string("")) |
Set total number of steps to complete. | |
static ResultEnum | SetProgress (const double progress) |
Set number of tasks completed. | |
static void | Done () |
Done with progress indicator. | |
static void | SetProgressInstance (Self *const progressInstance) |
Set progress handler instance. | |
Protected Member Functions | |
bool | IsTopLevel () const |
Check if we're at the top level of the task hierarchy. | |
const std::string | GetCurrentTaskName () const |
Return the name of the current task (at the lowest level of nested ranges). | |
double | GetFractionComplete () const |
Compute current completion fraction from range stack. | |
virtual void | BeginVirtual (const double start, const double end, const double increment, const std::string &taskName=std::string("")) |
Set total number of steps to complete. | |
virtual void | DoneVirtual () |
Clean up progress output. | |
Private Types | |
typedef std::deque< Self::Range > | RangeStackType |
Type for stack of nested progress ranges. | |
Private Attributes | |
RangeStackType | m_RangeStack |
Stack of nested progress ranges. | |
Static Private Attributes | |
static Self * | ProgressInstance = 0 |
Instance of a derived class that handles GUI interaction etc. |
Generic class for progress indication.
Definition at line 50 of file cmtkProgress.h.
typedef std::deque<Self::Range> cmtk::Progress::RangeStackType [private] |
Type for stack of nested progress ranges.
Definition at line 155 of file cmtkProgress.h.
typedef Progress cmtk::Progress::Self |
This class.
Reimplemented in cmtk::QtProgress, and cmtk::ProgressConsole.
Definition at line 66 of file cmtkProgress.h.
Status code returned by SetPercentDone() method.
OK |
Everything okay; continue as usual. |
INTERRUPT |
User requests interrupt of operation. |
TIMEOUT |
Interrupt generated by timeout. |
FAILED |
Something went wrong. |
Definition at line 54 of file cmtkProgress.h.
cmtk::Progress::Progress | ( | ) | [inline] |
Constructor.
Definition at line 69 of file cmtkProgress.h.
virtual cmtk::Progress::~Progress | ( | ) | [inline, virtual] |
Virtual (dummy) destructor.
Definition at line 75 of file cmtkProgress.h.
bool cmtk::Progress::IsTopLevel | ( | ) | const [inline, protected] |
Check if we're at the top level of the task hierarchy.
Definition at line 100 of file cmtkProgress.h.
static void cmtk::Progress::SetProgressInstance | ( | Self *const | progressInstance ) | [inline, static] |
Set progress handler instance.
Definition at line 93 of file cmtkProgress.h.
virtual ResultEnum cmtk::Progress::UpdateProgress | ( | ) | [pure virtual] |
Set number of tasks completed.
Implemented in cmtk::QtProgress, and cmtk::ProgressConsole.
RangeStackType cmtk::Progress::m_RangeStack [private] |
Stack of nested progress ranges.
Definition at line 158 of file cmtkProgress.h.