BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Private Attributes | List of all members
Bempp::Lazy< T, Initializer, Mutex > Class Template Reference

Thread-safe wrapper of a lazily inititialised object. More...

#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/common/lazy.hpp>

Public Member Functions

 Lazy (const Initializer &init)
 
T & get ()
 
T & operator* ()
 
T * operator-> ()
 

Private Attributes

Initializer m_init
 
tbb::atomic< T * > m_value
 
Mutex m_mutex
 

Detailed Description

template<typename T, typename Initializer, typename Mutex = tbb::mutex>
class Bempp::Lazy< T, Initializer, Mutex >

Thread-safe wrapper of a lazily inititialised object.

Template Parameters
TType of the stored object.
InitializerType of a copy-constructible functor providing the member function std::auto_ptr<T> operator()() that will be used to construct the object the first time it is requested.
MutexType of the mutex to be used to lock the object during initialisation.

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