Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.rc.context

Thread-safe reference-counted context implementation

.
struct mir_rc_context;
void function(mir_rc_context*) pure nothrow @nogc @system deallocator;
immutable(mir_type_info)* typeInfo;
shared size_t counter;
size_t length;
export pure nothrow @nogc @system void mir_rc_increase_counter(ref mir_rc_context context);
Increase counter by 1.
Parameters:
mir_rc_context context shared_ptr context (not null)
export pure nothrow @nogc @system void mir_rc_decrease_counter(ref mir_rc_context context);
Decrease counter by 1. Destroys data if counter decreased from 1 to 0.
Parameters:
mir_rc_context context shared_ptr context (not null)
export pure nothrow @nogc @system void mir_rc_delete(ref mir_rc_context context);
export pure nothrow @nogc @system mir_rc_context* mir_rc_create(ref immutable(mir_type_info) typeInfo, size_t length, scope const void* payload = null, bool initialize = true, bool deallocate = true);
template CommonRCImpl()
const nothrow @nogc @property scope @trusted ThisTemplate!(const(T)) lightConst()() return;

immutable nothrow @nogc @property scope @trusted ThisTemplate!(immutable(T)) lightImmutable()() return;
nothrow @nogc @property scope @trusted ThisTemplate!(const(Unqual!T)) moveToConst()() return;
const pure nothrow @nogc @property scope @trusted size_t _counter();
const C opCast(C)()
if (is(Unqual!C == bool));
pure nothrow @nogc ref @trusted C opCast(C : ThisTemplate!Q, Q)()
if (isImplicitlyConvertible!(T*, Q*));

const pure nothrow @nogc @trusted C opCast(C : ThisTemplate!Q, Q)()
if (isImplicitlyConvertible!(const(T)*, Q*));

immutable pure nothrow @nogc @trusted C opCast(C : ThisTemplate!Q, Q)()
if (isImplicitlyConvertible!(immutable(T)*, Q*));

const pure nothrow @nogc @system C opCast(C : ThisTemplate!Q, Q)()
if (isImplicitlyConvertible!(immutable(T)*, Q*) && !isImplicitlyConvertible!(const(T)*, Q*));