MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Classes | Public Types | Public Member Functions
mds::mod::CProgress Class Reference

Base class for all other classes able to inform calling processes about progress of a running operation. More...

#include <mdsProgress.h>

Inheritance diagram for mds::mod::CProgress:
Inheritance graph
[legend]

List of all members.

Classes

struct  CProgressInitializer
 Helper class used to call methods beginProgress() and endProgress() automatically. More...

Public Types

typedef mds::base::CFunctor
< bool, int, int
tProgressFunc
 Progress observer (= functor).
typedef CProgressInitializer tProgressInitializer
 Helper class which can be used to call methods beginProgress() and endProgress() automatically.

Public Member Functions

void beginProgress ()
 This function must be called by the class realizing an operation before it starts.
 CProgress ()
 Constructor.
 CProgress (const CProgress &p)
 Copy constructor.
void deregisterProgressFunc ()
 Sets the default empty observer.
void endProgress ()
 The function must be called by the class realizing an operation every time the operation finishes.
int getProgressCount () const
 Returns current value of the internal progress value.
int getProgressMax () const
 Returns the maximum allowed value of the internal progress counter.
bool progress (int iIncrement=1)
 Calls the registered observer.
void registerProgressFunc (const tProgressFunc &Func)
 Sets observer/functor called to inform a calling process about the current state of the running operation.
void setProgressMax (int iValue)
 Sets the maximal counter value.
 ~CProgress ()
 Destructor.

Detailed Description

Base class for all other classes able to inform calling processes about progress of a running operation.


Member Typedef Documentation

Progress observer (= functor).

  • You may return false from the observer if you want to terminate the running operation.
  • Parameters describe current and final state of the pending operation (counter and maximal value).
  • If the second parameter is equal to -1, termination time cannot be determined, the current state is unknown.

Helper class which can be used to call methods beginProgress() and endProgress() automatically.

Create static object of this type at the begining of a method that realizes an operation.


Constructor & Destructor Documentation

Constructor.

Copy constructor.

Destructor.


Member Function Documentation

This function must be called by the class realizing an operation before it starts.

Sets the default empty observer.

The function must be called by the class realizing an operation every time the operation finishes.

  • Sets the default observer.

Returns current value of the internal progress value.

Returns the maximum allowed value of the internal progress counter.

bool mds::mod::CProgress::progress ( int  iIncrement = 1)

Calls the registered observer.

  • Returns false if the running operation should be terminated as soon as possible.
  • It must be called periodically by the class realizing the operation.

Sets observer/functor called to inform a calling process about the current state of the running operation.

  • This function should be called before any operation starts.

Sets the maximal counter value.


The documentation for this class was generated from the following file: