ProgressTracker::Stage Class Reference

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

#include <ProgressTracker.h>

List of all members.

Public Member Functions

 Stage ()
 Stage (const std::string &message, const std::string &component, const std::string &key, int weight=1)
 ~Stage ()
StagegetParent () const
StepgetStep ()
void initialize (Stage *pParent)
void finalize (Message::Result result, const std::string &failureReason="")
void subdivide (std::vector< Stage > &stages)
void toNextSubStage ()
StagegetActiveStage ()
int getPercentComplete (int percent) const
std::string getActiveMessage (std::string message, std::string indent) const


Detailed Description

This is a stage in a progress track.

Definition at line 64 of file ProgressTracker.h.


Constructor & Destructor Documentation

ProgressTracker::Stage::Stage (  ) 

Construct an empty stage.

This is not usually called and exists as an implementation detail of the ProgressTracker

Definition at line 72 of file ProgressTracker.h.

ProgressTracker::Stage::Stage ( const std::string &  message,
const std::string &  component,
const std::string &  key,
int  weight = 1 
)

Construct a stage.

Parameters:
message This is the message associated with this stage.
component The component for the message log Step. See Message.
key The key for the message log Step. See Message.
weight A multiplier specifying how much weight the Stage holds compared to its siblings.

ProgressTracker::Stage::~Stage (  ) 

Destructor.


Member Function Documentation

Stage* ProgressTracker::Stage::getParent (  )  const

Accessor for the parent of this Stage.

Returns:
A pointer to the parent or NULL if this is the root Stage.

Step* ProgressTracker::Stage::getStep (  ) 

Accessor for the MessageLog Step associated with this stage.

Returns:
The Step associated with this Stage.

void ProgressTracker::Stage::initialize ( Stage pParent  ) 

Set this Stage as a child of pParent.

This is called internally by ProgressTracker.

Parameters:
pParent The parent of this Stage

void ProgressTracker::Stage::finalize ( Message::Result  result,
const std::string &  failureReason = "" 
)

Finalize a &Stage.

This is called internalled by ProgressTracker.

Parameters:
result The result of the Stage's execution. See Message.
failureReason The optional reason for failure of the Stage.

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

Subdivide a Stage into a series of sub-stages.

Parameters:
stages The vector of sub-stages.

void ProgressTracker::Stage::toNextSubStage (  ) 

Advance to the next sub-stage.

Stage& ProgressTracker::Stage::getActiveStage (  ) 

Return the active Stage.

Returns:
The active sub-stage or this Stage if there is no active sub-stage.

int ProgressTracker::Stage::getPercentComplete ( int  percent  )  const

Get the percentage complete of this Stage.

Parameters:
percent This will be returned if there are no sub-stages.
Returns:
The percentage complete.

std::string ProgressTracker::Stage::getActiveMessage ( std::string  message,
std::string  indent 
) const

Get the message associated with this Stage and all sub-stages.

Parameters:
message This will be prefixed to the messages of sub-stages.
indent This string is used to indent messages of sub-stages.
Returns:
A composite message calculated from sub-stages.


Software Development Kit - Opticks 4.9.0 Build 16218