Class allowing an instance of a type per thread. More...
Public Member Functions | |
| ThreadPrivate (ThreadPrivateStorage *key) | |
| T * | item () |
| Instance specific to the current thread. | |
Private Member Functions | |
| void * | createInstance () override |
Private Attributes | |
| std::vector< T * > | m_allocated_items |
| ThreadPrivateBase | m_storage |
Class allowing an instance of a type per thread.
The container allowing values to be stored must be passed as an argument to the constructor. This container must have been initialized via ThreadPrivateStorage::initialize() before using this class.
This class only has one method item() allowing retrieval of an instance of type T per thread. On the first call to item() for a given thread, an instance of T is constructed. The type T must have a default constructor and must have a build() method. \threadsafeclass
Definition at line 142 of file ThreadPrivate.h.
|
inline |
Definition at line 148 of file ThreadPrivate.h.
|
inline |
Definition at line 153 of file ThreadPrivate.h.
|
inlineoverrideprivatevirtual |
Implements Arcane::ThreadPrivateBase::ICreateFunctor.
Definition at line 169 of file ThreadPrivate.h.
|
inline |
Instance specific to the current thread.
Definition at line 162 of file ThreadPrivate.h.
|
private |
Definition at line 179 of file ThreadPrivate.h.
|
private |
Definition at line 180 of file ThreadPrivate.h.