Bifrost SDK
Bifrost SDK documentation
Amino::ITaskObserver Class Referenceabstract

Abstract interface for observing the progress of a task. More...

#include <TaskObserver.h>

Inheritance diagram for Amino::ITaskObserver:
Amino::ForwardTaskObserver

Public Types

using TaskStatus = TaskStatus
 
using Message = Message
 

Public Member Functions

 ITaskObserver ()=default
 Constructor. More...
 
virtual ~ITaskObserver ()
 Destructor. More...
 

Protected Member Functions

virtual void onStart () noexcept
 Called when the task starts (defaults to noop). More...
 
virtual void onProgress (StringView const &title, unsigned num, unsigned denum) noexcept
 Called when the task makes progress (defaults to noop). More...
 
virtual void onMessage (Message const &message) noexcept
 Called when the task reports a message (defaults to noop). More...
 
virtual void onDone (TaskStatus status) noexcept=0
 Called when the task completed (must be overridden). More...
 

Protected Attributes

friend TaskNotifier
 

Detailed Description

Abstract interface for observing the progress of a task.

The virtual function onDone must be overridden, but the other methods may optionally be overridden.

Definition at line 96 of file TaskObserver.h.

Member Typedef Documentation

◆ Message

Definition at line 101 of file TaskObserver.h.

◆ TaskStatus

Definition at line 100 of file TaskObserver.h.

Constructor & Destructor Documentation

◆ ITaskObserver()

Amino::ITaskObserver::ITaskObserver ( )
default

Constructor.

◆ ~ITaskObserver()

virtual Amino::ITaskObserver::~ITaskObserver ( )
virtual

Destructor.

Member Function Documentation

◆ onDone()

virtual void Amino::ITaskObserver::onDone ( TaskStatus  status)
protectedpure virtualnoexcept

Called when the task completed (must be overridden).

Implemented in Amino::ForwardTaskObserver.

◆ onMessage()

virtual void Amino::ITaskObserver::onMessage ( Message const &  message)
protectedvirtualnoexcept

Called when the task reports a message (defaults to noop).

Reimplemented in Amino::ForwardTaskObserver.

◆ onProgress()

virtual void Amino::ITaskObserver::onProgress ( StringView const &  title,
unsigned  num,
unsigned  denum 
)
protectedvirtualnoexcept

Called when the task makes progress (defaults to noop).

Reimplemented in Amino::ForwardTaskObserver.

◆ onStart()

virtual void Amino::ITaskObserver::onStart ( )
protectedvirtualnoexcept

Called when the task starts (defaults to noop).

Reimplemented in Amino::ForwardTaskObserver.

Member Data Documentation

◆ TaskNotifier

friend Amino::ITaskObserver::TaskNotifier
protected

Definition at line 112 of file TaskObserver.h.