InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDThreading::ThreadLocal< T > Class Template Reference

#include <IDThreading.h>

Inheritance diagram for IDThreading::ThreadLocal< T >:

Public Member Functions

 ThreadLocal (const T &initialVal)
 
Get () const
 
void Set (T x)
 
ThreadLocal< T > & operator= (T x)
 
ThreadLocal< T > & operator+= (T x)
 
ThreadLocal< T > & operator-= (T x)
 
ThreadLocal< T > & operator++ ()
 
ThreadLocal< T > & operator-- ()
 

Detailed Description

template<typename T>
class IDThreading::ThreadLocal< T >

Platform independent thread local storage (TLS). It is built on top of the existing TLS offered by the OS and it uses a single slot in the TLS. Since the OS support for TLS is very limited, this class offers some nice features, like unlimited number of keys (limited only by the available memory), support for initial values, value semantics for certain operations, etc.

Member Function Documentation

template<typename T>
T IDThreading::ThreadLocal< T >::Get (void ) const
inline

Read access

template<typename T>
ThreadLocal<T>& IDThreading::ThreadLocal< T >::operator= (x)
inline

Assignment

template<typename T>
void IDThreading::ThreadLocal< T >::Set (x)
inline

Write access