Thrill  0.1
SharedState< ValueType > Class Template Reference

Detailed Description

template<typename ValueType = size_t>
class thrill::common::SharedState< ValueType >

Definition at line 27 of file shared_state.hpp.

#include <shared_state.hpp>

Public Member Functions

 SharedState (const value_type &s)
 
 SharedState (const SharedState &)=delete
 non-copyable: delete copy-constructor More...
 
value_type operator() ()
 
SharedStateoperator= (const SharedState &)=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 state More...
 

Member Typedef Documentation

◆ value_type

using value_type = ValueType
private

Definition at line 29 of file shared_state.hpp.

Constructor & Destructor Documentation

◆ SharedState() [1/2]

SharedState ( const value_type s)
inlineexplicit

Definition at line 41 of file shared_state.hpp.

References SharedState< ValueType >::operator=().

◆ SharedState() [2/2]

SharedState ( const SharedState< ValueType > &  )
delete

non-copyable: delete copy-constructor

Member Function Documentation

◆ operator()()

value_type operator() ( )
inline

Definition at line 63 of file shared_state.hpp.

References SharedState< ValueType >::state_.

◆ operator=()

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

non-copyable: delete assignment operator

Referenced by SharedState< ValueType >::SharedState().

◆ set_to()

void set_to ( const value_type new_state)
inline

Definition at line 50 of file shared_state.hpp.

◆ wait_for()

void wait_for ( const value_type needed_state)
inline

Definition at line 57 of file shared_state.hpp.

Member Data Documentation

◆ cv_

std::condition_variable cv_
private

condition variable

Definition at line 35 of file shared_state.hpp.

◆ mutex_

std::mutex mutex_
private

mutex for condition variable

Definition at line 32 of file shared_state.hpp.

◆ state_

value_type state_
private

current state

Definition at line 38 of file shared_state.hpp.

Referenced by SharedState< ValueType >::operator()().


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