dune-fem 2.8.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Dune::Fem::ThreadSafeValue< T > Class Template Reference

ThreadSafeValue realizes thread safety for a given variable by creating an instance of this variable for each thread. More...

#include <dune/fem/misc/threads/threadsafevalue.hh>

Inheritance diagram for Dune::Fem::ThreadSafeValue< T >:
Inheritance graph

Public Types

typedef T ValueType
 type of value to be thread safe
 

Public Member Functions

template<class ... Args>
 ThreadSafeValue (Args &&...args)
 constructor initializing values for all threads given a init value
 
 ThreadSafeValue ()
 default constructor
 
size_t size () const
 return number of threads
 
ValueTypeoperator* ()
 return reference to thread private value
 
const ValueTypeoperator* () const
 return reference to thread private value
 
 operator const ValueType & () const
 
 operator ValueType & ()
 
ValueTypeoperator[] (const unsigned int thread)
 return reference to private value for given thread number
 
const ValueTypeoperator[] (const unsigned int thread) const
 return reference to private value for given thread number
 

Detailed Description

template<class T>
class Dune::Fem::ThreadSafeValue< T >

ThreadSafeValue realizes thread safety for a given variable by creating an instance of this variable for each thread.

Member Typedef Documentation

◆ ValueType

template<class T >
typedef T Dune::Fem::ThreadSafeValue< T >::ValueType

type of value to be thread safe

Constructor & Destructor Documentation

◆ ThreadSafeValue() [1/2]

template<class T >
template<class ... Args>
Dune::Fem::ThreadSafeValue< T >::ThreadSafeValue ( Args &&...  args)
inline

constructor initializing values for all threads given a init value

◆ ThreadSafeValue() [2/2]

template<class T >
Dune::Fem::ThreadSafeValue< T >::ThreadSafeValue ( )
inline

default constructor

Member Function Documentation

◆ operator const ValueType &()

template<class T >
Dune::Fem::ThreadSafeValue< T >::operator const ValueType & ( ) const
inline

◆ operator ValueType &()

template<class T >
Dune::Fem::ThreadSafeValue< T >::operator ValueType & ( )
inline

◆ operator*() [1/2]

template<class T >
ValueType & Dune::Fem::ThreadSafeValue< T >::operator* ( )
inline

return reference to thread private value

◆ operator*() [2/2]

template<class T >
const ValueType & Dune::Fem::ThreadSafeValue< T >::operator* ( ) const
inline

return reference to thread private value

◆ operator[]() [1/2]

template<class T >
ValueType & Dune::Fem::ThreadSafeValue< T >::operator[] ( const unsigned int  thread)
inline

return reference to private value for given thread number

◆ operator[]() [2/2]

template<class T >
const ValueType & Dune::Fem::ThreadSafeValue< T >::operator[] ( const unsigned int  thread) const
inline

return reference to private value for given thread number

◆ size()

template<class T >
size_t Dune::Fem::ThreadSafeValue< T >::size ( ) const
inline

return number of threads


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