|
| Ref () noexcept=default |
| Constructor. Initializes object pointer to nullptr.
|
|
| Ref (std::nullptr_t) noexcept |
| Initializes object pointer to nullptr.
|
|
| Ref (T *ptr) noexcept |
| Initializes object pointer with ptr and retains a reference.
|
|
| Ref (const Ref &other) |
| Initializes object pointer with other and retains a reference.
|
|
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type> |
| Ref (const Ref< D > &other) |
| Initializes object pointer with other and retains a reference.
|
|
| ~Ref () noexcept |
| Releases reference being held (if any).
|
|
T * | operator-> () const noexcept |
| Access pointer.
|
|
T ** | getInitReference () noexcept |
| Access pointer for initialization.
|
|
bool | operator== (const Ref &other) const noexcept |
| Check if two refs are the same.
|
|
bool | operator!= (const Ref &other) const noexcept |
| Check if two refs are not the same.
|
|
Ref & | operator= (const Ref &other) noexcept |
| Assign a strong reference.
|
|
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type> |
Ref & | operator= (const Ref< D > &other) noexcept |
| Assign a strong reference.
|
|
Ref & | operator= (T *ptr) noexcept |
| Assign a raw pointer.
|
|
Ref & | operator= (std::nullptr_t) noexcept |
| Assign a nullptr_t.
|
|
Ref & | assign (T *ptr) noexcept |
| Assign an object. Presumes shared ownership, increases reference count.
|
|
Ref & | acquire (T *ptr) noexcept |
| Acquire ownership of the object.
|
|
Ref & | make_ref (T *ptr) noexcept |
| Create ref without acquiring ownership.
|
|
T * | reset () noexcept |
| Reset reference counted object and assign nullptr to the pointer.
|
|
template<typename S > |
Ref< S > | as () const noexcept |
| Make smart reference with relative type.
|
|
| RefBase () noexcept=default |
| Initializes object pointer to nullptr.
|
|
| RefBase (T *ptr) noexcept |
| Initializes object pointer with ptr.
|
|
| operator T* () const noexcept |
| Get raw object pointer.
|
|
T & | operator* () const noexcept |
| Dereference operator.
|
|
| operator bool () const noexcept |
| Implicit cast to bool.
|
|
bool | operator== (const RefBase &other) const noexcept |
| Check if two refs are the same.
|
|
bool | operator!= (const RefBase &other) const noexcept |
| Check if two refs are not the same.
|
|
bool | isNull () const noexcept |
| Check for nullptr.
|
|
bool | isExpired () const noexcept |
| Check is object is dead.
|
|
bool | isUnique () const noexcept |
| Check if object has only one strong reference.
|
|
T * | get () const noexcept |
| Get current raw object pointer.
|
|
void | set (T *ptr) noexcept |
| Replace object pointer without any checks or reference management.
|
|
template<typename T>
struct fsdk::Ref< T >
Smart pointer for reference counted objects.
Automatically calls retain/release and provides safety assertions.
- Template Parameters
-