OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WWorkerThreadTest::FuncType Class Reference

A threaded function. More...

+ Collaboration diagram for WWorkerThreadTest::FuncType:

Public Member Functions

 FuncType (int value)
 Constructor, initialize some stuff. More...
 
void operator() (std::size_t, std::size_t, WBoolFlag const &shutdown)
 This is the actual thread function. More...
 
bool stopped ()
 Check if the thread was ordered to stop. More...
 
int getResult ()
 A method to extract the result. More...
 
void reset ()
 Reset everything. More...
 

Private Attributes

std::shared_ptr< int const > m_input
 the input data More...
 
WSharedObject< int > m_result
 the result More...
 
WSharedObject< bool > m_stopped
 thread stopped? More...
 

Detailed Description

A threaded function.

Definition at line 44 of file WWorkerThread_test.h.

Constructor & Destructor Documentation

◆ FuncType()

WWorkerThreadTest::FuncType::FuncType ( int  value)
inline

Constructor, initialize some stuff.

Parameters
valueAn int value.

Definition at line 52 of file WWorkerThread_test.h.

References WSharedObject< T >::getWriteTicket(), m_result, and m_stopped.

+ Here is the call graph for this function:

Member Function Documentation

◆ getResult()

int WWorkerThreadTest::FuncType::getResult ( )
inline

A method to extract the result.

Returns
The result of the threaded computation.

Definition at line 97 of file WWorkerThread_test.h.

References WSharedObject< T >::getReadTicket(), and m_result.

+ Here is the call graph for this function:

◆ operator()()

void WWorkerThreadTest::FuncType::operator() ( std::size_t  ,
std::size_t  ,
WBoolFlag const &  shutdown 
)
inline

This is the actual thread function.

Parameters
shutdownA flag indicating the thread is supposed to stop.

Definition at line 70 of file WWorkerThread_test.h.

References WSharedObject< T >::getWriteTicket(), m_input, m_result, and m_stopped.

+ Here is the call graph for this function:

◆ reset()

void WWorkerThreadTest::FuncType::reset ( )
inline

Reset everything.

Definition at line 105 of file WWorkerThread_test.h.

References WSharedObject< T >::getWriteTicket(), and m_result.

+ Here is the call graph for this function:

◆ stopped()

bool WWorkerThreadTest::FuncType::stopped ( )
inline

Check if the thread was ordered to stop.

Returns
true, if the thread was ordered to stop

Definition at line 87 of file WWorkerThread_test.h.

References WSharedObject< T >::getReadTicket(), and m_stopped.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_input

std::shared_ptr< int const > WWorkerThreadTest::FuncType::m_input
private

the input data

Definition at line 112 of file WWorkerThread_test.h.

Referenced by operator()().

◆ m_result

WSharedObject< int > WWorkerThreadTest::FuncType::m_result
private

the result

Definition at line 115 of file WWorkerThread_test.h.

Referenced by FuncType(), getResult(), operator()(), and reset().

◆ m_stopped

WSharedObject< bool > WWorkerThreadTest::FuncType::m_stopped
private

thread stopped?

Definition at line 118 of file WWorkerThread_test.h.

Referenced by FuncType(), operator()(), and stopped().


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