Struct 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
Name | Description |
---|---|
this
|
init from T |
Fields
Name | Type | Description |
---|---|---|
_data
|
T |
Properties
Name | Type | Description |
---|---|---|
get
[get]
|
T |
returns object reference (null if not assigned) |
get
[get]
|
const(T) |
returns const reference from const object |
isNull
[get]
|
bool |
returns true if object is not assigned |
refCount
[get]
|
int |
returns counter of references |
Methods
Name | Description |
---|---|
clear
|
clears reference |
opAssign
|
assign from another refcount by reference |
opAssign
|
assign from another refcount by value |
opAssign
|
assign object |
Authors
Vadim Lopatin, coolreader.org@gmail.com
Copyright
Vadim Lopatin, 2014
License
Boost License 1.0