cesium-native 0.48.0
|
A smart pointer that calls addReference
and releaseReference
on the controlled object.
More...
#include <CesiumUtility/IntrusivePointer.h>
Public Member Functions | |
IntrusivePointer (T *p=nullptr) noexcept | |
Default constructor. | |
IntrusivePointer (const IntrusivePointer< T > &rhs) noexcept | |
Copy constructor. | |
template<class U> | |
IntrusivePointer (const IntrusivePointer< U > &rhs) noexcept | |
Implicit conversion to a pointer to a base (or otherwise convertible) type. | |
IntrusivePointer (IntrusivePointer< T > &&rhs) noexcept | |
Move constructor. | |
template<class U> | |
IntrusivePointer (IntrusivePointer< U > &&rhs) noexcept | |
Implicit conversion of an r-value to a pointer to a base (or otherwise convertible) type. | |
~IntrusivePointer () noexcept | |
Default destructor. | |
template<typename... ConstructorArgumentTypes> | |
T & | emplace (ConstructorArgumentTypes &&... constructorArguments) |
Constructs a new instance and assigns it to this IntrusivePointer. If this IntrusivePointer already points to another instance, releaseReference is called on it. | |
void | reset () |
Reset this pointer to nullptr. | |
IntrusivePointer & | operator= (const IntrusivePointer &rhs) noexcept |
Assignment operator. | |
template<class U> | |
IntrusivePointer & | operator= (const IntrusivePointer< U > &rhs) noexcept |
Assigns an IntrusivePointer of another type to this IntrusivePointer. | |
IntrusivePointer & | operator= (IntrusivePointer &&rhs) noexcept |
Move assignment operator. | |
IntrusivePointer & | operator= (T *p) noexcept |
Assignment operator. | |
T & | operator* () const noexcept |
Dereferencing operator. | |
T * | operator-> () const noexcept |
Arrow operator. | |
operator bool () const noexcept | |
Implicit conversion to bool , being true iff this is not the nullptr . | |
T * | get () const noexcept |
Returns the internal pointer. | |
bool | operator== (const IntrusivePointer< T > &rhs) const noexcept |
Returns true if two pointers are equal. | |
template<class U> | |
bool | operator== (const IntrusivePointer< U > &rhs) const noexcept |
Returns true if two pointers are equal. | |
bool | operator!= (const IntrusivePointer< T > &rhs) const noexcept |
Returns true if two pointers are not equal. | |
template<class U> | |
bool | operator!= (const IntrusivePointer< U > &rhs) const noexcept |
Returns true if two pointers are not equal. | |
bool | operator== (const T *pRhs) const noexcept |
Returns true if the contents of this pointer is equal to the given pointer. | |
bool | operator!= (const T *pRhs) const noexcept |
Returns true if the contents of this pointer is not equal to the given pointer. | |
A smart pointer that calls addReference
and releaseReference
on the controlled object.
Please note that the thread-safety of this type is entirely dependent on the implementation of addReference
and releaseReference
. If these methods are not thread safe on a particular type - which is common for objects that are not meant to be used from multiple threads simultaneously - then using an IntrusivePointer
from multiple threads is also unsafe.
T | The type of object controlled. |
Definition at line 21 of file IntrusivePointer.h.
|
inlinenoexcept |
Default constructor.
Definition at line 26 of file IntrusivePointer.h.
|
inlinenoexcept |
Copy constructor.
Definition at line 31 of file IntrusivePointer.h.
|
inlinenoexcept |
Implicit conversion to a pointer to a base (or otherwise convertible) type.
U | The new type, usually a base class. |
rhs | The pointer. |
Definition at line 43 of file IntrusivePointer.h.
|
inlinenoexcept |
Move constructor.
Definition at line 50 of file IntrusivePointer.h.
|
inlinenoexcept |
Implicit conversion of an r-value to a pointer to a base (or otherwise convertible) type.
U | The new type, usually a base class. |
rhs | The pointer. |
Definition at line 63 of file IntrusivePointer.h.
|
inlinenoexcept |
Default destructor.
Definition at line 71 of file IntrusivePointer.h.
|
inline |
Constructs a new instance and assigns it to this IntrusivePointer. If this IntrusivePointer already points to another instance, releaseReference
is called on it.
constructorArguments | The arguments to the constructor to create the new instance. |
Definition at line 83 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns the internal pointer.
Definition at line 181 of file IntrusivePointer.h.
|
inlineexplicitnoexcept |
Implicit conversion to bool
, being true
iff this is not the nullptr
.
Definition at line 176 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if two pointers are not equal.
Definition at line 199 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if two pointers are not equal.
Definition at line 207 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if the contents of this pointer is not equal to the given pointer.
Definition at line 221 of file IntrusivePointer.h.
|
inlinenoexcept |
Dereferencing operator.
Definition at line 165 of file IntrusivePointer.h.
|
inlinenoexcept |
Arrow operator.
Definition at line 170 of file IntrusivePointer.h.
|
inlinenoexcept |
Assignment operator.
Definition at line 98 of file IntrusivePointer.h.
|
inlinenoexcept |
Assigns an IntrusivePointer of another type to this IntrusivePointer.
Definition at line 118 of file IntrusivePointer.h.
|
inlinenoexcept |
Move assignment operator.
Definition at line 136 of file IntrusivePointer.h.
|
inlinenoexcept |
Assignment operator.
Definition at line 147 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if two pointers are equal.
Definition at line 186 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if two pointers are equal.
Definition at line 192 of file IntrusivePointer.h.
|
inlinenoexcept |
Returns true
if the contents of this pointer is equal to the given pointer.
Definition at line 215 of file IntrusivePointer.h.
|
inline |
Reset this pointer to nullptr.
Definition at line 92 of file IntrusivePointer.h.
Definition at line 237 of file IntrusivePointer.h.