HDK
|
#include <UT_COWValue.h>
Classes | |
class | Rep |
Public Member Functions | |
UT_COWValue () | |
UT_COWValue (T &&data) | |
template<typename... Args> | |
UT_COWValue (std::in_place_t, Args &&...args) | |
UT_COWValue & | operator= (const UT_COWValue &other) |
UT_COWValue (const UT_COWValue &other) | |
UT_COWValue & | operator= (UT_COWValue &&other) noexcept |
UT_COWValue (UT_COWValue &&other) noexcept | |
~UT_COWValue () | |
bool | isUnique () const |
bool | isImmortal () const |
exint | refCount () const |
void | makeUnique () |
T & | operator* () |
const T & | operator* () const |
T * | operator-> () |
const T * | operator-> () const |
const T & | peek () const |
void | swap (UT_COWValue< T > &other) |
Static Public Member Functions | |
static const UT_COWValue< T > & | getStaticEmpty () |
Protected Member Functions | |
void | safeIncRef () const |
void | safeDecRef () |
Protected Attributes | |
union { | |
const Rep * myConstRep | |
Rep * myRep | |
}; | |
Implements a generic copy on write mechanism for types. There is always a valid object stored within a COWValue – moving from it resets it to a default-constructed T, not a nullptr.
Definition at line 31 of file UT_COWValue.h.
|
inline |
Definition at line 34 of file UT_COWValue.h.
|
inline |
Definition at line 35 of file UT_COWValue.h.
|
inline |
Definition at line 37 of file UT_COWValue.h.
|
inline |
Definition at line 53 of file UT_COWValue.h.
|
inlinenoexcept |
Definition at line 72 of file UT_COWValue.h.
|
inline |
Definition at line 78 of file UT_COWValue.h.
|
inlinestatic |
Return the global static immortal default-constructed UT_COWValue for the type.
Definition at line 138 of file UT_COWValue.h.
|
inline |
Returns true if this UT_COWValue is referencing the global default-constructed version of T.
Definition at line 85 of file UT_COWValue.h.
|
inline |
Returns true if the data referenced by this UT_COWValue is not shared (i.e. whether accessing it will not create a copy).
Definition at line 82 of file UT_COWValue.h.
|
inline |
Ensure the data referenced by this UT_COWValue is only referenced by it.
Definition at line 92 of file UT_COWValue.h.
|
inline |
Definition at line 103 of file UT_COWValue.h.
|
inline |
Definition at line 109 of file UT_COWValue.h.
|
inline |
Definition at line 115 of file UT_COWValue.h.
|
inline |
Definition at line 121 of file UT_COWValue.h.
|
inline |
Definition at line 42 of file UT_COWValue.h.
|
inlinenoexcept |
Definition at line 60 of file UT_COWValue.h.
|
inline |
Return a const reference to the stored data, even if it's not unique. Never copies.
Definition at line 129 of file UT_COWValue.h.
|
inline |
Return the number of UT_COWValues sharing data with us, including us. May return a negative number to indicate an unknown quantity.
Definition at line 88 of file UT_COWValue.h.
|
inlineprotected |
Definition at line 240 of file UT_COWValue.h.
|
inlineprotected |
Definition at line 234 of file UT_COWValue.h.
|
inline |
Definition at line 131 of file UT_COWValue.h.
union { ... } |
const Rep* UT_COWValue< T >::myConstRep |
Definition at line 250 of file UT_COWValue.h.
Rep* UT_COWValue< T >::myRep |
Definition at line 251 of file UT_COWValue.h.