HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ThreadSpecificValue< T, ALIGNMENT > Class Template Reference

#include <UT_ThreadSpecificValue.h>

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef T value_type
 

Public Member Functions

 UT_ThreadSpecificValue ()
 
 ~UT_ThreadSpecificValue ()
 
 UT_ThreadSpecificValue (const ThisType &)=delete
 
TgetValueForThread (int thread_index)
 
const TgetValueForThread (int thread_index) const
 
Tget ()
 
Tlocal ()
 
const Tget () const
 
const Tlocal () const
 
const_iterator begin () const
 begin() const iterator More...
 
const_iterator end () const
 end() const iterator More...
 
iterator begin ()
 begin() iterator More...
 
iterator end ()
 end() iterator More...
 
int maxThreadsSeen () const
 
void clear ()
 Clear values for all threads, resetting to the initial state. More...
 
exint getMemoryUsage (bool inclusive) const
 

Friends

class const_iterator
 

Detailed Description

template<typename T, size_t ALIGNMENT = 64>
class UT_ThreadSpecificValue< T, ALIGNMENT >

A class for storing thread local values of type T. By default, the alignment of the type T's will be 64-byte aligned but this can be adjusted by supplying the ALIGNMENT template parameter, or use 0 to disable. For optimal performance, use an ALIGNMENT of 128 bytes but this can waste quite a lot of space.

Definition at line 127 of file UT_ThreadSpecificValue.h.

Member Typedef Documentation

template<typename T, size_t ALIGNMENT = 64>
typedef T UT_ThreadSpecificValue< T, ALIGNMENT >::value_type

Definition at line 137 of file UT_ThreadSpecificValue.h.

Constructor & Destructor Documentation

template<typename T, size_t ALIGNMENT = 64>
UT_ThreadSpecificValue< T, ALIGNMENT >::UT_ThreadSpecificValue ( )
inline

Definition at line 139 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
UT_ThreadSpecificValue< T, ALIGNMENT >::~UT_ThreadSpecificValue ( )
inline

Definition at line 156 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
UT_ThreadSpecificValue< T, ALIGNMENT >::UT_ThreadSpecificValue ( const ThisType )
delete

Member Function Documentation

template<typename T, size_t ALIGNMENT = 64>
const_iterator UT_ThreadSpecificValue< T, ALIGNMENT >::begin ( void  ) const
inline

begin() const iterator

Definition at line 340 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
iterator UT_ThreadSpecificValue< T, ALIGNMENT >::begin ( void  )
inline

begin() iterator

Definition at line 347 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
void UT_ThreadSpecificValue< T, ALIGNMENT >::clear ( void  )
inline

Clear values for all threads, resetting to the initial state.

Definition at line 364 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
const_iterator UT_ThreadSpecificValue< T, ALIGNMENT >::end ( void  ) const
inline

end() const iterator

Definition at line 343 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
iterator UT_ThreadSpecificValue< T, ALIGNMENT >::end ( void  )
inline

end() iterator

Definition at line 350 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
T& UT_ThreadSpecificValue< T, ALIGNMENT >::get ( )
inline

Definition at line 212 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
const T& UT_ThreadSpecificValue< T, ALIGNMENT >::get ( ) const
inline

Definition at line 215 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
exint UT_ThreadSpecificValue< T, ALIGNMENT >::getMemoryUsage ( bool  inclusive) const
inline

Definition at line 369 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
T& UT_ThreadSpecificValue< T, ALIGNMENT >::getValueForThread ( int  thread_index)
inline

Access the value for a particular thread index. Note that the threads you care about may not have been assigned sequentially! Always loop up to the maxthreads value and be able to handle zero-initialized empty data.

Definition at line 176 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
const T& UT_ThreadSpecificValue< T, ALIGNMENT >::getValueForThread ( int  thread_index) const
inline

Definition at line 195 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
T& UT_ThreadSpecificValue< T, ALIGNMENT >::local ( )
inline

Definition at line 213 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
const T& UT_ThreadSpecificValue< T, ALIGNMENT >::local ( ) const
inline

Definition at line 216 of file UT_ThreadSpecificValue.h.

template<typename T, size_t ALIGNMENT = 64>
int UT_ThreadSpecificValue< T, ALIGNMENT >::maxThreadsSeen ( ) const
inline

The number of values that require iteration. Don't use this for iteration - use iterators instead.

Definition at line 355 of file UT_ThreadSpecificValue.h.

Friends And Related Function Documentation

template<typename T, size_t ALIGNMENT = 64>
friend class const_iterator
friend

Definition at line 403 of file UT_ThreadSpecificValue.h.


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