Home
Base module

Runnable

Abstract interface for classes that can be run and cancelled.

Runnable

#include <icy/interface.h>
class Runnable

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

Subclassed by: RunnableQueue< IPacket >, RunnableQueue< PacketT >, PlanarAudioPacket >, RunnableQueue< VisionFramePacket >, AsyncDiagnostic, AsyncLogWriter, RunnableQueue< T >, Task, TaskRunner, MediaCapture, InstallTask

Abstract interface for classes that can be run and cancelled.

List of all members

NameKindOwner
RunnablefunctionDeclared here
~RunnablefunctionDeclared here
runfunctionDeclared here
cancelfunctionDeclared here
cancelledfunctionDeclared here
exitvariableDeclared here

Public Methods

ReturnNameDescription
Runnable inline
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


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