Base Framework
Public Member Functions | Protected Attributes | List of all members
Runnable Class Referenceabstract

Base class of active objects. More...

#include <base/concurrency/Runnable.h>

Inherits Object.

Inherited by Thread.

Public Member Functions

 Runnable () noexcept
 
virtual void run ()=0
 
bool isTerminated () noexcept
 
virtual void onChild (Thread *child) noexcept
 
virtual void onTermination () noexcept
 
virtual ~Runnable ()
 

Protected Attributes

bool terminated = false
 

Detailed Description

Base class of active objects.

Base class of active objects. An active object can be run by a thread object.

See also
Thread
Version
1.0
Examples
testsuite/echod.cpp, testsuite/ftp.cpp, and testsuite/Thread.cpp.

Constructor & Destructor Documentation

◆ Runnable()

Runnable::Runnable ( )
inlinenoexcept

Initializes runnable object.

◆ ~Runnable()

virtual Runnable::~Runnable ( )
inlinevirtual

Destroys the runnable object.

Member Function Documentation

◆ isTerminated()

bool Runnable::isTerminated ( )
inlinenoexcept

Returns true if the active object should be terminated.

◆ onChild()

virtual void Runnable::onChild ( Thread child)
inlinevirtualnoexcept

Invocated when a child thread is completed. Watch out for MT-safety.

Parameters
childThe child thread.

◆ onTermination()

virtual void Runnable::onTermination ( )
inlinevirtualnoexcept

Invocated when the thread is asked to terminate. Watch out for MT-safety.

◆ run()

virtual void Runnable::run ( )
pure virtual

Entry point for the thread.

Implemented in Thread.

Member Data Documentation

◆ terminated

bool Runnable::terminated = false
protected

Specifies that the active object should be terminated.