The Nebula Device 3: WeakPtr< TYPE > Class Template Reference

The Nebula Device 3

WeakPtr< TYPE > Class Template Reference

#include <weakptr.h>


Detailed Description

template<class TYPE>
class WeakPtr< TYPE >

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<>.

(C) 2008 Radon Labs GmbH


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)