cpp-mate  0.7
Helpful library for C++.
CppMate::SharedState< T >::Action Class Referencefinal

Represents possible actions for modification of the state. More...

#include <SharedState.hpp>

Public Member Functions

void access (std::function< void(T &)> block)
 Provides read and write access to state within the block. More...
 
template<typename R >
extract (std::function< R(T &)> block)
 Provides read and write access to state within the block and returns a value. More...
 
void notifyOne (std::function< void(T &)> block)
 Provides read and write access to state within the block and notifies one thread waiting for state changes. More...
 
template<typename R >
notifyOne (std::function< R(T &)> block)
 Provides read and write access to state within the block and notifies one thread waiting for state changes. More...
 
void notifyAll (std::function< void(T &)> block)
 Provides read and write access to state within the block and notifies all threads waiting for state changes. More...
 
template<typename R >
notifyAll (std::function< R(T &)> block)
 Provides read and write access to state within the block and notifies all threads waiting for state changes. More...
 
Actionwhen (std::function< bool(T &)> pred)
 Waits till state will satisfy predicate condition. More...
 

Friends

class SharedState
 

Detailed Description

template<typename T>
class CppMate::SharedState< T >::Action

Represents possible actions for modification of the state.

Member Function Documentation

◆ access()

template<typename T >
void CppMate::SharedState< T >::Action::access ( std::function< void(T &)>  block)
inline

Provides read and write access to state within the block.

Parameters
blockthe block function.

◆ extract()

template<typename T >
template<typename R >
R CppMate::SharedState< T >::Action::extract ( std::function< R(T &)>  block)
inline

Provides read and write access to state within the block and returns a value.

Parameters
blockthe block function.
Returns
return value of the block.

◆ notifyAll() [1/2]

template<typename T >
template<typename R >
R CppMate::SharedState< T >::Action::notifyAll ( std::function< R(T &)>  block)
inline

Provides read and write access to state within the block and notifies all threads waiting for state changes.

Parameters
blockthe block function.
Returns
return value of the block.

◆ notifyAll() [2/2]

template<typename T >
void CppMate::SharedState< T >::Action::notifyAll ( std::function< void(T &)>  block)
inline

Provides read and write access to state within the block and notifies all threads waiting for state changes.

Parameters
blockthe block function.

◆ notifyOne() [1/2]

template<typename T >
template<typename R >
R CppMate::SharedState< T >::Action::notifyOne ( std::function< R(T &)>  block)
inline

Provides read and write access to state within the block and notifies one thread waiting for state changes.

Parameters
blockthe block function.
Returns
return value of the block.

◆ notifyOne() [2/2]

template<typename T >
void CppMate::SharedState< T >::Action::notifyOne ( std::function< void(T &)>  block)
inline

Provides read and write access to state within the block and notifies one thread waiting for state changes.

Parameters
blockthe block function.

◆ when()

template<typename T >
Action& CppMate::SharedState< T >::Action::when ( std::function< bool(T &)>  pred)
inline

Waits till state will satisfy predicate condition.

Parameters
predthe predicate function.
Returns
itself.

Friends And Related Function Documentation

◆ SharedState

template<typename T >
friend class SharedState
friend

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