Bifrost SDK
Bifrost SDK documentation
Amino::TaskNotifier Class Referencefinal

Class referencing (non-owning) a concrete ITaskObserver. More...

#include <TaskObserver.h>

Public Member Functions

AMINO_CORE_SHARED_DECL TaskNotifier () noexcept
 Default Constructor (constructs a noop notifier). More...
 
AMINO_CORE_SHARED_DECL TaskNotifier (TaskNotifier &&) noexcept
 Move constructor. More...
 
 TaskNotifier (TaskNotifier const &)=delete
 TaskNotifier is not copy-constructible. More...
 
AMINO_CORE_SHARED_DECL TaskNotifieroperator= (TaskNotifier &&) noexcept
 Move assignment operator. More...
 
TaskNotifieroperator= (TaskNotifier const &)=delete
 TaskNotifier is not copy-assignable. More...
 
AMINO_CORE_SHARED_DECL ~TaskNotifier ()
 Destructor. More...
 
AMINO_CORE_SHARED_DECL void notifyStart () const
 Notify the observer that the task has started. More...
 
void notifyProgress (StringView const &title, unsigned num, unsigned denum) const
 Notify the observer of the progress of a named task. More...
 
AMINO_CORE_SHARED_DECL void notifyMessage (Message const &message) const
 Notify the observer that a message was reported. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyDebug (Args &&... args) const
 Short-hand for notifying a debug message. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyInfo (Args &&... args) const
 Short-hand for notifying an info message. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyWarning (Args &&... args) const
 Short-hand for notifying a warning message. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyError (Args &&... args) const
 Short-hand for notifying an error message. More...
 
AMINO_CORE_SHARED_DECL void notifyDone (TaskStatus status) const
 Notify the observer that the task has completed. More...
 
void notifySuccess () const
 Notify the observer that the task has completed successfully. More...
 
void notifyError () const
 Notify the observer that the task has completed with errors. More...
 
void notifyCancelled () const
 Notify the observer that the task has completed due to cancellation. More...
 
void notifyDropped () const
 Notify the observer that the task has been dropped. More...
 
AMINO_CORE_SHARED_DECL bool isValid () const
 Whether this notifier is valid (wraps a concrete ITaskObserver and which its TaskObserver manager is still alive). More...
 
 operator bool () const
 Whether this notifier is valid (wraps a concrete ITaskObserver and which its TaskObserver manager is still alive). More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyMessage (MessageKind kind, Source source, MessageClass cls, MessageText text, Args const &... args) const
 Notify the observer that a message was reported. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyMessage (MessageKind kind, MessageClass cls, MessageText text, Args const &... args) const
 Notify the observer that a message was reported. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyMessage (MessageKind kind, MessageText text, Args const &... args) const
 Notify the observer that a message was reported. More...
 
template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void notifyMessage (MessageKind kind, Source source, MessageText text, Args const &... args) const
 Notify the observer that a message was reported. More...
 

Detailed Description

Class referencing (non-owning) a concrete ITaskObserver.

This class is intented to be passed to the computation tasks to report progress. The TaskNotifier can outlive the TaskObserver, in which case the notifications will just stop being sent (will become no-ops).

Definition at line 326 of file TaskObserver.h.

Constructor & Destructor Documentation

◆ TaskNotifier() [1/3]

AMINO_CORE_SHARED_DECL Amino::TaskNotifier::TaskNotifier ( )
noexcept

Default Constructor (constructs a noop notifier).

◆ TaskNotifier() [2/3]

AMINO_CORE_SHARED_DECL Amino::TaskNotifier::TaskNotifier ( TaskNotifier &&  )
noexcept

Move constructor.

◆ TaskNotifier() [3/3]

Amino::TaskNotifier::TaskNotifier ( TaskNotifier const &  )
delete

TaskNotifier is not copy-constructible.

◆ ~TaskNotifier()

AMINO_CORE_SHARED_DECL Amino::TaskNotifier::~TaskNotifier ( )

Destructor.

Member Function Documentation

◆ isValid()

AMINO_CORE_SHARED_DECL bool Amino::TaskNotifier::isValid ( ) const

Whether this notifier is valid (wraps a concrete ITaskObserver and which its TaskObserver manager is still alive).

◆ notifyCancelled()

