Struct Rc
Helper struct that manages the reference count of an object using RAII.
struct Rc(T)
if (isAtomicRefCounted!T);
Constructors
Name | Description |
this
(obj)
|
Build a Rc instance with the provided resource
|
Fields
Name | Type | Description |
_obj
|
T | |
Properties
Name | Type | Description |
loaded [get]
|
bool | Check whether this Rc is assigned to a resource.
|
obj [get]
|
inout(T) | Access to the held resource.
|
Methods
Name | Description |
giveAway
()
|
Decrease the ref count and return the object without calling dispose
|
opAssign
(obj)
|
Assign another resource. Release the previously held ref and retain the new one.
|
opCast
()
|
Check whether this Rc is assigned to a resource.
|
unload
()
|
Reset the resource.
|