SbThreadStorage< T > Class Template Reference

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

#include <Inventor/threads/SbThreadStorage.h>

List of all members.

Public Member Functions

 SbThreadStorage ()
 SbThreadStorage (const T t)
virtual ~SbThreadStorage ()
SbThreadStorage< T > & operator= (T t)
operator-> () const
operator* () const
 operator bool () const
template<typename Func >
void call (Func f)
template<typename Func , typename Param >
void call (Func f, Param p)

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.


Constructor & Destructor Documentation

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

Default constructor.

template<class T >
SbThreadStorage< T >::SbThreadStorage ( const T  t  )  [inline]
template<class T >
virtual SbThreadStorage< T >::~SbThreadStorage (  )  [inline, virtual]

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


Member Function Documentation

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.

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

Calls the passed function to all registered threads object.

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

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

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

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.

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.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/