Qt 4.8
Classes | Functions
qthreadstorage.h File Reference
#include <QtCore/qglobal.h>

Go to the source code of this file.

Classes

class  QThreadStorage< T >
 The QThreadStorage class provides per-thread data storage. More...
 
class  QThreadStorageData
 

Functions

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

Function Documentation

◆ qThreadStorage_deleteData() [1/2]

template<typename T >
void qThreadStorage_deleteData ( void *  d,
T **   
)
inline

Definition at line 96 of file qthreadstorage.h.

Referenced by QThreadStorage< QNetworkAccessCache *>::deleteData().

97 { delete static_cast<T *>(d); }
double d
Definition: qnumeric_p.h:62

◆ qThreadStorage_deleteData() [2/2]

template<typename T >
void qThreadStorage_deleteData ( void *  d,
T *   
)
inline

Definition at line 124 of file qthreadstorage.h.

125 { delete static_cast<T *>(d); }
double d
Definition: qnumeric_p.h:62

◆ qThreadStorage_localData() [1/2]

template<typename T >
T*& qThreadStorage_localData ( QThreadStorageData d,
T **   
)
inline

Definition at line 74 of file qthreadstorage.h.

Referenced by QThreadStorage< QNetworkAccessCache *>::localData().

75 {
76  void **v = d.get();
77  if (!v) v = d.set(0);
78  return *(reinterpret_cast<T**>(v));
79 }
void ** get() const
void ** set(void *p)

◆ qThreadStorage_localData() [2/2]

template<typename T >
T& qThreadStorage_localData ( QThreadStorageData d,
T *   
)
inline

Definition at line 102 of file qthreadstorage.h.

103 {
104  void **v = d.get();
105  if (!v) v = d.set(new T());
106  return *(reinterpret_cast<T*>(*v));
107 }
void ** get() const
void ** set(void *p)

◆ qThreadStorage_localData_const() [1/2]

template<typename T >
T* qThreadStorage_localData_const ( const QThreadStorageData d,
T **   
)
inline

Definition at line 83 of file qthreadstorage.h.

Referenced by QThreadStorage< QNetworkAccessCache *>::localData().

84 {
85  void **v = d.get();
86  return v ? *(reinterpret_cast<T**>(v)) : 0;
87 }
void ** get() const

◆ qThreadStorage_localData_const() [2/2]

template<typename T >
T qThreadStorage_localData_const ( const QThreadStorageData d,
T *   
)
inline

Definition at line 111 of file qthreadstorage.h.

112 {
113  void **v = d.get();
114  return v ? *(reinterpret_cast<T*>(*v)) : T();
115 }
void ** get() const

◆ qThreadStorage_setLocalData() [1/2]

template<typename T >
void qThreadStorage_setLocalData ( QThreadStorageData d,
T **  t 
)
inline

Definition at line 91 of file qthreadstorage.h.

Referenced by QThreadStorage< QNetworkAccessCache *>::setLocalData().

92 { (void) d.set(*t); }
void ** set(void *p)

◆ qThreadStorage_setLocalData() [2/2]

template<typename T >
void qThreadStorage_setLocalData ( QThreadStorageData d,
T *  t 
)
inline

Definition at line 119 of file qthreadstorage.h.

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