Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | List of all members
honey::thread::Local< T > Class Template Reference

Local thread storage. Multiple threads can access one Local object, but each thread will only see its own separate "local" instance. More...

#include <Thread.h>

Public Types

typedef function< T *()> Init
 
typedef function< void(T *)> Fin
 

Public Member Functions

 Local (const Init &init=[]{return new T();}, const Fin &fin=finalize< T >())
 Init / Finalize func is called once per thread to create/destroy local object instance. More...
 
 ~Local ()
 
Localoperator= (const T &rhs)
 Assign thread-local object to rhs. More...
 
 operator const T & () const
 
 operator T & ()
 
const T * operator-> () const
 
T * operator-> ()
 
const T & operator* () const
 
T & operator* ()
 
const T & get () const
 
T & get ()
 Get the thread-local object. More...
 

Detailed Description

template<class T>
class honey::thread::Local< T >

Local thread storage. Multiple threads can access one Local object, but each thread will only see its own separate "local" instance.

Member Typedef Documentation

template<class T>
typedef function<void (T*)> honey::thread::Local< T >::Fin
template<class T>
typedef function<T* ()> honey::thread::Local< T >::Init

Constructor & Destructor Documentation

template<class T >
honey::thread::Local< T >::Local ( const Init init = []{ return new T(); },
const Fin fin = finalize<T>() 
)

Init / Finalize func is called once per thread to create/destroy local object instance.

template<class T >
honey::thread::Local< T >::~Local ( )

Member Function Documentation

template<class T>
const T& honey::thread::Local< T >::get ( ) const
inline
template<class T >
T & honey::thread::Local< T >::get ( )

Get the thread-local object.

template<class T>
honey::thread::Local< T >::operator const T & ( ) const
inline
template<class T>
honey::thread::Local< T >::operator T & ( )
inline
template<class T>
const T& honey::thread::Local< T >::operator* ( ) const
inline
template<class T>
T& honey::thread::Local< T >::operator* ( )
inline
template<class T>
const T* honey::thread::Local< T >::operator-> ( ) const
inline
template<class T>
T* honey::thread::Local< T >::operator-> ( )
inline
template<class T>
Local& honey::thread::Local< T >::operator= ( const T &  rhs)
inline

Assign thread-local object to rhs.


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