ProgressTracker Class Reference

Automatically track progress basic on predefined steps. More...

#include <ProgressTracker.h>

List of all members.

Public Member Functions

 ProgressTracker ()
 ProgressTracker (Progress *pProgress, const std::string &message, const std::string &component, const std::string &key)
void initialize (Progress *pProgress, const std::string &message, const std::string &component, const std::string &key)
void initialize (const std::string &message, const std::string &component, const std::string &key)
void subdivideCurrentStage (std::vector< Stage > &stages)
void upALevel ()
void nextStage ()
void report (const std::string &text, int percent, ReportingLevel gran, bool log=false)
bool getStatus (std::string &text, int &percent, ReportingLevel &level)
ProgressgetCurrentProgress () const
void abort ()
StepgetCurrentStep ()

Classes

class  Stage
 This is a stage in a progress track. More...


Detailed Description

Automatically track progress basic on predefined steps.

Note:
There are short term plans to replace ProgressTracker with a similar system that functions more like StepResource. Keep watching the release notes and the developer's mailing list for announcements.

Definition at line 58 of file ProgressTracker.h.


Constructor & Destructor Documentation

ProgressTracker::ProgressTracker (  ) 

Construct an empty progress tracker.

Definition at line 190 of file ProgressTracker.h.

ProgressTracker::ProgressTracker ( Progress pProgress,
const std::string &  message,
const std::string &  component,
const std::string &  key 
)

Construct a progress tracker with a Progress object and Step message.

This convenience constructor is equivalent to constructing an empty progress tracker then calling initialize().

Parameters:
pProgress The Progress object associated with this tracker.
message The message of the root Stage.
component The component associated with the root message log Step.
key The key associated with the root message log Step.

Definition at line 209 of file ProgressTracker.h.


Member Function Documentation

void ProgressTracker::initialize ( Progress pProgress,
const std::string &  message,
const std::string &  component,
const std::string &  key 
)

Initialize a tracker.

Parameters:
pProgress The Progress object associated with this tracker.
message The message of the root Stage.
component The component associated with the root message log Step.
key The key associated with the root message log Step.

void ProgressTracker::initialize ( const std::string &  message,
const std::string &  component,
const std::string &  key 
)

Initialize a tracker using the existing Progress object.

Parameters:
message The message of the root Stage.
component The component associated with the root message log Step.
key The key associated with the root message log Step.

Definition at line 245 of file ProgressTracker.h.

void ProgressTracker::subdivideCurrentStage ( std::vector< Stage > &  stages  ) 

Subdivide the current &Stage into sub-stages.

Parameters:
stages The sub-stage vector.

void ProgressTracker::upALevel (  ) 

Finalize the current sub-stage and set the current stage to its parent.

void ProgressTracker::nextStage (  ) 

Advance to the next sub-stage.

void ProgressTracker::report ( const std::string &  text,
int  percent,
ReportingLevel  gran,
bool  log = false 
)

Report progress within a Stage.

Parameters:
text The text to send to the message log and Progress object.
percent The new percentage complete for the current Stage.
gran The ReportingLevel associated with this report.
log Should the message be sent to the message log as well as the Progress object?

bool ProgressTracker::getStatus ( std::string &  text,
int &  percent,
ReportingLevel level 
)

Get the current status as reported by the Progess object.

Parameters:
text Output argument which will hold the current Progress object text.
percent Output argument which will hold the current Progress object percent complete.
level Output argument which will hold the current state of the Progress object.
Returns:
True if successfull, false if there is no Progress object.

Definition at line 299 of file ProgressTracker.h.

Progress* ProgressTracker::getCurrentProgress (  )  const

Get the Progress object associated with the current step.

Returns:
Pointer to the current Progress or NULL if there is no current Progress.

Definition at line 319 of file ProgressTracker.h.

void ProgressTracker::abort (  ) 

Abort the process tracked by this ProgressTracker.

Step* ProgressTracker::getCurrentStep (  ) 

Accessor for the message log Step associated with the current Stage.

Returns:
The Step associated with the current Stage.


Software Development Kit - Opticks 4.9.0 Build 16218