OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Protected Member Functions | Friends | List of all members
WThreadedRunnerImpl Class Reference

Class implementing a simple worker thread, since proper testing of WThreadedRunner itself is not usable. More...

#include <WThreadedRunner_test.h>

+ Inheritance diagram for WThreadedRunnerImpl:

Protected Member Functions

virtual void threadMain ()
 Function that has to be overwritten for execution.
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped.
void yield () const
 Give remaining execution timeslice to another thread.
void sleep (const int32_t t) const
 Sets thread asleep.
void msleep (const int32_t t) const
 Sets thread asleep.
void waitForStop ()
 Let the thread sleep until a stop request was given.

Friends

class WThreadedRunnerTest

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions.
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor.
virtual ~WThreadedRunner ()
 Destructor.
virtual void run ()
 Run thread.
void run (THREADFUNCTION f)
 Run thread.
void wait (bool requestFinish=false)
 Wait for the thread to be finished.
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it.
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance.
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit.

Detailed Description

Class implementing a simple worker thread, since proper testing of WThreadedRunner itself is not usable.

Definition at line 37 of file WThreadedRunner_test.h.

Member Function Documentation

virtual void WThreadedRunnerImpl::threadMain ( )
inlineprotectedvirtual

Function that has to be overwritten for execution.

It gets executed in a separate thread after run() has been called.

Reimplemented from WThreadedRunner.

Definition at line 45 of file WThreadedRunner_test.h.

References WThreadedRunner::m_shutdownFlag, and WThreadedRunner::sleep().


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