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

ConstPointerToArray< Element > Class Template Reference

Similar to PointerToArray, except that its contents may not be modified. More...

#include <pointerToArray.h>

Inheritance diagram for ConstPointerToArray< Element >:

PointerToBase< RefCountObj< pvector< Element > > > List of all members.

Public Types

typedef TYPENAME pvector<
Element >::value_type 
value_type
typedef TYPENAME pvector<
Element >::const_reference 
reference
typedef TYPENAME pvector<
Element >::const_reference 
const_reference
typedef TYPENAME pvector<
Element >::const_iterator 
iterator
typedef TYPENAME pvector<
Element >::const_iterator 
const_iterator
typedef TYPENAME pvector<
Element >::const_reverse_iterator 
reverse_iterator
typedef TYPENAME pvector<
Element >::const_reverse_iterator 
const_reverse_iterator
typedef TYPENAME pvector<
Element >::difference_type 
difference_type
typedef TYPENAME pvector<
Element >::size_type 
size_type
typedef RefCountObj< pvector<
Element > > 
To

Public Member Functions

 ConstPointerToArray ()
 ConstPointerToArray (const PointerToArray< Element > &copy)
 ConstPointerToArray (const ConstPointerToArray< Element > &copy)
iterator begin () const
iterator end () const
TYPENAME ConstPointerToArray<
Element >::reverse_iterator 
rbegin () const
TYPENAME ConstPointerToArray<
Element >::reverse_iterator 
rend () const
size_type size () const
size_type max_size () const
bool empty () const
size_type capacity () const
reference operator[] (size_type n) const
reference operator[] (int n) const
reference front () const
reference back () const
 operator const Element * () const
 The pointer typecast operator is convenient for maintaining the fiction that we actually have a C-style array.

const Element * p () const
 Function p() is similar to the function from ConstPointerTo.

const pvector< Element > & v () const
 To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality.

int get_ref_count () const
 Returns the reference count of the underlying vector.

ConstPointerToArray< Element > & operator= (RefCountObj< pvector< Element > > *ptr)
ConstPointerToArray< Element > & operator= (const PointerToArray< Element > &copy)
ConstPointerToArray< Element > & operator= (const ConstPointerToArray< Element > &copy)
void clear ()
 To empty the PTA, use the clear() method, since assignment to NULL is problematic (given the ambiguity of the pointer type of 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
bool is_null () const
void output (ostream &out) const

Protected Member Functions

void reassign (To *ptr)
void reassign (const PointerToBase< To > &copy)

Protected Attributes

To_ptr

Static Private Attributes

pvector< Element > _empty_array

Detailed Description

template<class Element>
class ConstPointerToArray< Element >

Similar to PointerToArray, except that its contents may not be modified.

Definition at line 214 of file pointerToArray.h.


Member Typedef Documentation

template<class Element>
typedef TYPENAME pvector<Element>::const_iterator ConstPointerToArray< Element >::const_iterator
 

Definition at line 220 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::const_reference ConstPointerToArray< Element >::const_reference
 

Definition at line 218 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::const_reverse_iterator ConstPointerToArray< Element >::const_reverse_iterator
 

Definition at line 227 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::difference_type ConstPointerToArray< Element >::difference_type
 

Definition at line 228 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::const_iterator ConstPointerToArray< Element >::iterator
 

Definition at line 219 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::const_reference ConstPointerToArray< Element >::reference
 

Definition at line 217 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::const_reverse_iterator ConstPointerToArray< Element >::reverse_iterator
 

Definition at line 225 of file pointerToArray.h.

template<class Element>
typedef TYPENAME pvector<Element>::size_type ConstPointerToArray< Element >::size_type
 

Definition at line 229 of file pointerToArray.h.

typedef RefCountObj< pvector< Element > > PointerToBase< RefCountObj< pvector< Element > > >::To [inherited]
 

Definition at line 99 of file pointerTo.h.

template<class Element>
typedef TYPENAME pvector<Element>::value_type ConstPointerToArray< Element >::value_type
 

Definition at line 216 of file pointerToArray.h.


Constructor & Destructor Documentation

template<class Element>
ConstPointerToArray< Element >::ConstPointerToArray  )  [inline]
 

