Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbThreadStorage< T > Class Template Reference

VSG extension Template class for per instance thread Local Storage. More...

#include <Inventor/threads/SbThreadStorage.h>

+ Inheritance diagram for SbThreadStorage< T >:

Public Member Functions

 SbThreadStorage ()
 Default constructor.
 
 SbThreadStorage (const T t)
 
virtual ~SbThreadStorage ()
 Storage destructor: Find current storage in the global storage map, Delete thread dependent entry, And remove each entry.
 
SbThreadStorage< T > & operator= (T t)
 Override operator= Set value of the storage for current thread.
 
operator-> () const
 Override operator-> Gets value of the storage for current thread.
 
operator* () const
 Override operator T*() Destroying objects from delete operator is not allowed.
 
 operator bool () const
 Override operator bool() Comparing templated objects work as comparing direct object.
 
template<typename Func >
void call (Func f)
 Calls the passed function to all registered threads object.
 
template<typename Func , typename Param >
void call (Func f, Param p)
 Calls the passed function to all registered threads object.
 

Detailed Description

template<class T>
class SbThreadStorage< T >

VSG extension Template class for per instance thread Local Storage.

This class provides a way to declare a class member as a thread Specific variables.

Definition at line 42 of file SbThreadStorage.h.

Constructor & Destructor Documentation

◆ SbThreadStorage() [1/2]

template<class T >
SbThreadStorage< T >::SbThreadStorage ( )
inline

Default constructor.

Definition at line 1 of file SbThreadStorage.h.

◆ SbThreadStorage() [2/2]

template<class T >
SbThreadStorage< T >::SbThreadStorage ( const T  t)
inline

Definition at line 1 of file SbThreadStorage.h.

◆ ~SbThreadStorage()

template<class T >
virtual SbThreadStorage< T >::~SbThreadStorage ( )
inlinevirtual

Storage destructor: Find current storage in the global storage map, Delete thread dependent entry, And remove each entry.

Definition at line 64 of file SbThreadStorage.h.

Member Function Documentation

◆ call() [1/2]

template<class T >
template<typename Func >
void SbThreadStorage< T >::call ( Func  f)
inline

Calls the passed function to all registered threads object.

Definition at line 118 of file SbThreadStorage.h.

◆ call() [2/2]

template<class T >
template<typename Func , typename Param >
void SbThreadStorage< T >::call ( Func  f,
Param  p 
)
inline

Calls the passed function to all registered threads object.

Definition at line 135 of file SbThreadStorage.h.

◆ operator bool()

template<class T >
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

Definition at line 111 of file SbThreadStorage.h.

◆ operator*()

template<class T >
T SbThreadStorage< T >::operator* ( ) const
inline

Override operator T*() Destroying objects from delete operator is not allowed.

Definition at line 99 of file SbThreadStorage.h.

◆ operator->()

template<class T >
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.

Definition at line 83 of file SbThreadStorage.h.

◆ operator=()

template<class T >
SbThreadStorage< T > & SbThreadStorage< T >::operator= ( t)
inline

Override operator= Set value of the storage for current thread.

If current thread storage was not existing, create it.

Definition at line 72 of file SbThreadStorage.h.


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