Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Runnable Class Reference

#include <elm/sys/Thread.h>

+ Inheritance diagram for Runnable:

Public Member Functions

 Runnable (void)
 
virtual ~Runnable (void)
 
virtual void run (void)
 
Threadthread (void) const
 

Static Public Member Functions

static Runnablecurrent (void)
 

Static Public Attributes

static Runnable null
 

Protected Member Functions

void stop (void)
 

Detailed Description

A runnable must of the parent of any class representing a computation performed in a thread.

The user must overload the run() method in order to provided the computation of the thread and may use the stop() method to stop the thread.

Whatever, the end of run method stop also the thread.

Constructor & Destructor Documentation

◆ Runnable()

Runnable ( void  )

◆ ~Runnable()

~Runnable ( void  )
virtual

Member Function Documentation

◆ current()

Runnable & current ( void  )
inlinestatic

Get the runnable for the current thread.

Returns
Current thread runnable.

References Thread::current(), and Thread::runnable().

◆ run()

void run ( void  )
virtual

This method must be overloaded to provide the computation to the thread. As a default, it does nothing and return immediately.

◆ stop()

void stop ( void  )
protected

Cause the thread to stop immediately.

References Thread::stop().

◆ thread()

Thread * thread ( void  ) const
inline

Get the current thread executing the runnable.

Returns
Thread executing the runnable, null if the run() has been called out of a thread scope.

Member Data Documentation

◆ null

Runnable null
static

Runnable that does nothing.


The documentation for this class was generated from the following files: