Ref

Reference counting support.

Implemented for case when T is RefCountedObject. Similar to shared_ptr in C++. Allows to share object, destroying it when no more references left.

Useful for automatic destroy of objects.

Constructors

this
this(T data)

init from T

Destructor

~this
~this()

decreases counter, and destroys object if no more references left

Postblit

this(this)
this(this)

after blit

Alias This

get

Members

Functions

clear
void clear()

clears reference

opAssign
Ref opAssign(Ref data)

assign from another refcount by reference

opAssign
Ref opAssign(Ref data)

assign from another refcount by value

opAssign
Ref opAssign(T data)

assign object

Properties

get
T get [@property getter]

returns object reference (null if not assigned)

get
const(T) get [@property getter]

returns const reference from const object

isNull
bool isNull [@property getter]

returns true if object is not assigned

refCount
int refCount [@property getter]

returns counter of references

Meta