Template class for per instance thread Local Storage.
More...
#include <Inventor/threads/SbThreadStorage.h>
Public Member Functions | |
| SbThreadStorage () | |
| SbThreadStorage (const T t) | |
| virtual | ~SbThreadStorage () |
| SbThreadStorage< T > & | operator= (T t) |
| T | operator-> () const |
| T | operator* () const |
| operator bool () const | |
| template<typename Func > | |
| void | call (Func f) |
| template<typename Func , typename Param > | |
| void | call (Func f, Param p) |
Template class for per instance thread Local Storage.
This class provides a way to declare a class member as a thread Specific variables.
| SbThreadStorage< T >::SbThreadStorage | ( | ) | [inline] |
Default constructor.
| SbThreadStorage< T >::SbThreadStorage | ( | const T | t | ) | [inline] |
| virtual SbThreadStorage< T >::~SbThreadStorage | ( | ) | [inline, virtual] |
Storage destructor: Find current storage in the global storage map, Delete thread dependent entry, And remove each entry.
| void SbThreadStorage< T >::call | ( | Func | f, | |
| Param | p | |||
| ) | [inline] |
Calls the passed function to all registered threads object.
Calls the passed function to all registered threads object.
| SbThreadStorage< T >::operator bool | ( | ) | const [inline] |
Override operator bool() Comparing templated objects work as comparing direct object.
for example, for: SbThreadStorage< SoCache* > m_cache; doing: m_cache == NULL run as doing
| T SbThreadStorage< T >::operator* | ( | ) | const [inline] |
Override operator T*() Destroying objects from delete operator is not allowed.
| T SbThreadStorage< T >::operator-> | ( | ) | const [inline] |
Override operator-> Gets value of the storage for current thread.
Returns NULL if the storage does not exist for current thread.
| SbThreadStorage<T>& SbThreadStorage< T >::operator= | ( | T | t | ) | [inline] |
Override operator= Set value of the storage for current thread.
If current thread storage was not existing, create it.