A progress reporter that sends reports to a stream. More...
#include <progress_reporter.h>
Public Types | |
enum | StreamIdentifier { StdOut, StdErr } |
Public Member Functions | |
StreamProgressReporter (std::ostream &output_stream) | |
Creates a new StreamProgressReporter. | |
StreamProgressReporter (StreamIdentifier output_stream_identifier) | |
void | activate () override |
Actives this progress reporter, subscribing it to any updates. | |
void | deactivate () override |
Deactivates this progress reporter, unsubscribing it from updates. | |
void | task_finished (TaskId task_id) override |
Called when a new task is finished. | |
void | task_message_output (TaskId task_id, const std::string &message) override |
Called when a task generates a relevant message. | |
void | task_started (TaskId task_id, TaskId parent_task_id, const std::string &task_name) override |
Called when a new task is started. | |
void | task_status_updated (TaskId task_id, const std::string &new_status) override |
Called when a task's status message has been updated. |
A progress reporter that sends reports to a stream.
FDR::StreamProgressReporter::StreamProgressReporter | ( | std::ostream & | output_stream | ) |
Creates a new StreamProgressReporter.
output_stream | The stream to write to. This must be kept alive as long as the progress reporter is activated. |
void FDR::StreamProgressReporter::activate | ( | ) | [override, virtual] |
Actives this progress reporter, subscribing it to any updates.
This MUST be called from the main thread before ANY other call to libfdr, other than library_init(), and may only be called once. In other words, once a ProgressReporter is activated, there is no way to activate another ProgressReporter.
If this is overriden, the base class implementation MUST be called.
Reimplemented from FDR::ProgressReporter.
void FDR::StreamProgressReporter::deactivate | ( | ) | [override, virtual] |
Deactivates this progress reporter, unsubscribing it from updates.
This MUST only be called once, after activate().
If this is overriden, the base class implementation MUST be called.
Reimplemented from FDR::ProgressReporter.
void FDR::StreamProgressReporter::task_started | ( | TaskId | task_id, | |
TaskId | parent_task_id, | |||
const std::string & | task_name | |||
) | [override, virtual] |
Called when a new task is started.
task_id | The new task. | |
parent_task_id | The identifier of this task's parent (tasks are hierarchical). If there is no parent, this is INVALID_TASK. | |
task_name | the name of the task. |
Reimplemented from FDR::ProgressReporter.