Base module

Runnable

Abstract interface for classes that can be run and cancelled.

#include <icy/interface.h>

class Runnable

Defined in src/base/include/icy/interface.h:75

Public Methods

ReturnNameDescription
Runnable inline
~Runnable virtualDefaulted destructor.
voidrun virtualThe run method will be called by the asynchronous context.
voidcancel virtual inlineCancel the current task. The run() method should return ASAP.
boolcancelled virtual const inlineReturns true when the task has been cancelled.

Runnable

inline

inline Runnable()

Defined in src/base/include/icy/interface.h:78


~Runnable

virtual

virtual ~Runnable() = default

Defined in src/base/include/icy/interface.h:83

Defaulted destructor.


run

virtual

virtual void run()

Defined in src/base/include/icy/interface.h:86

The run method will be called by the asynchronous context.

Reimplemented by


cancel

virtual inline

virtual inline void cancel(bool flag = true)

Defined in src/base/include/icy/interface.h:90

Cancel the current task. The run() method should return ASAP.

Reimplemented by


cancelled

virtual const inline

virtual inline bool cancelled() const

Defined in src/base/include/icy/interface.h:96

Returns true when the task has been cancelled.

Reimplemented by

Protected Attributes

ReturnNameDescription
std::atomic< bool >exit

exit

std::atomic< bool > exit

Defined in src/base/include/icy/interface.h:102