Definition at line 574 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME.

template<class Element>
ConstPointerToArray< Element >::ConstPointerToArray const PointerToArray< Element > &  copy  )  [inline]
 

Definition at line 588 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, nassertd, and NULL.

template<class Element>
ConstPointerToArray< Element >::ConstPointerToArray const ConstPointerToArray< Element > &  copy  )  [inline]
 

Definition at line 602 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, and NULL.


Member Function Documentation

template<class Element>
TYPENAME ConstPointerToArray< Element >::reference ConstPointerToArray< Element >::back  )  const [inline]
 

Definition at line 792 of file pointerToArray.I.

template<class Element>
TYPENAME ConstPointerToArray< Element >::iterator ConstPointerToArray< Element >::begin  )  const [inline]
 

Definition at line 616 of file pointerToArray.I.

template<class Element>
TYPENAME ConstPointerToArray< Element >::size_type ConstPointerToArray< Element >::capacity  )  const [inline]
 

Definition at line 722 of file pointerToArray.I.

template<class Element>
void ConstPointerToArray< Element >::clear  )  [inline]
 

To empty the PTA, use the clear() method, since assignment to NULL is problematic (given the ambiguity of the pointer type of NULL).

Reimplemented from PointerToBase< RefCountObj< pvector< Element > > >.

Definition at line 931 of file pointerToArray.I.

template<class Element>
bool ConstPointerToArray< Element >::empty  )  const [inline]
 

Definition at line 709 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, and NULL.

template<class Element>
TYPENAME ConstPointerToArray< Element >::iterator ConstPointerToArray< Element >::end  )  const [inline]
 

Definition at line 632 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr.

template<class Element>
TYPENAME ConstPointerToArray< Element >::reference ConstPointerToArray< Element >::front  )  const [inline]
 

Definition at line 773 of file pointerToArray.I.

template<class Element>
int ConstPointerToArray< Element >::get_ref_count  )  const [inline]
 

Returns the reference count of the underlying vector.

Definition at line 871 of file pointerToArray.I.

bool PointerToBase< RefCountObj< pvector< Element > > >::is_null  )  const [inline, inherited]
 

Returns true if the PointerTo is a NULL pointer, false otherwise.

(Direct comparison to a NULL pointer also works.)

template<class Element>
TYPENAME ConstPointerToArray< Element >::size_type ConstPointerToArray< Element >::max_size  )  const [inline]
 

Definition at line 693 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and NULL.

template<class Element>
ConstPointerToArray< Element >::operator const Element *  )  const [inline]
 

The pointer typecast operator is convenient for maintaining the fiction that we actually have a C-style array.

It returns the address of the first element in the array, unless the pointer is unassigned, in which case it returns NULL.

Definition at line 820 of file pointerToArray.I.

bool PointerToBase< RefCountObj< pvector< Element > > >::operator!= const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator!= To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator!= const To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator< const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator< const To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator<= const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator<= To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator<= const To other  )  const [inline, inherited]
 

template<class Element>
ConstPointerToArray< Element > & ConstPointerToArray< Element >::operator= const ConstPointerToArray< Element > &  copy  )  [inline]
 

Definition at line 912 of file pointerToArray.I.

template<class Element>
ConstPointerToArray< Element > & ConstPointerToArray< Element >::operator= const PointerToArray< Element > &  copy  )  [inline]
 

Definition at line 898 of file pointerToArray.I.

template<class Element>
ConstPointerToArray< Element > & ConstPointerToArray< Element >::operator= RefCountObj< pvector< Element > > *  ptr  )  [inline]
 

Definition at line 884 of file pointerToArray.I.

