Ultralight
1.0.0
A fast, lightweight, HTML UI engine for native apps.
|
A non-nullable smart pointer. More...
#include <RefPtr.h>
Public Member Functions | |
~Ref () | |
Destroy Ref (wll decrement ref-count by one) | |
Ref (T &object) | |
Construct Ref from a reference. More... | |
Ref (const Ref &other) | |
Copy constructor. | |
template<typename U > | |
Ref (Ref< U > &other) | |
Copy constructor with internal type conversion. | |
template<typename U > | |
Ref (const Ref< U > &other) | |
Copy constructor with internal type conversion. | |
Ref (Ref &&other) | |
Move constructor. | |
template<typename U > | |
Ref (Ref< U > &&other) | |
Move constructor. | |
const T * | ptr () const |
Get a pointer to wrapped object. | |
T * | ptr () |
Get a pointer to wrapped object. | |
const T & | get () const |
Get a reference to wrapped object. | |
T & | get () |
Get a reference to wrapped object. | |
Friends | |
Ref | AdoptRef (T &) |
Helper for wrapping new objects with the Ref smart pointer. More... | |
A non-nullable smart pointer.
This smart pointer automatically manages the lifetime of a RefCounted object. Also guarantees that the managed instance is not NULL.
|
inline |
|
friend |
Helper for wrapping new objects with the Ref smart pointer.
All ref-counted object are created with an initial ref-count of '1'. The AdoptRef() helper returns a Ref<T> without calling AddRef(). This is used for creating new objects, like so:
Ref<Object> ref = AdoptRef(*new ObjectImpl());