18 #ifndef LUNCHBOX_PERTHREAD_H 19 #define LUNCHBOX_PERTHREAD_H 21 #include <lunchbox/compiler.h> 22 #include <lunchbox/debug.h> 23 #include <lunchbox/tls.h> 27 namespace detail {
class PerThread; }
46 template<
class T,
void (*D)( T* ) = &perThreadDelete< T > >
67 const T* operator->()
const;
71 { LBASSERTINFO(
get(),
className(
this ));
return *
get(); }
74 { LBASSERTINFO(
get(),
className(
this ));
return *
get(); }
81 {
return (
get() == rhs.
get( )); }
87 bool operator == (
const T* rhs )
const {
return (
get()==rhs ); }
93 bool operator != (
const T* rhs )
const {
return (
get()!=rhs ); }
99 bool operator ! ()
const;
105 bool isValid()
const;
116 #include "perThread.ipp" 118 #endif //LUNCHBOX_PERTHREAD_H std::string className(const T &object)
Print the RTTI name of the given class.
const T & operator*() const
void perThreadNoDelete(T *)
Empty PerThread destructor.
Implements thread-specific storage for C++ objects.
Abstraction layer and common utilities for multi-threaded programming.
Provides thread-local storage API used by PerThread and PerThreadRef.
void perThreadDelete(T *object)
Default PerThread destructor deleting the object.