gfx.core.rc

Reference counting module

Members

Aliases

GfxRefCounted
alias GfxRefCounted = AtomicRefCounted

definition of how the gfx package itself implements reference counting

GfxRefCounted
alias GfxRefCounted = AtomicRefCounted
Undocumented in source.
GfxRefCounted
alias GfxRefCounted = RefCounted
Undocumented in source.

Enums

isAtomicRefCounted
eponymoustemplate isAtomicRefCounted(T)

compile time check that T can be ref counted atomically.

isNonAtomicRefCounted
eponymoustemplate isNonAtomicRefCounted(T)

compile time check that T can be ref counted non-atomically.

isRefCounted
eponymoustemplate isRefCounted(T)

compile time check that T can be ref counted (either shared or not)

Functions

disposeArray
void disposeArray(T[] arr)

Dispose GC allocated array of resources

disposeArray
void disposeArray(T[K] arr)

Dispose GC allocated associative array of resources

reinitArray
void reinitArray(T[] arr)

Reinitialises a GC allocated array of struct. Useful if the struct release resource in its destructor.

reinitArray
void reinitArray(T[K] arr)

Reinitialises a GC allocated associative array of struct. Useful if the struct release resource in its destructor.

releaseArray
void releaseArray(T[] arr)

Release GC allocated array of ref-counted resources

releaseArray
void releaseArray(T[K] arr)

Release GC allocated associative array of ref-counted resources

retainArray
void retainArray(T[] arr)

Retain GC allocated array of ref-counted resources

retainArray
void retainArray(T[K] arr)

Retain GC allocated associative array of ref-counted resources

Interfaces

AtomicRefCounted
interface AtomicRefCounted

A atomic reference counted resource. Objects implementing this interface can be safely used as shared.

Disposable
interface Disposable

A resource that can be disposed

RefCounted
interface RefCounted

A non-atomic reference counted resource. Objects implementing this interface should have exterior locking if used as shared.

Manifest constants

atomicRcCode
enum atomicRcCode;

A string that can be mixed-in a class declaration to implement AtomicRefCounted. Both shared and non-shared methods are implemented atomically. This is useful for things such as a parallel loop

gfxRcCode
enum gfxRcCode;
Undocumented in source.
gfxRcCode
enum gfxRcCode;
Undocumented in source.
gfxRcCode
enum gfxRcCode;
Undocumented in source.
mixedRcCode
enum mixedRcCode;

A string that can be mixed-in a class declaration to implement AtomicRefCounted. The RefCounted methods (non-shared) are implemented without atomicity. The AtomicRefCounted methods (shared) are implemented atomically.

rcCode
enum rcCode;

A string that can be mixed-in a class declaration to implement RefCounted.

Properties

nullRc
Rc!T nullRc [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Rc
struct Rc(T)

Helper struct that manages the reference count of an object using RAII.

Uniq
struct Uniq(T)

A helper struct that manage the lifetime of a Disposable using RAII. Note: dlang has capability to enforce a parameter be a lvalue (ref param) but has no mechanism such as c++ rvalue reference which would enforce true uniqueness by the compiler. Uniq gives additional robustness, but it is up to the programmer to make sure that the values passed in by rvalue are not referenced somewhere else in the code

Weak
struct Weak(T)

Helper struct that keeps a weak reference to a Resource.

Templates

RcHack
template RcHack(T)

Cast hack to get around a bug in DMD front-end. Cast non shared atomic rc interfaces when calling retain or release. See https://issues.dlang.org/show_bug.cgi?id=18138

makeRc
template makeRc(T)

Helper that build a new instance of T and returns it within a Rc!T

makeUniq
template makeUniq(T)

Creates a new instance of T and returns it under a Uniq!T.

rc
template rc(T)

Helper that places an instance of T within a Rc!T

Meta