eive-obsw/mission/utility/ProgressPrinter.h
Jakob Meier 57b815c8ee
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
progress printer
2022-03-01 17:17:15 +01:00

38 lines
832 B
C++

#ifndef MISSION_UTILITY_PROGRESSPRINTER_H_
#define MISSION_UTILITY_PROGRESSPRINTER_H_
#include <string>
/**
* @brief Class which can be used to print the progress of processes in percent.
*
* @author J. Meier
*/
class ProgressPrinter {
public:
/**
* @brief Constructor
*
* @param name Name of the process to monitor
* @param numSteps Number of steps to execute
*/
ProgressPrinter(std::string name, uint32_t numSteps);
virtual ~ProgressPrinter();
/**
* @brief Will print the progress
*
* @param currentStep Current step from which to derive progress
*/
void print(uint32_t step);
private:
static constexpr uint32_t FIVE_PERCENT = 5;
std::string name = "";
uint32_t numSteps = 0;
uint32_t nextProgressPrint = 0;
};
#endif /* MISSION_UTILITY_PROGRESSPRINTER_H_ */