Loading...
Searching...
No Matches
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.
 
void cancelTask (int taskId)
 Cancel a task.
 
 ConsoleProgressViewer ()
 Default constructor.
 
void removeTask (int taskId)
 Removes a task from progress viewer container.
 
void setTotalValues (int taskId)
 Set task total steps.
 
void updateMessage (int taskId)
 Update the progress message.
 
void updateValue (int taskId)
 Update the progress evaluation.
 
 ~ConsoleProgressViewer ()
 Virtual destructor.
 

Protected Attributes

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

Detailed Description

\briefA 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

◆ ConsoleProgressViewer()

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

Default constructor.

◆ ~ConsoleProgressViewer()

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

Virtual destructor.

Member Function Documentation

◆ addTask()

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.

◆ cancelTask()

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

Cancel a task.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

◆ removeTask()

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

Removes a task from progress viewer container.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

◆ setTotalValues()

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

Set task total steps.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

◆ updateMessage()

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

Update the progress message.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

◆ updateValue()

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

Update the progress evaluation.

Parameters
taskIdTask identifier.

Implements te::common::AbstractProgressViewer.

Member Data Documentation

◆ m_currentStep

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.

◆ m_message

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

Attribute used to define the progress message.

Definition at line 91 of file ConsoleProgressViewer.h.

◆ m_propStep

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

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

Definition at line 90 of file ConsoleProgressViewer.h.

◆ m_tasks

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

Task container.

Definition at line 92 of file ConsoleProgressViewer.h.

◆ m_totalSteps

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.

◆ m_viewerId

int te::common::AbstractProgressViewer::m_viewerId
protectedinherited

Definition at line 105 of file AbstractProgressViewer.h.


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