#include <pointerToArray.h>
Inheritance diagram for PointerToArray< Element >:
Public Types | |
typedef TYPENAME pvector< Element >::value_type | value_type |
typedef TYPENAME pvector< Element >::reference | reference |
typedef TYPENAME pvector< Element >::const_reference | const_reference |
typedef TYPENAME pvector< Element >::iterator | iterator |
typedef TYPENAME pvector< Element >::const_iterator | const_iterator |
typedef TYPENAME pvector< Element >::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 | |
PointerToArray () | |
PointerToArray (size_type n, const Element &value) | |
PointerToArray (const PointerToArray< Element > ©) | |
iterator | begin () const |
iterator | end () const |
TYPENAME PointerToArray< Element >::reverse_iterator | rbegin () const |
TYPENAME PointerToArray< Element >::reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
bool | empty () const |
void | reserve (size_type n) |
size_type | capacity () const |
reference | front () const |
reference | back () const |
iterator | insert (iterator position, const Element &x) const |
void | insert (iterator position, size_type n, const Element &x) const |
void | erase (iterator position) const |
void | erase (iterator first, iterator last) const |
reference | operator[] (size_type n) const |
reference | operator[] (int n) const |
void | push_back (const Element &x) |
void | pop_back () |
void | make_empty () |
Empties the array pointed to. | |
operator Element * () const | |
The pointer typecast operator is convenient for maintaining the fiction that we actually have a C-style array. | |
Element * | p () const |
Function p() is similar to the function from PointerTo. | |
pvector< Element > & | v () const |
To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality. | |
void * | get_void_ptr () const |
Returns the reference to memory where the vector is stored. | |
void | set_void_ptr (void *p) |
Sets this PTA to point to the pointer passed in. | |
int | get_ref_count () const |
Returns the reference count of the underlying vector. | |
PointerToArray< Element > & | operator= (RefCountObj< pvector< Element > > *ptr) |
PointerToArray< Element > & | operator= (const PointerToArray< Element > ©) |
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 |
Static Public Member Functions | |
PointerToArray< Element > | empty_array (size_type n) |
Protected Member Functions | |
void | reassign (To *ptr) |
void | reassign (const PointerToBase< To > ©) |
Protected Attributes | |
To * | _ptr |
Static Private Attributes | |
pvector< Element > | _empty_array |
This is actually implemented as an STL vector, using the RefCountObj class to wrap it up with a reference count.
Definition at line 104 of file pointerToArray.h.
|
Definition at line 110 of file pointerToArray.h. |
|
Definition at line 108 of file pointerToArray.h. |
|
Definition at line 112 of file pointerToArray.h. |
|
Definition at line 113 of file pointerToArray.h. |
|
Definition at line 109 of file pointerToArray.h. |
|
Definition at line 107 of file pointerToArray.h. |
|
Definition at line 111 of file pointerToArray.h. |
|
Definition at line 114 of file pointerToArray.h. |
|
Definition at line 99 of file pointerTo.h. |
|
Definition at line 106 of file pointerToArray.h. |
|
Definition at line 37 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and PointerToArray< Element >::reserve(). |
|
Definition at line 61 of file pointerToArray.I. References INLINE. |
|
Definition at line 76 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME. |
|
Definition at line 245 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, nassertv, NULL, and x. |
|
Definition at line 90 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME. |
|
Definition at line 212 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, nassertd, NULL, and TYPENAME. |
|
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 559 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME. |
|
Definition at line 183 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, nassertr, NULL, and TYPENAME. |
|
Definition at line 45 of file pointerToArray.I. |
|
Definition at line 106 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME. |
|
Definition at line 314 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, PointerToBase< RefCountObj< pvector< Element > > >::reassign(), and x. |
|
Definition at line 296 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr. |
|
Definition at line 226 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, nassertr, NULL, TYPENAME, and x. |
|
Returns the reference count of the underlying vector.
Definition at line 513 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and TYPENAME. |
|
Returns the reference to memory where the vector is stored. To be used only with get_void_ptr Definition at line 484 of file pointerToArray.I. |
|
Definition at line 280 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr. |
|
Definition at line 264 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr. |
|
Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct comparison to a NULL pointer also works.) |
|
Empties the array pointed to. This is different from clear(), which reassigns the pointer to a NULL pointer. Definition at line 405 of file pointerToArray.I. References INLINE. |
|
Definition at line 167 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, NULL, and PointerToBase< RefCountObj< pvector< Element > > >::reassign(). |
|
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 431 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and NULL. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 540 of file pointerToArray.I. |
|
Definition at line 526 of file pointerToArray.I. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 353 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, nassertd, nassertv, and NULL. |
|
Definition at line 333 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, nassertd, nassertv, and NULL. |
|
A handy function to output PointerTo's as a hex pointer followed by a reference count.
|
|
Function p() is similar to the function from PointerTo. It does the same thing: it returns the same thing as the typecast operator, above. Definition at line 449 of file pointerToArray.I. |
|
Definition at line 383 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and NULL. |
|
Definition at line 367 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and NULL. |
|
Definition at line 122 of file pointerToArray.I. References PointerToArray< Element >::_empty_array, PointerToBase< RefCountObj< pvector< Element > > >::_ptr, and NULL. |
|
|
|
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(). |
|
Definition at line 138 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, nassertd, NULL, and TYPENAME. |
|
Referenced by PointerToArray< Element >::PointerToArray(). |
|
Sets this PTA to point to the pointer passed in.
Definition at line 499 of file pointerToArray.I. |
|
Definition at line 154 of file pointerToArray.I. References PointerToBase< RefCountObj< pvector< Element > > >::_ptr, INLINE, and NULL. |
|
To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality.
Definition at line 465 of file pointerToArray.I. References INLINE, NULL, and PointerToBase< RefCountObj< pvector< Element > > >::reassign(). |
|
|