te::common::ConsoleProgressViewer Class Reference

#include <ConsoleProgressViewer.h>

Inheritance diagram for te::common::ConsoleProgressViewer:
te::common::AbstractProgressViewer

Public Member Functions

void addTask (TaskProgress *t, int id)
 Insert a new task in the progress viewer. More...
 
void cancelTask (int taskId)
 Cancel a task. More...
 
 ConsoleProgressViewer ()
 Default constructor. More...
 
void removeTask (int taskId)
 Removes a task from progress viewer container. More...
 
void setTotalValues (int taskId)
 Set task total steps. More...
 
void updateMessage (int taskId)
 Update the progress message. More...
 
void updateValue (int taskId)
 Update the progress evaluation. More...
 
 ~ConsoleProgressViewer ()
 Virtual destructor. More...
 

Protected Attributes

int m_currentStep
 Attribute used to define the current steps of all task. More...
 
std::string m_message
 Attribute used to define the progress message. More...
 
int m_propStep
 Attribute used to define the proportional step (0-100). More...
 
std::map< int, TaskProgress * > m_tasks
 Task container. More...
 
int m_totalSteps
 Attribute used to define the total steps of all tasks. More...
 

Detailed Description

progress viewer implementation for the console.

This viewer is based on iostream. All the feedback will be generated over a console window. Multiples tasks will be displayed using a single report.

The proportional value is calculated using TOTAL_STEPS / CURRENT_STEPS. Where:

  • TOTAL_STEPS: Sum of all total steps of all tasks
  • CURRENTSTEPS: Sum of all current steps of all tasks

The progress message is defined by the task message, if it has more than one task the message will be set to: "MULTI TASKS".

See also
AbstractProgressViewer, TaskProgress

Definition at line 64 of file ConsoleProgressViewer.h.

Constructor & Destructor Documentation

te::common::ConsoleProgressViewer::ConsoleProgressViewer ( )

Default constructor.

te::common::ConsoleProgressViewer::~ConsoleProgressViewer ( )

Virtual destructor.

Member Function Documentation

void te::common::ConsoleProgressViewer::addTask ( TaskProgress t,
int  id 
)
virtual

Insert a new task in the progress viewer.

Parameters
tTask pointer.
idTask identifier.
Note
The Progress Viewer will NOT take the ownership of TaskProgress (t).

Implements te::common::AbstractProgressViewer.

void te::common::ConsoleProgressViewer::cancelTask ( int  taskId)
virtual

Cancel a task.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

void te::common::ConsoleProgressViewer::removeTask ( int  taskId)
virtual

Removes a task from progress viewer container.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

void te::common::ConsoleProgressViewer::setTotalValues ( int  taskId)
virtual

Set task total steps.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

void te::common::ConsoleProgressViewer::updateMessage ( int  taskId)
virtual

Update the progress message.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

void te::common::ConsoleProgressViewer::updateValue ( int  taskId)
virtual

Update the progress evaluation.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Member Data Documentation

int te::common::ConsoleProgressViewer::m_currentStep
protected

Attribute used to define the current steps of all task.

Definition at line 89 of file ConsoleProgressViewer.h.

std::string te::common::ConsoleProgressViewer::m_message
protected

Attribute used to define the progress message.

Definition at line 91 of file ConsoleProgressViewer.h.

int te::common::ConsoleProgressViewer::m_propStep
protected

Attribute used to define the proportional step (0-100).

Definition at line 90 of file ConsoleProgressViewer.h.

std::map<int, TaskProgress*> te::common::ConsoleProgressViewer::m_tasks
protected

Task container.

Definition at line 92 of file ConsoleProgressViewer.h.

int te::common::ConsoleProgressViewer::m_totalSteps
protected

Attribute used to define the total steps of all tasks.

Definition at line 88 of file ConsoleProgressViewer.h.


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