Embedded Multicore Building Blocks V1.0.0
|
Represents thread-specific storage (TSS). More...
#include <thread_specific_storage.h>
Public Member Functions | |
ThreadSpecificStorage () | |
Creates the TSS and default initializes all slots. More... | |
template<typename Initializer1 , ... > | |
ThreadSpecificStorage (Initializer1 initializer1,...) | |
Creates the TSS and initializes all slots with up to four constructor arguments. More... | |
~ThreadSpecificStorage () | |
Destroys the TSS and frees allocated memory for the TSS slots. More... | |
Type & | Get () |
Returns a reference to the TSS slot of the current thread. More... | |
const Type & | Get () const |
Returns a const reference to the TSS slot of the current thread. More... | |
Represents thread-specific storage (TSS).
Provides for each thread a separate slot storing an object of the given type.
Type | Type of the objects |
embb::base::ThreadSpecificStorage< Type >::ThreadSpecificStorage | ( | ) |
Creates the TSS and default initializes all slots.
NoMemoryException | if not enough memory is available to allocate the TSS slots |
|
explicit |
Creates the TSS and initializes all slots with up to four constructor arguments.
The TSS objects are created by calling their constructor as follows: Type(initializer1, ...).
NoMemoryException | if not enough memory is available to allocate the TSS slots |
[in] | initializer1 | First argument for constructor ... |
embb::base::ThreadSpecificStorage< Type >::~ThreadSpecificStorage | ( | ) |
Destroys the TSS and frees allocated memory for the TSS slots.
Type& embb::base::ThreadSpecificStorage< Type >::Get | ( | ) |
Returns a reference to the TSS slot of the current thread.
embb::base::ErrorException | if the maximum number of threads has been exceeded |
const Type& embb::base::ThreadSpecificStorage< Type >::Get | ( | ) | const |
Returns a const reference to the TSS slot of the current thread.
embb::base::ErrorException | if the maximum number of threads has been exceeded |