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... | |
The ProgressTimer is a utility class that can be used to calculate the estimated time to finish a task.
Definition at line 47 of file ProgressTimer.h.
| te::common::ProgressTimer::ProgressTimer | ( | int | totalSteps, |
| std::string | message | ||
| ) |
It initializes a ProgressTimer.
Definition at line 31 of file ProgressTimer.cpp.
References ~ProgressTimer().
|
default |
Destructor.
Referenced by ProgressTimer().
| std::string te::common::ProgressTimer::getMessage | ( | ) |
Get the information about the evolution of the process.
Definition at line 92 of file ProgressTimer.cpp.
References te::common::Convert2String(), m_message, m_remainingTime, m_speedTime, and TE_TR.
Referenced by te::common::TaskProgress::setCurrentStep().
| double te::common::ProgressTimer::getRemainingTimeInMin | ( | ) | const |
Function used to get the remaining time to end the process.
Definition at line 82 of file ProgressTimer.cpp.
References m_remainingTime.
| double te::common::ProgressTimer::getSpeedTimeInSec | ( | ) | const |
Function used to get the speed time.
Definition at line 87 of file ProgressTimer.cpp.
References m_speedTime.
| void te::common::ProgressTimer::setMessage | ( | std::string | message | ) |
Set the message used by task progress.
Definition at line 77 of file ProgressTimer.cpp.
References m_message.
| void te::common::ProgressTimer::setTotalSteps | ( | int | totalSteps | ) |
Set the total steps.
Definition at line 72 of file ProgressTimer.cpp.
References m_totalSteps.
Referenced by te::common::TaskProgress::setTotalSteps().
| void te::common::ProgressTimer::start | ( | ) |
Start the internal timer.
Definition at line 43 of file ProgressTimer.cpp.
References m_count, and m_startTime.
Referenced by te::common::TaskProgress::setTotalSteps(), and te::common::TaskProgress::useTimer().
| void te::common::ProgressTimer::tick | ( | ) |
Define a new step process evolution.
Definition at line 51 of file ProgressTimer.cpp.
References m_count, m_remainingTime, m_speedTime, m_startTime, and m_totalSteps.
Referenced by te::common::TaskProgress::setCurrentStep().
|
private |
|
private |
Original task message.
Definition at line 102 of file ProgressTimer.h.
Referenced by getMessage(), and setMessage().
|
private |
Remaining time in minutes.
Definition at line 100 of file ProgressTimer.h.
Referenced by getMessage(), getRemainingTimeInMin(), and tick().
|
private |
Speed time in seconds.
Definition at line 101 of file ProgressTimer.h.
Referenced by getMessage(), getSpeedTimeInSec(), and tick().
|
private |
|
private |
Total steps.
Definition at line 97 of file ProgressTimer.h.
Referenced by setTotalSteps(), and tick().