Thrill  0.1
shared_state< ValueType > Class Template Reference

Detailed Description

template<typename ValueType = size_t>
class foxxll::shared_state< ValueType >

Definition at line 24 of file shared_state.hpp.

+ Inheritance diagram for shared_state< ValueType >:

#include <shared_state.hpp>

Public Member Functions

 shared_state (const value_type &s)
 
 shared_state (const shared_state &)=delete
 non-copyable: delete copy-constructor More...
 
value_type operator() ()
 
shared_stateoperator= (const shared_state &)=delete
 non-copyable: delete assignment operator More...
 
void set_to (const value_type &new_state)
 
void wait_for (const value_type &needed_state)
 

Private Types

using value_type = ValueType
 

Private Attributes

std::condition_variable cv_
 condition variable More...
 
std::mutex mutex_
 mutex for condition variable More...
 
value_type state_
 current shared_state More...
 

Member Typedef Documentation

◆ value_type

using value_type = ValueType
private

Definition at line 26 of file shared_state.hpp.

Constructor & Destructor Documentation

◆ shared_state() [1/2]

shared_state ( const value_type s)
inlineexplicit

Definition at line 38 of file shared_state.hpp.

Referenced by shared_state< request_state >::shared_state().

◆ shared_state() [2/2]

shared_state ( const shared_state< ValueType > &  )
delete

non-copyable: delete copy-constructor

Member Function Documentation

◆ operator()()

value_type operator() ( )
inline

Definition at line 61 of file shared_state.hpp.

◆ operator=()

shared_state& operator= ( const shared_state< ValueType > &  )
delete

non-copyable: delete assignment operator

Referenced by shared_state< request_state >::shared_state().

◆ set_to()

◆ wait_for()

void wait_for ( const value_type needed_state)
inline

Definition at line 54 of file shared_state.hpp.

Referenced by request_with_state::wait().

Member Data Documentation

◆ cv_

std::condition_variable cv_
private

condition variable

Definition at line 32 of file shared_state.hpp.

◆ mutex_

std::mutex mutex_
private

mutex for condition variable

Definition at line 29 of file shared_state.hpp.

◆ state_

value_type state_
private

current shared_state

Definition at line 35 of file shared_state.hpp.

Referenced by shared_state< request_state >::operator()().


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