#include <pointerTo.h>
Inheritance diagram for ConstPointerTo< T >:
Public Types | |
typedef TYPENAME PointerToBase< T >::To | To |
Public Member Functions | |
ConstPointerTo (const To *ptr=(const To *) NULL) | |
ConstPointerTo (const PointerTo< T > ©) | |
ConstPointerTo (const ConstPointerTo< T > ©) | |
const To & | operator * () const |
const To * | operator-> () const |
operator const TYPENAME PointerToBase () const | |
We also have the typecast operator to automatically convert ConstPointerTo's to the required kind of actual pointer. | |
const To * | p () const |
Returns an ordinary pointer instead of a ConstPointerTo. | |
ConstPointerTo< T > & | operator= (const To *ptr) |
ConstPointerTo< T > & | operator= (const ConstPointerTo< T > ©) |
ConstPointerTo< T > & | operator= (const PointerTo< T > ©) |
bool | is_null () const |
Returns true if the PointerTo is a NULL pointer, false otherwise. | |
void | clear () |
A convenient way to set the PointerTo object to NULL. | |
bool | operator== (const To *other) const |
bool | operator== (To *other) const |
bool | operator== (const PointerToBase< To > &other) const |
bool | operator!= (const To *other) const |
bool | operator!= (To *other) const |
bool | operator!= (const PointerToBase< To > &other) const |
bool | operator> (const To *other) const |
bool | operator> (To *other) const |
bool | operator> (const PointerToBase< To > &other) const |
bool | operator<= (const To *other) const |
bool | operator<= (To *other) const |
bool | operator<= (const PointerToBase< To > &other) const |
bool | operator>= (const To *other) const |
bool | operator>= (To *other) const |
bool | operator>= (const PointerToBase< To > &other) const |
bool | operator< (const To *other) const |
bool | operator< (const PointerToBase< To > &other) const |
void | output (ostream &out) const |
A handy function to output PointerTo's as a hex pointer followed by a reference count. | |
Protected Member Functions | |
void | reassign (To *ptr) |
This is the main work of the PointerTo family. | |
void | reassign (const PointerToBase< To > ©) |
Protected Attributes | |
To * | _ptr |
(Actually, it keeps a non-const pointer, because it must be allowed to adjust the reference counts, and it must be able to delete it when the reference count goes to zero. But it presents only a const pointer to the outside world.)
Notice that a PointerTo may be assigned to a ConstPointerTo, but a ConstPointerTo may not be assigned to a PointerTo.
Definition at line 237 of file pointerTo.h.
|
Reimplemented from PointerToBase< T >. Definition at line 239 of file pointerTo.h. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 538 of file pointerTo.I. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 552 of file pointerTo.I. References INLINE, and PointerToBase< T >::reassign(). |
|
Definition at line 566 of file pointerTo.I. |
|
A convenient way to set the PointerTo object to NULL. (Assignment to a NULL pointer also works, of course.) Reimplemented from PointerToBase< T >. Definition at line 262 of file pointerTo.h. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct comparison to a NULL pointer also works.) Reimplemented from PointerToBase< T >. Definition at line 261 of file pointerTo.h. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 580 of file pointerTo.I. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
We also have the typecast operator to automatically convert ConstPointerTo'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 618 of file pointerTo.I. |
|
Definition at line 279 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 214 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 150 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 593 of file pointerTo.I. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 345 of file pointerTo.I. References INLINE. |
|
Definition at line 332 of file pointerTo.I. References PointerToBase< T >::_ptr, INLINE, NULL, and PointerToBase< T >::To. |
|
Definition at line 305 of file pointerTo.I. References PointerToBase< T >::_ptr, INLINE, and NULL. |
|
Definition at line 240 of file pointerTo.I. References PointerToBase< T >::_ptr. |
|
Definition at line 176 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 677 of file pointerTo.I. |
|
Definition at line 663 of file pointerTo.I. |
|
Definition at line 649 of file pointerTo.I. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 266 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 201 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 137 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 292 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 227 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 163 of file pointerTo.I. References PointerToBase< T >::_ptr. |
|
Definition at line 318 of file pointerTo.I. References INLINE, NULL, PointerToBase< T >::reassign(), and PointerToBase< T >::To. |
|
Definition at line 253 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Definition at line 189 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
A handy function to output PointerTo's as a hex pointer followed by a reference count.
Definition at line 399 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
Returns an ordinary pointer instead of a ConstPointerTo. Useful to work around compiler problems, particularly for implicit upcasts. Definition at line 636 of file pointerTo.I. Referenced by PointerTo< ClientTrackerDevice >::clear(). |
|
Definition at line 122 of file pointerTo.I. References PointerToBase< T >::_ptr, and INLINE. |
|
This is the main work of the PointerTo family. When the pointer is reassigned, decrement the old reference count and increment the new one. Definition at line 78 of file pointerTo.I. Referenced by ConstPointerTo< T >::ConstPointerTo(), PointerToBase< T >::operator>=(), PointerTo< T >::PointerTo(), and PointerToBase< T >::PointerToBase(). |
|