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* allocator;
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 initialise = true, bool deallocate = true);
template CommonRCImpl()
this(typeof(null));
ref scope auto opAssign(typeof(null)) return;
ref scope @trusted auto opAssign(return typeof(this) rhs) return;
pure nothrow @nogc ref scope @trusted auto opAssign(Q)(return ThisTemplate!Q rhs) return
if (isImplicitlyConvertible!(Q*, T*));
const nothrow @nogc @property scope @trusted ThisTemplate!(const(T)) lightConst()() return;

immutable nothrow @nogc @property scope @trusted ThisTemplate!(immutable(T)) lightImmutable()() return;
const pure nothrow @nogc @property scope @trusted size_t _counter();
const bool opCast(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 @property scope @safe bool opEquals(typeof(null));

const pure nothrow @nogc @property scope @safe bool opEquals(Y)(auto ref scope const ThisTemplate!Y rhs);
const pure nothrow @nogc @property scope @trusted sizediff_t opCmp(Y)(auto ref scope const ThisTemplate!Y rhs);