This class implements weak pointers for the IntrusivePtr class. More...
#include <Radiant/IntrusivePtr.hpp>
Public Types | |
| typedef T | element_type |
| Type of the object pointed to. | |
Public Member Functions | |
| const IntrusivePtrCounter * | counter () const |
| IntrusiveWeakPtr () | |
| Null constructor. | |
| template<typename Y > | |
| IntrusiveWeakPtr (Y *ptr) | |
| Construct a weak pointer from the given raw pointer. More... | |
| template<typename Y > | |
| IntrusiveWeakPtr (const IntrusivePtr< Y > &iptr) | |
| Construct an intrusive weak pointer from the given intrusive pointer. More... | |
| IntrusiveWeakPtr (const IntrusiveWeakPtr< T > &wptr) | |
| Construct a copy of the given weak pointer. More... | |
| template<typename Y > | |
| IntrusiveWeakPtr (const IntrusiveWeakPtr< Y > &wptr) | |
| Construct a copy of the given intrusive weak pointer. More... | |
| IntrusiveWeakPtr (IntrusiveWeakPtr< T > &&wptr) | |
| Move the given weak pointer. More... | |
| template<typename Y > | |
| IntrusiveWeakPtr (IntrusiveWeakPtr< Y > &&wptr) | |
| Move the given weak pointer. More... | |
| template<typename Y > | |
| IntrusivePtr< Y > | lock () const |
| Convert the intrusive weak pointer to intrusive pointer. More... | |
| IntrusivePtr< T > | lock () const |
| Convert the intrusive weak pointer to intrusive pointer. More... | |
| template<typename Y > | |
| bool | operator!= (const IntrusiveWeakPtr< Y > &rhs) const |
| Compare if two intrusive weak pointers are inequal. More... | |
| template<typename Y > | |
| bool | operator< (const IntrusiveWeakPtr< Y > &rhs) const |
| Compare two intrusive weak pointers. More... | |
| IntrusiveWeakPtr & | operator= (const IntrusiveWeakPtr< T > &wptr) |
| Assign the given intrusive weak pointer. More... | |
| template<typename Y > | |
| IntrusiveWeakPtr & | operator= (const IntrusiveWeakPtr< Y > &wptr) |
| Assign the given intrusive weak pointer. More... | |
| IntrusiveWeakPtr & | operator= (IntrusiveWeakPtr< T > &&wptr) |
| Move the given intrusive weak pointer. More... | |
| template<typename Y > | |
| IntrusiveWeakPtr & | operator= (IntrusiveWeakPtr< Y > &&wptr) |
| Move the given intrusive weak pointer. More... | |
| template<typename Y > | |
| bool | operator== (const IntrusiveWeakPtr< Y > &rhs) const |
| Compare if two intrusive weak pointers are equal. More... | |
| void | reset () |
| Reset the intrusive weak pointer to nullptr. | |
| ~IntrusiveWeakPtr () | |
| Destructor. | |
Friends | |
| template<typename Y > | |
| class | IntrusivePtr |
| template<typename Y > | |
| class | IntrusiveWeakPtr |
This class implements weak pointers for the IntrusivePtr class.
The weak associated to an intrusive pointer. Whenever the contents of the weak pointer are accessed, it must be converted to an intrusive pointer with the lock() method or a special constructor. If the intrusive pointer associated with this weak pointer is released, the conversion will fail and an intrusive pointer to nullptr is returned. In order to use intrusive pointers with custom objects, a single function intrusivePtrGetCounter must be defined for the wrapped object type.
|
inlineexplicit |
Construct a weak pointer from the given raw pointer.
| ptr | raw pointer to construct from |
| Y | Type of the object whose pointer is stored in this pointer |
| Radiant::IntrusiveWeakPtr< T >::IntrusiveWeakPtr | ( | const IntrusivePtr< Y > & | iptr | ) |
Construct an intrusive weak pointer from the given intrusive pointer.
| iptr | intrusive pointer to convert from |
| Y | Type of the object whose pointer is stored in this pointer |
|
inline |
Construct a copy of the given weak pointer.
| wptr | weak pointer to copy |
|
inline |
Construct a copy of the given intrusive weak pointer.
| wptr | weak pointer to copy |
| Y | Type of the object whose pointer is stored in this pointer |
|
inline |
Move the given weak pointer.
| wptr | weak pointer to move |
|
inline |
Move the given weak pointer.
| wptr | weak pointer to move |
| Y | Type of the object whose pointer is stored in this pointer |
|
inline |
| IntrusivePtr< Y > Radiant::IntrusiveWeakPtr< T >::lock | ( | ) | const |
Convert the intrusive weak pointer to intrusive pointer.
This function will return an intrusive pointer to the object pointed by this intrusive weak pointer. If the object has been released an intrusive pointer to nullptr is returned.
| Y | Type of the object that is pointed to by return value |
| IntrusivePtr< T > Radiant::IntrusiveWeakPtr< T >::lock | ( | ) | const |
Convert the intrusive weak pointer to intrusive pointer.
This function will return an intrusive pointer to the object pointed by this intrusive weak pointer. If the object has been released an intrusive pointer to nullptr is returned.
|
inline |
Compare if two intrusive weak pointers are inequal.
| rhs | intrusive weak pointer to compare |
| Type | of the object pointed by parameter pointer |
|
inline |
Compare two intrusive weak pointers.
| rhs | intrusive weak pointer to compare |
| Type | of the object pointed by parameter pointer |
|
inline |
Assign the given intrusive weak pointer.
| wptr | intrusive weak pointer to assign |
|
inline |
Assign the given intrusive weak pointer.
| wptr | intrusive weak pointer to assign |
| Y | Type of the object whose pointer is stored in this pointer |
|
inline |
Move the given intrusive weak pointer.
| wptr | intrusive weak pointer to move |
|
inline |
Move the given intrusive weak pointer.
| wptr | intrusive weak pointer to move |
| Y | Type of the object whose pointer is stored in this pointer |
|
inline |
Compare if two intrusive weak pointers are equal.
| rhs | intrusive weak pointer to compare |
| Type | of the object pointed by parameter pointer |