16 #ifndef INCLUDE_NN_NLIB_THREADING_TLS_H_ 17 #define INCLUDE_NN_NLIB_THREADING_TLS_H_ 20 #include "nn/nlib/Swap.h" 37 #ifdef __cpp_rvalue_references 60 if (e != 0)
return nullptr;
61 return reinterpret_cast<T*
>(p);
80 delete reinterpret_cast<T*
>(p);
89 NLIB_DEFINE_STD_SWAP_T_BEGIN3(
nn, nlib, threading)
90 NLIB_DEFINE_STD_SWAP_T1(T, NLIB_NS::threading::Tls)
91 NLIB_DEFINE_STD_SWAP_T_END3(
nn, nlib, threading)
93 #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.
An empty structure indicating that an argument to a function needs to be moved.
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.