AOFlagger
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
aoflagger::StatusListener Class Referenceabstract

A base class which callers can inherit from to be able to receive progress updates and error messages. More...

#include <aoflagger.h>

Public Member Functions

virtual ~StatusListener ()
 Virtual destructor.
 
virtual void OnEndTask ()
 Called when at the end of the current task. More...
 
virtual void OnException (std::exception &thrownException)=0
 Called when an exception occurs during execution of the strategy. More...
 
virtual void OnProgress (size_t progress, size_t maxProgress)
 Called while the current task is progressing. More...
 
virtual void OnStartTask (size_t taskNo, size_t taskCount, const std::string &description)
 This virtual method is called when a new task is started. More...
 

Detailed Description

A base class which callers can inherit from to be able to receive progress updates and error messages.

A status listener should be thread safe when the Run() method is called in parallel.

Member Function Documentation

◆ OnEndTask()

virtual void aoflagger::StatusListener::OnEndTask ( )
inlinevirtual

Called when at the end of the current task.

After OnEndTask() is called, the handler does not need to expect any OnProgress() calls until a new task has been started and OnStartTask() was called.

◆ OnException()

virtual void aoflagger::StatusListener::OnException ( std::exception &  thrownException)
pure virtual

Called when an exception occurs during execution of the strategy.

This can occur when for example the strategy is malformed.

Parameters
thrownExceptionThe exception that was thrown.

◆ OnProgress()

virtual void aoflagger::StatusListener::OnProgress ( size_t  progress,
size_t  maxProgress 
)
inlinevirtual

Called while the current task is progressing.

This can be used to display a progress bar if the strategy would take a lot of time.

Parameters
progressCurrent progress
maxProgressProgress that is required to finish the current task.

◆ OnStartTask()

virtual void aoflagger::StatusListener::OnStartTask ( size_t  taskNo,
size_t  taskCount,
const std::string &  description 
)
inlinevirtual

This virtual method is called when a new task is started.

Typically, a client could display a message saying that the given task 'description' is started. This method can be called recursively to signify the start of a subtask.

Parameters
taskNo(Sub) task number
taskCountTotal number of (sub) tasks.
descriptionDescription of the task, e.g. "SumThreshold".

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