|
HAL
v4.5.0-124-g47ab54673
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include <hal_core/plugin_system/user_feedback.h>

Public Member Functions | |
| ProgressPrinter (const std::string &message, u32 max_detail_size=0) | |
| ~ProgressPrinter () | |
| ProgressPrinter (const ProgressPrinter &)=delete | |
| ProgressPrinter & | operator= (const ProgressPrinter &)=delete |
| void | report (float progress, const std::string &detail="") |
| void | set_message (const std::string &message) |
| void | clear () |
| void | reset () |
Brackets a long-running operation that can say how far along it is, and reports that both as a progress bar on the terminal and to the progress display of the user interface.
This is a ProgressScope that an operation can report into, so use it instead of a scope wherever progress can be quantified at all, and a bare ProgressScope only where it cannot. Covering both the terminal and the user interface with one object means a plugin reports its progress once and reaches whoever is watching. The bar is only drawn if stderr is a terminal wide enough for it, so redirected output stays clean.
Definition at line 119 of file user_feedback.h.
|
explicit |
Construct a progress printer and show the progress display at zero percent.
| [in] | message | - The message naming the operation, shown alongside the progress. |
| [in] | max_detail_size | - The number of characters to reserve for the detail passed to report, 0 for none. |
Definition at line 70 of file user_feedback.cpp.
References reset().
| hal::user_feedback::ProgressPrinter::~ProgressPrinter | ( | ) |
Erases the progress bar and dismisses the progress display, so that whatever comes next starts clean.
Definition at line 86 of file user_feedback.cpp.
References clear().
|
delete |
| void hal::user_feedback::ProgressPrinter::clear | ( | ) |
Erase the progress bar, for instance before printing something else.
Definition at line 157 of file user_feedback.cpp.
Referenced by hal::dataflow::pre_processing::identify_register_stages(), and ~ProgressPrinter().
|
delete |
| void hal::user_feedback::ProgressPrinter::report | ( | float | progress, |
| const std::string & | detail = "" |
||
| ) |
Report how far the operation has come along.
Cheap to call in a tight loop: the bar is only redrawn when it actually changes.
| [in] | progress | - The progress, from 0.0 to 1.0. |
| [in] | detail | - What the operation is doing right now, shown next to the bar. Truncated to the maximum detail size. |
Definition at line 97 of file user_feedback.cpp.
References hal::output, and hal::user_feedback::report_progress().
Referenced by hal::dataflow::pre_processing::identify_register_stages().
| void hal::user_feedback::ProgressPrinter::reset | ( | ) |
Forget what has been drawn, so that the next report draws the bar again from scratch.
Definition at line 166 of file user_feedback.cpp.
Referenced by ProgressPrinter().
| void hal::user_feedback::ProgressPrinter::set_message | ( | const std::string & | message | ) |
Change the message naming the operation, for instance when it moves on to another phase.
| [in] | message | - The message naming the operation. |
Definition at line 91 of file user_feedback.cpp.
References hal::user_feedback::report_progress().