This class implements an intrusive pointer. More...
#include <Radiant/IntrusivePtr.hpp>
Public Types | |
| typedef T | element_type |
| Type of the object pointed to. | |
Public Member Functions | |
| bool | boolean_test () const |
| Used to implemented the safe-bool idiom for intrusive pointers. More... | |
| const IntrusivePtrCounter * | counter () const |
| template<typename Y > | |
| IntrusivePtr< Y > | dynamic_pointer_cast () const |
| Perform a dynamic_cast to another intrusive pointer type. More... | |
| IntrusivePtr () | |
| Constructor for null pointer. | |
| IntrusivePtr (T *ptr) | |
| Construct a new intrusive pointer to the given object. More... | |
| IntrusivePtr (const IntrusivePtr< T > &iptr) | |
| Construct a copy of an intrusive pointer. More... | |
| template<typename Y > | |
| IntrusivePtr (const IntrusivePtr< Y > &iptr) | |
| Construct a copy of an intrusive pointer. More... | |
| IntrusivePtr (IntrusivePtr< T > &&iptr) | |
| A move constructor for intrusive pointers. More... | |
| template<typename Y > | |
| IntrusivePtr (IntrusivePtr< Y > &&iptr) | |
| A move constructor for intrusive pointers. More... | |
| template<typename Y > | |
| IntrusivePtr (const IntrusiveWeakPtr< Y > &wptr) | |
| Construct an intrusive pointer from instrusive weak pointer. More... | |
| bool | operator! () const |
| Check if the intrusive pointer is null. More... | |
| template<typename Y > | |
| bool | operator!= (const IntrusivePtr< Y > &rhs) const |
| Compare if two intrusive pointers are inequal. More... | |
| template<typename Y > | |
| bool | operator!= (const IntrusiveWeakPtr< Y > &rhs) const |
| Compare if intrusive pointer is inequal to the given intrusive weak pointer. More... | |
| bool | operator!= (nullptr_t) const |
| Compare if the intrusive pointer is inequal to nullptr. More... | |
| template<typename Y > | |
| bool | operator!= (const Y *rhs) const |
| Compare if the intrusive pointer is inequal to the given raw pointer. More... | |
| T & | operator* () const |
| Convert the intrusive pointer to raw pointer. More... | |
| T * | operator-> () const |
| Dereference the intrusive pointer. More... | |
| template<typename Y > | |
| bool | operator< (const IntrusivePtr< Y > &rhs) const |
| Compare the order of two intrusive pointers. More... | |
| template<typename Y > | |
| bool | operator< (const Y *rhs) const |
| Compare the intrusive pointer to a raw pointer. More... | |
| template<typename Y > | |
| IntrusivePtr< T > & | operator= (const IntrusivePtr< Y > &iptr) |
| Assign an intrusive pointer. More... | |
| IntrusivePtr< T > & | operator= (const IntrusivePtr< T > &iptr) |
| Assign an intrusive pointer. More... | |
| IntrusivePtr< T > & | operator= (IntrusivePtr< T > &&iptr) |
| Move an intrusive pointer. More... | |
| template<typename Y > | |
| IntrusivePtr< T > & | operator= (IntrusivePtr< Y > &&iptr) |
| Move an intrusive pointer. More... | |
| IntrusivePtr< T > & | operator= (T *ptr) |
| Assign a raw pointer to the intrusive pointer. More... | |
| template<typename Y > | |
| bool | operator== (const IntrusivePtr< Y > &rhs) const |
| Compare if two intrusive pointers are equal. More... | |
| template<typename Y > | |
| bool | operator== (const IntrusiveWeakPtr< Y > &rhs) const |
| Compare if intrusive pointer is equal to the given intrusive weak pointer. More... | |
| template<typename Y > | |
| bool | operator== (const Y *rhs) const |
| Compare if the intrusive pointer is equal to the given raw pointer. More... | |
| bool | operator== (nullptr_t) const |
| Compare if the intrusive pointer is equal to nullptr. More... | |
| template<typename Y > | |
| void | reset (Y *ptr) |
| Reset the intrusive pointer to given object. More... | |
| void | reset () |
| Reset the intrusive pointer to nullptr. | |
| template<typename Y > | |
| IntrusivePtr< Y > | static_pointer_cast () const |
| Perform static_cast to another intrusive pointer type. More... | |
| IntrusiveWeakPtr< T > | weak () const |
| Shortcut for creating weak pointer from this. | |
| ~IntrusivePtr () | |
| Destructor. | |
Friends | |
| template<typename Y > | |
| class | IntrusivePtr |
| template<typename Y > | |
| class | IntrusiveWeakPtr |
This class implements an intrusive pointer.
Intrusive pointer is a light version of a shared pointer. The dynamically allocated object the pointer points to handles the reference counter. Thus the reference count is stored in a single location and the pointer size is kept to a minimum. In case of Cornerstone it also makes it possible to share objects between C++ and JavaScript.
|
inline |
Construct a new intrusive pointer to the given object.
| ptr | pointer to the object |
|
inline |
Construct a copy of an intrusive pointer.
| iptr | intrusive pointer to copy |
|
inline |
Construct a copy of an intrusive pointer.
| iptr | intrusive pointer to copy |
| Y | Type of the object pointed by parameter pointer |
|
inline |
A move constructor for intrusive pointers.
| iptr | intrusive pointer to move |
|
inline |
A move constructor for intrusive pointers.
| iptr | intrusive pointer to move |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Construct an intrusive pointer from instrusive weak pointer.
| wptr | weak pointer to construct from |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Used to implemented the safe-bool idiom for intrusive pointers.
|
inline |
|
inline |
Perform a dynamic_cast to another intrusive pointer type.
| Y | Type of the object pointed by pointer returned |
|
inline |
Check if the intrusive pointer is null.
|
inline |
Compare if two intrusive pointers are inequal.
| rhs | intrusive pointer to compare |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Compare if intrusive pointer is inequal to the given intrusive weak pointer.
| rhs | intrusive weak pointer to compare |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Compare if the intrusive pointer is inequal to nullptr.
|
inline |
Compare if the intrusive pointer is inequal to the given raw pointer.
| rhs | raw pointer to compare to |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Convert the intrusive pointer to raw pointer.
|
inline |
Dereference the intrusive pointer.
|
inline |
Compare the order of two intrusive pointers.
| rhs | intrusive pointer to compare |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Compare the intrusive pointer to a raw pointer.
| rhs | raw pointer to compare |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Assign an intrusive pointer.
| iptr | intrusive pointer to assign |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Assign an intrusive pointer.
| iptr | intrusive pointer to assign |
|
inline |
Move an intrusive pointer.
| iptr | intrusive pointer to move |
|
inline |
Move an intrusive pointer.
| iptr | intrusive pointer to move |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Assign a raw pointer to the intrusive pointer.
| ptr | raw pointer to assign |
|
inline |
Compare if two intrusive pointers are equal.
| rhs | intrusive pointer to compare |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Compare if intrusive pointer is equal to the given intrusive weak pointer.
| rhs | intrusive weak pointer to compare |
|
inline |
Compare if the intrusive pointer is equal to the given raw pointer.
| rhs | raw pointer to compare to |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Compare if the intrusive pointer is equal to nullptr.
Reset the intrusive pointer to given object.
| ptr | object to reset the pointer to |
| Y | Type of the object pointed by parameter pointer |
|
inline |
Perform static_cast to another intrusive pointer type.
| Y | Type of the object pointed by pointer returned |