void Amino::TaskNotifier::notifyCancelled ( ) const
inline

Notify the observer that the task has completed due to cancellation.

Definition at line 448 of file TaskObserver.h.

References Amino::TaskStatus::eCancelled.

◆ notifyDebug()

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyDebug ( Args &&...  args) const
inline

Short-hand for notifying a debug message.

Definition at line 414 of file TaskObserver.h.

References Amino::eDebug.

◆ notifyDone()

AMINO_CORE_SHARED_DECL void Amino::TaskNotifier::notifyDone ( TaskStatus  status) const

Notify the observer that the task has completed.

◆ notifyDropped()

void Amino::TaskNotifier::notifyDropped ( ) const
inline

Notify the observer that the task has been dropped.

Definition at line 451 of file TaskObserver.h.

References Amino::TaskStatus::eDropped.

◆ notifyError() [1/2]

void Amino::TaskNotifier::notifyError ( ) const
inline

Notify the observer that the task has completed with errors.

Definition at line 444 of file TaskObserver.h.

References Amino::TaskStatus::eError.

◆ notifyError() [2/2]

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyError ( Args &&...  args) const
inline

Short-hand for notifying an error message.

Definition at line 432 of file TaskObserver.h.

References Amino::eError.

◆ notifyInfo()

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyInfo ( Args &&...  args) const
inline

Short-hand for notifying an info message.

Definition at line 420 of file TaskObserver.h.

References Amino::eInfo.

◆ notifyMessage() [1/5]

AMINO_CORE_SHARED_DECL void Amino::TaskNotifier::notifyMessage ( Message const &  message) const

Notify the observer that a message was reported.

◆ notifyMessage() [2/5]

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyMessage ( MessageKind  kind,
MessageClass  cls,
MessageText  text,
Args const &...  args 
) const
inline

Notify the observer that a message was reported.

Definition at line 385 of file TaskObserver.h.

◆ notifyMessage() [3/5]

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyMessage ( MessageKind  kind,
MessageText  text,
Args const &...  args 
) const
inline

Notify the observer that a message was reported.

Definition at line 394 of file TaskObserver.h.

◆ notifyMessage() [4/5]

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyMessage ( MessageKind  kind,
Source  source,
MessageClass  cls,
MessageText  text,
Args const &...  args 
) const
inline

Notify the observer that a message was reported.

Definition at line 375 of file TaskObserver.h.

◆ notifyMessage() [5/5]

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyMessage ( MessageKind  kind,
Source  source,
MessageText  text,
Args const &...  args 
) const
inline

Notify the observer that a message was reported.

Definition at line 401 of file TaskObserver.h.

◆ notifyProgress()

void Amino::TaskNotifier::notifyProgress ( StringView const &  title,
unsigned  num,
unsigned  denum 
) const
inline

Notify the observer of the progress of a named task.

Precondition
num <= denum

Definition at line 362 of file TaskObserver.h.

◆ notifyStart()

AMINO_CORE_SHARED_DECL void Amino::TaskNotifier::notifyStart ( ) const

Notify the observer that the task has started.

◆ notifySuccess()

void Amino::TaskNotifier::notifySuccess ( ) const
inline

Notify the observer that the task has completed successfully.

Definition at line 441 of file TaskObserver.h.

References Amino::TaskStatus::eSuccess.

◆ notifyWarning()

template<typename... Args>
AMINO_INTERNAL_FORCEINLINE void Amino::TaskNotifier::notifyWarning ( Args &&...  args) const
inline

Short-hand for notifying a warning message.

Definition at line 426 of file TaskObserver.h.

References Amino::eWarning.

◆ operator bool()

Amino::TaskNotifier::operator bool ( ) const
inlineexplicit

Whether this notifier is valid (wraps a concrete ITaskObserver and which its TaskObserver manager is still alive).

Definition at line 353 of file TaskObserver.h.

◆ operator=() [1/2]

AMINO_CORE_SHARED_DECL TaskNotifier & Amino::TaskNotifier::operator= ( TaskNotifier &&  )
noexcept

Move assignment operator.

◆ operator=() [2/2]

TaskNotifier & Amino::TaskNotifier::operator= ( TaskNotifier const &  )
delete

TaskNotifier is not copy-assignable.