Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
icl_core::logging::Thread Class Referenceabstract

#include <Thread.h>

Inheritance diagram for icl_core::logging::Thread:
Inheritance graph
[legend]

Public Member Functions

bool execute () const
 
void join ()
 
virtual void run ()=0
 
bool running () const
 
bool start ()
 
void stop ()
 
 Thread (icl_core::ThreadPriority priority=0)
 
virtual ~Thread ()
 Deletes the thread. Stops it if it is still running. More...
 

Private Member Functions

virtual void runThread ()
 
void waitStarted () const
 Suspends the calling thread until thread is started. More...
 

Private Attributes

bool m_execute
 
bool m_finished
 
ThreadImplm_impl
 
bool m_joined
 
bool m_starting
 

Friends

class ThreadImplLxrt33
 
class ThreadImplLxrt35
 
class ThreadImplLxrt38
 
class ThreadImplPosix
 
class ThreadImplWin32
 

Additional Inherited Members

- Protected Member Functions inherited from icl_core::Noncopyable
 Noncopyable ()
 
virtual ~Noncopyable ()
 

Detailed Description

Implements a platform independent minimal thread.

Remark: This class is intended to be only used in icl_core::logging. Use icl_core::thread::Thread in your applications instead.

Definition at line 46 of file icl_core_logging/Thread.h.

Constructor & Destructor Documentation

icl_core::logging::Thread::Thread ( icl_core::ThreadPriority  priority = 0)

Creates a new thread with the description and priority. If the priority is negative and LXRT is available, the thread is scheduled in hard-realtime.

Definition at line 42 of file icl_core_logging/Thread.cpp.

icl_core::logging::Thread::~Thread ( )
virtual

Deletes the thread. Stops it if it is still running.

Definition at line 74 of file icl_core_logging/Thread.cpp.

Member Function Documentation

bool icl_core::logging::Thread::execute ( ) const
inline

Call this from inside the thread code, if you want to check, wether the thread was demanded to stop from outside.

Returns
false if the thread has been asked to stop, true otherwise.

Definition at line 64 of file icl_core_logging/Thread.h.

void icl_core::logging::Thread::join ( )

Wait for the thread to finish. Returns immediately if the thread is not running.

Definition at line 84 of file icl_core_logging/Thread.cpp.

virtual void icl_core::logging::Thread::run ( )
pure virtual

This is the function running in the thread. This has to be reimplemented from derived classes. If you start the thread by calling Start() this function is executed in the thread. If you call don't want that function to be executed in the thread you could call it directly in your derived class.

Implemented in icl_core::logging::LogOutputStream::WorkerThread.

bool icl_core::logging::Thread::running ( ) const
inline
Returns
true if the thread is currently running.

Definition at line 80 of file icl_core_logging/Thread.h.

void icl_core::logging::Thread::runThread ( )
privatevirtual

Executes the thread. This function is intended to be called from thread implementations.

Definition at line 130 of file icl_core_logging/Thread.cpp.

bool icl_core::logging::Thread::start ( )

Starts the thread.

Returns
true if the thread has been started successfully, false if an error occured while starting the thread.

Definition at line 94 of file icl_core_logging/Thread.cpp.

void icl_core::logging::Thread::stop ( )
inline

Cooperatively stops the thread.

The thread's main loop must continuously check if the thread has been stopped by calling isStopped().

Definition at line 94 of file icl_core_logging/Thread.h.

void icl_core::logging::Thread::waitStarted ( ) const
private

Suspends the calling thread until thread is started.

Definition at line 142 of file icl_core_logging/Thread.cpp.

Friends And Related Function Documentation

friend class ThreadImplLxrt33
friend

Definition at line 114 of file icl_core_logging/Thread.h.

friend class ThreadImplLxrt35
friend

Definition at line 115 of file icl_core_logging/Thread.h.

friend class ThreadImplLxrt38
friend

Definition at line 116 of file icl_core_logging/Thread.h.

friend class ThreadImplPosix
friend

Definition at line 117 of file icl_core_logging/Thread.h.

friend class ThreadImplWin32
friend

Definition at line 118 of file icl_core_logging/Thread.h.

Member Data Documentation

bool icl_core::logging::Thread::m_execute
private

Definition at line 105 of file icl_core_logging/Thread.h.

bool icl_core::logging::Thread::m_finished
private

Definition at line 106 of file icl_core_logging/Thread.h.

ThreadImpl* icl_core::logging::Thread::m_impl
private

Definition at line 110 of file icl_core_logging/Thread.h.

bool icl_core::logging::Thread::m_joined
private

Definition at line 107 of file icl_core_logging/Thread.h.

bool icl_core::logging::Thread::m_starting
private

Definition at line 108 of file icl_core_logging/Thread.h.


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


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59