Bifrost SDK
Bifrost SDK documentation
Amino::ForwardTaskObserver Class Reference

Base class for a ITaskObserver that forwards notifications to a given TaskNotifier. More...

#include <TaskObserver.h>

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

Protected Member Functions

 ForwardTaskObserver (TaskNotifier notifier)
 Constructor. More...
 
 ~ForwardTaskObserver () override
 Destructor. More...
 
void onStart () noexcept override
 Forwards the onStart notification to its notifier. More...
 
void onProgress (StringView const &title, unsigned num, unsigned denum) noexcept override
 Forwards the onProgress notification to its notifier. More...
 
void onMessage (Message const &message) noexcept override
 Forwards the onMessage notification to its notifier. More...
 
void onDone (TaskStatus status) noexcept override
 Forwards the onDone notification to its notifier. More...
 
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...
 

Additional Inherited Members

- Public Types inherited from Amino::ITaskObserver
using TaskStatus = TaskStatus
 
using Message = Message
 
- Public Member Functions inherited from Amino::ITaskObserver
 ITaskObserver ()=default
 Constructor. More...
 
virtual ~ITaskObserver ()
 Destructor. More...
 
- Protected Attributes inherited from Amino::ITaskObserver
friend TaskNotifier
 

Detailed Description

Base class for a ITaskObserver that forwards notifications to a given TaskNotifier.

Bear in mind that forwarding notifications does entail some overhead due to the double virtual calls, so ForwardTaskObserver should be used sparingly, if really necessary.

Definition at line 563 of file TaskObserver.h.

Constructor & Destructor Documentation

◆ ForwardTaskObserver()

Amino::ForwardTaskObserver::ForwardTaskObserver ( TaskNotifier  notifier)
inlineexplicitprotected

Constructor.

Definition at line 568 of file TaskObserver.h.

◆ ~ForwardTaskObserver()

Amino::ForwardTaskObserver::~ForwardTaskObserver ( )
overrideprotected

Destructor.

Member Function Documentation

◆ onDone()

void Amino::ForwardTaskObserver::onDone ( TaskStatus  status)
overrideprotectedvirtualnoexcept

Forwards the onDone notification to its notifier.

Implements Amino::ITaskObserver.

◆ onMessage()

void Amino::ForwardTaskObserver::onMessage ( Message const &  message)
overrideprotectedvirtualnoexcept

Forwards the onMessage notification to its notifier.

Reimplemented from Amino::ITaskObserver.

◆ onProgress()

void Amino::ForwardTaskObserver::onProgress ( StringView const &  title,
unsigned  num,
unsigned  denum 
)
overrideprotectedvirtualnoexcept

Forwards the onProgress notification to its notifier.

Reimplemented from Amino::ITaskObserver.

◆ onStart()

void Amino::ForwardTaskObserver::onStart ( )
overrideprotectedvirtualnoexcept

Forwards the onStart notification to its notifier.

Reimplemented from Amino::ITaskObserver.