Honeycomb
0.1
Component-Model Framework
|
Point to a shared object without holding a reference. The object is accessible through a lock, which prevents unexpected destruction. More...
#include <SharedPtr.h>
Public Member Functions | |
WeakPtr () | |
WeakPtr (nullptr_t) | |
template<class U > | |
WeakPtr (const SharedPtr< U > &rhs) | |
Must construct from a shared pointer. More... | |
WeakPtr (const WeakPtr &rhs) | |
template<class U > | |
WeakPtr (const WeakPtr< U > &rhs) | |
~WeakPtr () | |
WeakPtr & | operator= (const WeakPtr &rhs) |
template<class U > | |
WeakPtr & | operator= (const WeakPtr< U > &rhs) |
template<class U > | |
WeakPtr & | operator= (const SharedPtr< U > &rhs) |
void | set (nullptr_t) |
Set to null, release reference. More... | |
SharedPtr< T > | lock () const |
Acquire access to object. Shared ptr prevents object from being destroyed while in use. Returns null if object has been destroyed. More... | |
int | refCount () const |
Get strong reference (SharedPtr) count. More... | |
bool | expired () const |
Check whether the object has already been destroyed. More... | |
Friends | |
template<class > | |
class | WeakPtr |
template<class > | |
class | SharedPtr |
Point to a shared object without holding a reference. The object is accessible through a lock, which prevents unexpected destruction.
Weak pointers can be used to break cyclic references.
If an outside user releases a reference to one object that internally is also referenced by its members, then the object will not be destroyed as the user expects. This problem can be solved by replacing internal shared pointers with weak pointers until the cycle is broken.
|
inline |
|
inline |
|
inline |
Must construct from a shared pointer.
|
inline |
|
inline |
|
inline |
|
inline |
Check whether the object has already been destroyed.
|
inline |
Acquire access to object. Shared ptr prevents object from being destroyed while in use. Returns null if object has been destroyed.
|
inline |
|
inline |
|
inline |
|
inline |
Get strong reference (SharedPtr) count.
|
inline |
Set to null, release reference.