Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Static Private Attributes

cmtk::Progress Class Reference
[cmtkSystem Library]

Generic class for progress indication. More...

#include <cmtkProgress.h>

Inheritance diagram for cmtk::Progress:
Inheritance graph
[legend]
Collaboration diagram for cmtk::Progress:
Collaboration graph
[legend]

List of all members.

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::RangeRangeStackType
 Type for stack of nested progress ranges.

Private Attributes

RangeStackType m_RangeStack
 Stack of nested progress ranges.

Static Private Attributes

static SelfProgressInstance = 0
 Instance of a derived class that handles GUI interaction etc.

Detailed Description

Generic class for progress indication.

Definition at line 50 of file cmtkProgress.h.


Member Typedef Documentation

typedef std::deque<Self::Range> cmtk::Progress::RangeStackType [private]

Type for stack of nested progress ranges.

Definition at line 155 of file cmtkProgress.h.

This class.

Reimplemented in cmtk::QtProgress, and cmtk::ProgressConsole.

Definition at line 66 of file cmtkProgress.h.


Member Enumeration Documentation

Status code returned by SetPercentDone() method.

Enumerator:
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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


Member Data Documentation

Stack of nested progress ranges.

Definition at line 158 of file cmtkProgress.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines