OpenWalnut  1.4.0
Public Member Functions | Private Attributes
WThreadedFunctionTest::FuncType Class Reference

A threaded function. More...

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

A threaded function.

Definition at line 45 of file WThreadedFunction_test.h.


Constructor & Destructor Documentation

Constructor, initialize some stuff.

Parameters:
valueAn int value.

Definition at line 53 of file WThreadedFunction_test.h.

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


Member Function Documentation

A method to extract the result.

Returns:
The result of the threaded computation.

Definition at line 99 of file WThreadedFunction_test.h.

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

void WThreadedFunctionTest::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 71 of file WThreadedFunction_test.h.

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

Reset everything.

Definition at line 107 of file WThreadedFunction_test.h.

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

Check if the thread was ordered to stop.

Returns:
true, if the thread was ordered to stop

Definition at line 89 of file WThreadedFunction_test.h.

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


Member Data Documentation

boost::shared_ptr< int const > WThreadedFunctionTest::FuncType::m_input [private]

the input data

Definition at line 114 of file WThreadedFunction_test.h.

Referenced by operator()().

the result

Definition at line 117 of file WThreadedFunction_test.h.

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

thread stopped?

Definition at line 120 of file WThreadedFunction_test.h.

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


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