16 #ifndef INCLUDE_NN_NLIB_THREADING_TLS_H_ 17 #define INCLUDE_NN_NLIB_THREADING_TLS_H_ 20 #include "nn/nlib/Swap.h" 36 #ifdef __cpp_rvalue_references 56 if (e != 0)
return nullptr;
57 return reinterpret_cast<T*
>(p);
75 static void destr_func(
void* p)
NLIB_NOEXCEPT {
delete reinterpret_cast<T*
>(p); }
83 NLIB_DEFINE_STD_SWAP_T_BEGIN3(
nn, nlib, threading)
84 NLIB_DEFINE_STD_SWAP_T1(T, NLIB_NS::threading::Tls)
85 NLIB_DEFINE_STD_SWAP_T_END3(
nn, nlib, threading)
87 #endif // INCLUDE_NN_NLIB_THREADING_TLS_H_ #define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
errno_t Reset(T *p=0) noexcept
Releases the pointer to the specified thread.
T & operator*() const noexcept
Dereferences the pointer.
T * Release() noexcept
Releases the pointer to the specified thread.
T * operator->() const noexcept
Returns the pointer.
T * Get() const noexcept
Gets a pointer to the specified thread.
errno_t Init() noexcept
Initializes thread local storage.
Class for handling thread local storage.
constexpr Tls() noexcept
Instantiates the object with default parameters (default constructor).
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
~Tls() noexcept
Destructor. The pointer will be deleted.
A file that contains the configuration information for each development environment.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.