Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ConstPointerTo< T > Class Template Reference

A ConstPointerTo is similar to a PointerTo, except it keeps a const pointer to the thing. More...

#include <pointerTo.h>

Inheritance diagram for ConstPointerTo< T >:

PointerToBase< T > List of all members.

Public Types

typedef TYPENAME PointerToBase<
T >::To 
To

Public Member Functions

 ConstPointerTo (const To *ptr=(const To *) NULL)
 ConstPointerTo (const PointerTo< T > &copy)
 ConstPointerTo (const ConstPointerTo< T > &copy)
const Tooperator * () const
const Tooperator-> () 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 Top () const
 Returns an ordinary pointer instead of a ConstPointerTo.

ConstPointerTo< T > & operator= (const To *ptr)
ConstPointerTo< T > & operator= (const ConstPointerTo< T > &copy)
ConstPointerTo< T > & operator= (const PointerTo< T > &copy)
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 > &copy)

Protected Attributes

To_ptr

Detailed Description

template<class T>
class ConstPointerTo< T >

A ConstPointerTo is similar to a PointerTo, except it keeps a const pointer to the thing.

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


Member Typedef Documentation

template<class T>
typedef TYPENAME PointerToBase<T>::To ConstPointerTo< T >::To
 

Reimplemented from PointerToBase< T >.

Definition at line 239 of file pointerTo.h.

Referenced by PointerTo< ClientTrackerDevice >::clear().


Constructor & Destructor Documentation

template<class T>
ConstPointerTo< T >::ConstPointerTo const To ptr = (const To *)NULL  )  [inline]
 

Definition at line 538 of file pointerTo.I.

Referenced by PointerTo< ClientTrackerDevice >::clear().

template<class T>
ConstPointerTo< T >::ConstPointerTo const PointerTo< T > &  copy  )  [inline]
 

Definition at line 552 of file pointerTo.I.

References INLINE, and PointerToBase< T >::reassign().

template<class T>
ConstPointerTo< T >::ConstPointerTo const ConstPointerTo< T > &  copy  )  [inline]
 

Definition at line 566 of file pointerTo.I.


Member Function Documentation

template<class T>
void ConstPointerTo< T >::clear  )  [inline]
 

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

template<class T>
bool ConstPointerTo< T >::is_null  )  const [inline]
 

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

template<class T>
const TYPENAME ConstPointerTo< T >::To & ConstPointerTo< T >::operator *  )  const [inline]
 

Definition at line 580 of file pointerTo.I.

Referenced by PointerTo< ClientTrackerDevice >::clear().

template<class T>
ConstPointerTo< T >::operator const TYPENAME PointerToBase< T >::To *  )  const [inline]
 

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.

template<class T>
bool PointerToBase< T >::operator!= const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 279 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator!= To other  )  const [inline, inherited]
 

Definition at line 214 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator!= const To other  )  const [inline, inherited]
 

Definition at line 150 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
const TYPENAME ConstPointerTo< T >::To * ConstPointerTo< T >::operator->  )  const [inline]
 

Definition at line 593 of file pointerTo.I.

Referenced by PointerTo< ClientTrackerDevice >::clear().

template<class T>
bool PointerToBase< T >::operator< const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 345 of file pointerTo.I.

References INLINE.

template<class T>
bool PointerToBase< T >::operator< const To other  )  const [inline, inherited]
 

Definition at line 332 of file pointerTo.I.

References PointerToBase< T >::_ptr, INLINE, NULL, and PointerToBase< T >::To.

template<class T>
bool PointerToBase< T >::operator<= const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 305 of file pointerTo.I.

References PointerToBase< T >::_ptr, INLINE, and NULL.

template<class T>
bool PointerToBase< T >::operator<= To other  )  const [inline, inherited]
 

Definition at line 240 of file pointerTo.I.

References PointerToBase< T >::_ptr.

template<class T>
bool PointerToBase< T >::operator<= const To other  )  const [inline, inherited]
 

Definition at line 176 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
ConstPointerTo< T > & ConstPointerTo< T >::operator= const PointerTo< T > &  copy  )  [inline]
 

Definition at line 677 of file pointerTo.I.

template<class T>
ConstPointerTo< T > & ConstPointerTo< T >::operator= const ConstPointerTo< T > &  copy  )  [inline]
 

Definition at line 663 of file pointerTo.I.

template<class T>
ConstPointerTo< T > & ConstPointerTo< T >::operator= const To ptr  )  [inline]
 

Definition at line 649 of file pointerTo.I.

Referenced by PointerTo< ClientTrackerDevice >::clear().

template<class T>
bool PointerToBase< T >::operator== const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 266 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator== To other  )  const [inline, inherited]
 

Definition at line 201 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator== const To other  )  const [inline, inherited]
 

Definition at line 137 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator> const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 292 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator> To other  )  const [inline, inherited]
 

Definition at line 227 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator> const To other  )  const [inline, inherited]
 

Definition at line 163 of file pointerTo.I.

References PointerToBase< T >::_ptr.

template<class T>
bool PointerToBase< T >::operator>= const PointerToBase< To > &  other  )  const [inline, inherited]
 

Definition at line 318 of file pointerTo.I.

References INLINE, NULL, PointerToBase< T >::reassign(), and PointerToBase< T >::To.

template<class T>
bool PointerToBase< T >::operator>= To other  )  const [inline, inherited]
 

Definition at line 253 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
bool PointerToBase< T >::operator>= const To other  )  const [inline, inherited]
 

Definition at line 189 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
void PointerToBase< T >::output ostream &  out  )  const [inline, inherited]
 

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.

template<class T>
const TYPENAME ConstPointerTo< T >::To * ConstPointerTo< T >::p  )  const [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().

template<class T>
void PointerToBase< T >::reassign const PointerToBase< To > &  copy  )  [inline, protected, inherited]
 

Definition at line 122 of file pointerTo.I.

References PointerToBase< T >::_ptr, and INLINE.

template<class T>
void PointerToBase< T >::reassign To ptr  )  [protected, inherited]
 

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


Member Data Documentation

template<class T>
To* PointerToBase< T >::_ptr [protected, inherited]
 

Definition at line 110 of file pointerTo.h.

Referenced by PointerToBase< T >::clear(), PointerToBase< T >::is_null(), PointerTo< T >::operator TYPENAME PointerToBase(), PointerToBase< T >::operator!=(), PointerToBase< T >::operator<(), PointerToBase< T >::operator<=(), PointerTo< T >::operator=(), PointerToBase< T >::operator==(), PointerToBase< T >::operator>(), PointerToBase< T >::operator>=(), PointerToBase< T >::output(), PointerToBase< T >::PointerToBase(), PointerToBase< T >::reassign(), and PointerToBase< T >::~PointerToBase().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:50 2003 for Panda by doxygen1.3