All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::common::ProgressTimer Class Reference

The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a task. More...

#include <ProgressTimer.h>

Public Member Functions

std::string getMessage ()
 Get the information about the evolution of the process. More...
 
double getRemainingTimeInMin () const
 Function used to get the remaining time to end the process. More...
 
double getSpeedTimeInSec () const
 Function used to get the speed time. More...
 
 ProgressTimer (int totalSteps, std::string message)
 It initializes a ProgressTimer. More...
 
void setMessage (std::string message)
 Set the message used by task progress. More...
 
void setTotalSteps (int totalSteps)
 Set the total steps. More...
 
void start ()
 Start the internal timer. More...
 
void tick ()
 Define a new step process evolution. More...
 
 ~ProgressTimer ()
 Destructor. More...
 

Private Attributes

int m_count
 Internal counter. More...
 
std::string m_message
 Original task message. More...
 
double m_remainingTime
 Remaining time in minutes. More...
 
double m_speedTime
 Speed time in seconds. More...
 
time_t m_startTime
 Initial time. More...
 
int m_totalSteps
 Total steps. More...
 

Detailed Description

The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a task.

See also
TaskProgress

Definition at line 47 of file ProgressTimer.h.

Constructor & Destructor Documentation

te::common::ProgressTimer::ProgressTimer ( int  totalSteps,
std::string  message 
)

It initializes a ProgressTimer.

Definition at line 31 of file ProgressTimer.cpp.

te::common::ProgressTimer::~ProgressTimer ( )

Destructor.

Definition at line 41 of file ProgressTimer.cpp.

Member Function Documentation

std::string te::common::ProgressTimer::getMessage ( )

Get the information about the evolution of the process.

Returns
String with the information about remaining and speed time.

Definition at line 94 of file ProgressTimer.cpp.

References te::common::Convert2String(), and TE_TR.

double te::common::ProgressTimer::getRemainingTimeInMin ( ) const

Function used to get the remaining time to end the process.

Returns
Dobule value, the remaingin time in minutes.

Definition at line 84 of file ProgressTimer.cpp.

double te::common::ProgressTimer::getSpeedTimeInSec ( ) const

Function used to get the speed time.

Returns
Double value, the spped time in seconds.

Definition at line 89 of file ProgressTimer.cpp.

void te::common::ProgressTimer::setMessage ( std::string  message)

Set the message used by task progress.

Definition at line 79 of file ProgressTimer.cpp.

void te::common::ProgressTimer::setTotalSteps ( int  totalSteps)

Set the total steps.

Definition at line 74 of file ProgressTimer.cpp.

void te::common::ProgressTimer::start ( )

Start the internal timer.

Definition at line 45 of file ProgressTimer.cpp.

void te::common::ProgressTimer::tick ( )

Define a new step process evolution.

Note
For each tick, new values for remaining time and speed time are computed.

Definition at line 53 of file ProgressTimer.cpp.

Member Data Documentation

int te::common::ProgressTimer::m_count
private

Internal counter.

Definition at line 98 of file ProgressTimer.h.

std::string te::common::ProgressTimer::m_message
private

Original task message.

Definition at line 102 of file ProgressTimer.h.

double te::common::ProgressTimer::m_remainingTime
private

Remaining time in minutes.

Definition at line 100 of file ProgressTimer.h.

double te::common::ProgressTimer::m_speedTime
private

Speed time in seconds.

Definition at line 101 of file ProgressTimer.h.

time_t te::common::ProgressTimer::m_startTime
private

Initial time.

Definition at line 99 of file ProgressTimer.h.

int te::common::ProgressTimer::m_totalSteps
private

Total steps.

Definition at line 97 of file ProgressTimer.h.


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