qthreadstorage.h File Reference

#include <QtCore/qglobal.h>

Go to the source code of this file.

Classes

class   QThreadStorageData
class   QThreadStorage< T >

Functions

template<typename T >
T *&  qThreadStorage_localData (QThreadStorageData &d, T **)
template<typename T >
T *  qThreadStorage_localData_const (const QThreadStorageData &d, T **)
template<typename T >
void  qThreadStorage_setLocalData (QThreadStorageData &d, T **t)
template<typename T >
T &  qThreadStorage_localData (QThreadStorageData &d, T *)
template<typename T >
qThreadStorage_localData_const (const QThreadStorageData &d, T *)
template<typename T >
void  qThreadStorage_setLocalData (QThreadStorageData &d, T *t)

Function Documentation

T*& qThreadStorage_localData ( QThreadStorageData d,
T **   
) [inline]

Definition at line 74 of file qthreadstorage.h.

{
    void **v = d.get();
    if (!v) v = d.set(0);
    return *(reinterpret_cast<T**>(v));
}
T* qThreadStorage_localData_const ( const QThreadStorageData d,
T **   
) [inline]

Definition at line 83 of file qthreadstorage.h.

{
    void **v = d.get();
    return v ? *(reinterpret_cast<T**>(v)) : 0;
}
void qThreadStorage_setLocalData ( QThreadStorageData d,
T **  t 
) [inline]

Definition at line 91 of file qthreadstorage.h.

{ (void) d.set(*t); }
T& qThreadStorage_localData ( QThreadStorageData d,
T *   
) [inline]

Definition at line 99 of file qthreadstorage.h.

{
    void **v = d.get();
    if (!v) v = d.set(new T());
    return *(reinterpret_cast<T*>(*v));
}
T qThreadStorage_localData_const ( const QThreadStorageData d,
T *   
) [inline]

Definition at line 108 of file qthreadstorage.h.

{
    void **v = d.get();
    return v ? *(reinterpret_cast<T*>(*v)) : T();
}
void qThreadStorage_setLocalData ( QThreadStorageData d,
T *  t 
) [inline]

Definition at line 116 of file qthreadstorage.h.

{ (void) d.set(new T(*t)); }