PointerTo is a template class which implements a smart pointer to an object derived from ReferenceCount. More...
#include "pointerTo.h"
Public Types | |
typedef PointerToBase< T >::To | To |
![]() | |
typedef T | To |
Public Member Functions | |
PointerTo (To *ptr=(To *) NULL) | |
PointerTo (const PointerTo< T > ©) | |
T *& | cheat () |
Returns a reference to the underlying pointer. More... | |
void | clear () |
bool | is_null () const |
operator T * () const | |
We also have the typecast operator to automatically convert PointerTo's to the required kind of actual pointer. More... | |
To & | operator* () const |
To * | operator-> () const |
PointerTo< T > & | operator= (To *ptr) |
PointerTo< T > & | operator= (const PointerTo< T > ©) |
To * | p () const |
Returns an ordinary pointer instead of a PointerTo. More... | |
![]() | |
void | clear () |
A convenient way to set the PointerTo object to NULL. More... | |
void | output (ostream &out) const |
A handy function to output PointerTo's as a hex pointer followed by a reference count. More... | |
![]() | |
size_t | get_hash () const |
bool | is_null () const |
Returns true if the PointerTo is a NULL pointer, false otherwise. More... | |
bool | operator!= (const PointerToVoid &other) const |
bool | operator< (const void *other) const |
bool | operator< (const PointerToVoid &other) const |
bool | operator== (const PointerToVoid &other) const |
void | swap (PointerToVoid &other) NOEXCEPT |
Swaps the contents of this PointerTo with the other, without touching the reference counts. More... | |
PointerTo is a template class which implements a smart pointer to an object derived from ReferenceCount.
Definition at line 79 of file pointerTo.h.
|
inline |
Returns a reference to the underlying pointer.
This is a very unsafe method. It's only used by some interrogate code. If you think this method might be useful to you, you're probably wrong.
Promise me you won't use this, okay?
Definition at line 124 of file pointerTo.I.
|
inline |
We also have the typecast operator to automatically convert PointerTo's to the required kind of actual pointer.
This introduces ambiguities which the compiler will resolve one way or the other, but we don't care which way it goes because either will be correct.
Definition at line 108 of file pointerTo.I.
Returns an ordinary pointer instead of a PointerTo.
Useful to work around compiler problems, particularly for implicit upcasts.
Definition at line 137 of file pointerTo.I.