uvw 2.12.1
Loading...
Searching...
No Matches
uvw::ThreadLocalStorage Class Referencefinal

The ThreadLocalStorage wrapper. More...

#include <thread.h>

Inheritance diagram for uvw::ThreadLocalStorage:
Collaboration diagram for uvw::ThreadLocalStorage:

Public Member Functions

template<typename T >
T * get () noexcept
 Gets the value of a given variable.
 
template<typename T >
void set (T *value) noexcept
 Sets the value of a given variable.
 
- Public Member Functions inherited from uvw::UnderlyingType< ThreadLocalStorage, uv_key_t >
Looploop () const noexcept
 Gets the loop from which the resource was originated.
 
const uv_key_t * raw () const noexcept
 Gets the underlying raw data structure.
 
uv_key_t * raw () noexcept
 Gets the underlying raw data structure.
 

Additional Inherited Members

- Static Public Member Functions inherited from uvw::UnderlyingType< ThreadLocalStorage, uv_key_t >
static std::shared_ptr< ThreadLocalStoragecreate (Args &&...args)
 Creates a new resource of the given type.
 
- Protected Member Functions inherited from uvw::UnderlyingType< ThreadLocalStorage, uv_key_t >

Detailed Description

The ThreadLocalStorage wrapper.

A storage area that can only be accessed by one thread. The variable can be seen as a global variable that is only visible to a particular thread and not the whole program.

Definition at line 110 of file thread.h.

Member Function Documentation

◆ get()

template<typename T >
T * uvw::ThreadLocalStorage::get ( )
inlinenoexcept

Gets the value of a given variable.

Template Parameters
TType to which to cast the opaque storage area.
Returns
A pointer to the given variable.

Definition at line 122 of file thread.h.

◆ set()

template<typename T >
void uvw::ThreadLocalStorage::set ( T * value)
inlinenoexcept

Sets the value of a given variable.

Template Parameters
TType of the variable to store aside.
Parameters
valueA valid pointer to the variable to store

Definition at line 132 of file thread.h.


The documentation for this class was generated from the following file: