MT Core (C++)
Core library for replacing C++ standard in project usage
|
Thread-local weak reference counted pointer Not thread safe, don't share Does not hold lifetime. More...
#include <rc.hpp>
Public Member Functions | |
Result< Rc< T >, RcError > | obtain (Allocator &alloc) |
Tries to obtain a strong reference May error if could not obtain (e.g. | |
void | deinit (Allocator &alloc) |
Deinitializes a weak pointer Will decrement weak count and may clean up counter. | |
bool | valid () const |
Checks if weak reference is valid. | |
operator bool () const | |
Checks if weak reference is valid. | |
Result< WeakRc, RcError > | copy () |
Tries to copy a weak reference. | |
Public Attributes | |
impl::ThreadLocalRefCount< T > * | rc = nullptr |
Thread-local weak reference counted pointer Not thread safe, don't share Does not hold lifetime.
May try to obtain lifetime with "obtain(alloc)"
T | Type pointed to |
|
inline |
Tries to copy a weak reference.
Definition at line 145 of file rc.hpp.
|
inline |
Result< Rc< T >, RcError > mtcore::WeakRc< T >::obtain | ( | Allocator & | alloc | ) |
|
inlinenodiscard |
|
inlinenodiscard |
impl::ThreadLocalRefCount<T>* mtcore::WeakRc< T >::rc = nullptr |