Nebula
|
#include <weakptr.h>
A smart pointer which does not change the reference count of the target object.
Use this to prevent cyclic dependencies between objects. NOTE: The weak ptr only has a subset of methods of Ptr<>.
Public Member Functions | |
WeakPtr () | |
constructor | |
WeakPtr (TYPE *p) | |
construct from C++ pointer | |
WeakPtr (const Ptr< TYPE > &p) | |
construct from Ptr<> pointer | |
WeakPtr (const WeakPtr< TYPE > &p) | |
construct from WeakPtr<> pointer | |
~WeakPtr () | |
destructor | |
void | operator= (const Ptr< TYPE > &rhs) |
assignment operator from Ptr<> | |
void | operator= (const WeakPtr< TYPE > &rhs) |
assignment operator from WeakPtr<> | |
void | operator= (TYPE *rhs) |
assignment operator | |
TYPE * | operator-> () const |
safe -> operator | |
TYPE & | operator* () const |
safe dereference operator | |
operator TYPE * () const | |
safe pointer cast operator | |
bool | isvalid () const |
check if pointer is valid | |
TYPE * | get () const |
return direct pointer (asserts if null pointer) | |
TYPE * | get_unsafe () const |
return direct pointer (returns null pointer) | |
Private Attributes | |
TYPE * | ptr |
construct from Ptr<> pointer
construct from WeakPtr<> pointer
TYPE * WeakPtr< TYPE >::get | ( | ) | const |
return direct pointer (asserts if null pointer)
TYPE * WeakPtr< TYPE >::get_unsafe | ( | ) | const |
return direct pointer (returns null pointer)
bool WeakPtr< TYPE >::isvalid | ( | ) | const |
check if pointer is valid
WeakPtr< TYPE >::operator TYPE * | ( | ) | const |
safe pointer cast operator
TYPE & WeakPtr< TYPE >::operator* | ( | ) | const |
safe dereference operator
TYPE * WeakPtr< TYPE >::operator-> | ( | ) | const |
safe -> operator
assignment operator from Ptr<>
assignment operator from WeakPtr<>
void WeakPtr< TYPE >::operator= | ( | TYPE * | rhs | ) |
assignment operator
|
private |