ContRap-Core
Public Types | Public Member Functions | Protected Attributes

crp::Thread Class Reference

Class Thread implements a user level thread. More...

#include <thread.h>

Inheritance diagram for crp::Thread:
crp::EvalThread

Public Types

enum  ThreadState { STOPPED, STARTING, RUNNING, STOPPING }
 

Defines the status of the thread.

More...

Public Member Functions

 Thread ()
 Creates a new thread class instance.
virtual ~Thread ()
 Cleans up the memory.
virtual void start ()
 Starts the thread.
virtual void stop ()
 Stops the thread.
virtual void run ()=0
 Threads run function.
void set_state (ThreadState state)
 Sets the state of the thread.
ThreadState get_state ()
 Returns the status of the thread.

Protected Attributes

ThreadState state
 Signalizes the thread to stop.

Detailed Description

Class Thread implements a user level thread.


Member Enumeration Documentation

Defines the status of the thread.

Enumerator:
STOPPED 
STARTING 
RUNNING 
STOPPING 

Constructor & Destructor Documentation

crp::Thread::Thread ( )

Creates a new thread class instance.

virtual crp::Thread::~Thread ( ) [virtual]

Cleans up the memory.


Member Function Documentation

ThreadState crp::Thread::get_state ( ) [inline]

Returns the status of the thread.

Returns:
The current state of the thread
virtual void crp::Thread::run ( ) [pure virtual]

Threads run function.

Implemented in crp::EvalThread.

void crp::Thread::set_state ( ThreadState  state)

Sets the state of the thread.

virtual void crp::Thread::start ( ) [virtual]

Starts the thread.

virtual void crp::Thread::stop ( ) [virtual]

Stops the thread.


Field Documentation

Signalizes the thread to stop.


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