bool PointerToBase< RefCountObj< pvector< Element > > >::operator== const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator== To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator== const To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator> const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator> To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator> const To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator>= const PointerToBase< To > &  other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator>= To other  )  const [inline, inherited]
 

bool PointerToBase< RefCountObj< pvector< Element > > >::operator>= const To other  )  const [inline, inherited]
 

template<class Element>
TYPENAME ConstPointerToArray< Element >::reference ConstPointerToArray< Element >::operator[] int  n  )  const [inline]
 

Definition at line 759 of file pointerToArray.I.

template<class Element>
TYPENAME ConstPointerToArray< Element >::reference ConstPointerToArray< Element >::operator[] size_type  n  )  const [inline]
 

Definition at line 739 of file pointerToArray.I.

References INLINE, and PointerToBase< RefCountObj< pvector< Element > > >::reassign().

void PointerToBase< RefCountObj< pvector< Element > > >::output ostream &  out  )  const [inherited]
 

A handy function to output PointerTo's as a hex pointer followed by a reference count.

template<class Element>
const Element * ConstPointerToArray< Element >::p  )  const [inline]
 

Function p() is similar to the function from ConstPointerTo.

It does the same thing: it returns the same thing as the typecast operator, above.

Definition at line 838 of file pointerToArray.I.

template<class Element>
TYPENAME ConstPointerToArray< Element >::reverse_iterator ConstPointerToArray< Element >::rbegin  )  const [inline]
 

Definition at line 648 of file pointerToArray.I.

void PointerToBase< RefCountObj< pvector< Element > > >::reassign const PointerToBase< To > &  copy  )  [inline, protected, inherited]
 

void PointerToBase< RefCountObj< pvector< Element > > >::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.

Referenced by PointerToArray< Element >::erase(), PointerToArray< Element >::max_size(), ConstPointerToArray< Element >::operator[](), and PointerToArray< Element >::v().

template<class Element>
TYPENAME ConstPointerToArray< Element >::reverse_iterator ConstPointerToArray< Element >::rend  )  const [inline]
 

Definition at line 664 of file pointerToArray.I.

template<class Element>
TYPENAME ConstPointerToArray< Element >::size_type ConstPointerToArray< Element >::size  )  const [inline]
 

Definition at line 680 of file pointerToArray.I.

References PointerToBase< RefCountObj< pvector< Element > > >::_ptr.

template<class Element>
const pvector< Element > & ConstPointerToArray< Element >::v  )  const [inline]
 

To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality.

Definition at line 854 of file pointerToArray.I.


Member Data Documentation

template<class Element>
pvector< Element > ConstPointerToArray< Element >::_empty_array [static, private]
 

Definition at line 26 of file pointerToArray.I.

To* PointerToBase< RefCountObj< pvector< Element > > >::_ptr [protected, inherited]
 

Definition at line 110 of file pointerTo.h.

Referenced by PointerToArray< Element >::back(), PointerToArray< Element >::begin(), PointerToArray< Element >::capacity(), PointerToArray< Element >::clear(), ConstPointerToArray< Element >::ConstPointerToArray(), ConstPointerToArray< Element >::empty(), PointerToArray< Element >::empty(), ConstPointerToArray< Element >::end(), PointerToArray< Element >::end(), PointerToArray< Element >::erase(), PointerToArray< Element >::front(), PointerToArray< Element >::get_ref_count(), PointerToArray< Element >::insert(), ConstPointerToArray< Element >::max_size(), PointerToArray< Element >::max_size(), PointerToArray< Element >::operator Element *(), PointerToArray< Element >::operator[](), PointerToArray< Element >::PointerToArray(), PointerToArray< Element >::pop_back(), PointerToArray< Element >::push_back(), PointerToArray< Element >::rbegin(), PointerToArray< Element >::rend(), ConstPointerToArray< Element >::size(), and PointerToArray< Element >::size().


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