Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::ThreadLocal< ValueType > Class Template Reference

! More...

#include <mitsuba/mitsuba.h>

Public Member Functions

 ThreadLocal ()
 Construct a new thread local storage object. More...
 
void set (ValueType *ptr)
 Update the data associated with the current thread. More...
 
ValueType * get ()
 Return a reference to the data associated with the current thread. More...
 
const ValueType * get () const
 Return a reference to the data associated with the current thread (const version) More...
 

Static Protected Member Functions

static void * construct ()
 
static void destruct (void *data)
 

Protected Attributes

detail::ThreadLocalBase m_base
 

Detailed Description

template<typename ValueType>
class mitsuba::ThreadLocal< ValueType >

!

Thin wrapper around boost thread local storage. Stores references to Object instances.

See Also
PrimitiveThreadLocal

This class implements a reference counting thread local storage object which captures references to subclasses of Object. In comparison to an API like boost::thread_specific_ptr it has a much nicer cleanup mechanism. Held references are destroyed when the owning thread dies or when the ThreadLocal instance is freed, whichever occurs first.

Constructor & Destructor Documentation

template<typename ValueType >
mitsuba::ThreadLocal< ValueType >::ThreadLocal ( )
inline

Construct a new thread local storage object.

Member Function Documentation

template<typename ValueType >
static void* mitsuba::ThreadLocal< ValueType >::construct ( )
inlinestaticprotected
template<typename ValueType >
static void mitsuba::ThreadLocal< ValueType >::destruct ( void *  data)
inlinestaticprotected
template<typename ValueType >
ValueType* mitsuba::ThreadLocal< ValueType >::get ( )
inline

Return a reference to the data associated with the current thread.

template<typename ValueType >
const ValueType* mitsuba::ThreadLocal< ValueType >::get ( ) const
inline

Return a reference to the data associated with the current thread (const version)

template<typename ValueType >
void mitsuba::ThreadLocal< ValueType >::set ( ValueType *  ptr)
inline

Update the data associated with the current thread.

Member Data Documentation

template<typename ValueType >
detail::ThreadLocalBase mitsuba::ThreadLocal< ValueType >::m_base
protected

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