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

#include <IDThreading.h>

Inheritance diagram for IDThreading::ThreadLocalManagedObject< T >:

Public Member Functions

 ThreadLocalManagedObject (const T &intVal)
 
T * Get ()
 
const T * Get () const
 
const T & GetReference () const
 
void Set (const T &val)
 
void Reset ()
 

Detailed Description

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

Similar to ThreadLocal, this class allows users to create unique instances of a variable for each thread. It actually uses a ThreadLocal internally and it adds the ability to automatically create the instance on the first access of the variable. All instances of ThreadLocalManagedObject associated with a thread will be destroyed when EndPublicThreadBottleneck() is called (when the thread finishes).