PSCF v1.1
|
An array that only holds pointers to its elements. More...
#include <PArray.h>
Public Member Functions | |
virtual | ~PArray () |
Destructor. More... | |
int | capacity () const |
Return allocated size. More... | |
int | size () const |
Return logical size. More... | |
void | begin (PArrayIterator< Data > &iterator) const |
Set a PArrayIterator to the beginning of this PArray. More... | |
void | begin (ConstPArrayIterator< Data > &iterator) const |
Set a ConstPArrayIterator to the beginning of this PArray. More... | |
Data & | operator[] (int i) const |
Mimic C array subscripting. More... | |
Protected Member Functions | |
PArray () | |
Constructor (protected to prevent instantiation). More... | |
Protected Attributes | |
Data ** | ptrs_ |
PArray of of pointers to Data objects. More... | |
int | capacity_ |
Allocated size of ptrs_ array. More... | |
int | size_ |
Logical size (number of elements with initialized data). More... | |
An array that only holds pointers to its elements.
A PArray<Data> is an array that is implemented by storing pointers to Data objects, rather than actual Data objects. The array suscript operator [] returns a reference to an associated Data object, as for Array<Data>. A PArray<Data> is not responsible for destroying the associated Data objects.
A PArray<Data> object has a logical size and physical capacity. The logical size grows as pointers to objects are appended.
A PArray cannot be instantiated, because its constructor is protected. PArray is a base class for DPArray and for ArraySet.
|
virtual |
|
inlineprotected |
|
inline |
|
inline |
Return logical size.
Definition at line 140 of file PArray.h.
Referenced by pscfpp.file.File::__eq__(), pscfpp.text.Record::__init__(), pscfpp.file.File::__init__(), pscfpp.file.File::__repr__(), and pscfpp.text.Record::__str__().
|
inline |
Set a PArrayIterator to the beginning of this PArray.
iterator | PArrayIterator, initialized on output. |
Definition at line 147 of file PArray.h.
References Util::PArrayIterator< Data >::setCurrent(), Util::PArrayIterator< Data >::setEnd(), and Util::PArrayIterator< Data >::setNull().
|
inline |
Set a ConstPArrayIterator to the beginning of this PArray.
iterator | PArrayIterator, initialized on output. |
Definition at line 162 of file PArray.h.
References Util::ConstPArrayIterator< Data >::setCurrent(), Util::ConstPArrayIterator< Data >::setEnd(), and Util::ConstPArrayIterator< Data >::setNull().
|
inline |
|
protected |
PArray of of pointers to Data objects.
Definition at line 90 of file PArray.h.
Referenced by Util::DPArray< Data >::DPArray(), Util::GPArray< Data >::GPArray(), and Util::DPArray< Data >::operator=().
|
protected |
Allocated size of ptrs_ array.
Definition at line 93 of file PArray.h.
Referenced by Util::DPArray< Data >::DPArray(), and Util::GPArray< Data >::GPArray().
|
protected |
Logical size (number of elements with initialized data).
Definition at line 96 of file PArray.h.
Referenced by Util::DPArray< Data >::DPArray(), Util::GPArray< Data >::GPArray(), Util::DPArray< Data >::operator=(), and Util::GPArray< Data >::operator=().