Stores a single heap-allocated value with a stable address, or a user-provided non-owning pointer. This is used for class fields of pointer types to const non-classes. Usage:
More...
|
|
unsafe | Const_Box (T value) |
| | Allocate a new value.
|
| |
|
unsafe | Const_Box (T *ptr) |
| | Store a non-owning pointer.
|
| |
|
virtual void | Dispose () |
| |
|
void | _KeepAlive (object obj, string key="") |
| | Keeps obj alive as long as this object exists. If key is specified, it's an optional tag for this object.
|
| |
|
void | _DiscardKeepAlive (string key="") |
| | Discards the objects kept alive by this object. If key is not empty, only discards the objects with the same key. Otherwise discards all of them. This intentionally doesn't discard _KeepAliveEnclosingObject.
|
| |
|
|
static implicit | operator Const_Box< T > (T value) |
| | Implicitly convert from a value, allocating a copy of it. Only Const_Box<T> has this, Box<T> intentionally doesn't.
|
| |
|
static void | _StaticKeepAlive (object obj, string key="") |
| |
|
static void | _StaticDiscardKeepAlive (string key="") |
| |
|
|
virtual unsafe void | Dispose (bool disposing) |
| |
|
|
unsafe ref readonly T | Value [get] |
| |
|
bool | IsOwning [get] |
| |
|
|
object? | _KeepAliveEnclosingObject |
| | A special holder for the enclosing object when returning a reference to its subobject.
|
| |
Stores a single heap-allocated value with a stable address, or a user-provided non-owning pointer. This is used for class fields of pointer types to const non-classes. Usage:
- To read a property of type
Const_Box<T>?, first check is not null. If it's not null, use .Value to read the value.
- To modify the property, either assign a value of type
T, or assign null. Assigning a value will allocate its copy and make the underlying pointer point to it.
The documentation for this class was generated from the following file: