|
uvco 0.1
|
#include <async_work.h>
Public Member Functions | |
| ThreadLocalKey () | |
| ThreadLocalKey (const ThreadLocalKey &)=default | |
| ThreadLocalKey (ThreadLocalKey &&)=default | |
| ThreadLocalKey & | operator= (const ThreadLocalKey &)=default |
| ThreadLocalKey & | operator= (ThreadLocalKey &&)=default |
| ~ThreadLocalKey ()=default | |
| void | del () |
| T & | getOrDefault () |
| Get the stored value, or create a new one if none exists. | |
| T & | get () |
| Get the stored value. If none exists, this will crash. | |
| void | set (T &&value) |
| Set the stored value. | |
| void | setCopy (const T &value) |
| Set the stored value. | |
Private Attributes | |
| uv_key_t | key_ {} |
Easily access per-thread data. Use get() and getOrDefault() to access the stored value.
NOTE: this inherently leaks the stored objects, unless they are destroyed using del(). in-place.
|
inline |
|
default |
|
default |
|
default |
|
inline |
Destruct the stored value. The key will be empty afterwards, and getOrDefault() will create a new value.
|
inline |
Get the stored value. If none exists, this will crash.
|
inline |
|
default |
|
default |
|
inline |
Set the stored value.
|
inline |
Set the stored value.
|
private |