Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PArrayObjects Class Reference

#include <array.h>

Inheritance diagram for PArrayObjects:

PCollection PContainer PObject

List of all members.

Detailed Description

An array of objects. This class is a collection of objects which are descendents of the PObject# class. It is implemeted as a dynamic, linear array of pointers to the objects.

The implementation of an array allows very fast random access to items in the collection, but has severe penalties for inserting and deleting objects as all other objects must be moved to accommodate the change.

An array of objects may have "gaps" in it. These are array entries that contain NULL as the object pointer.

The PArrayObjects class would very rarely be descended from directly by the user. The PARRAY# macro would normally be used to create a class. That will instantiate the template based on PArray# or directly declare and define the class (using inline functions) if templates are not being used.

The PArray# class or PARRAY# macro will define the correctly typed operators for pointer access (operator const T *#) and subscript access (operator[]#).

Definition at line 954 of file array.h.

Comparison functions

virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Member Functions

Common functions for collections
PINLINE void AllowDeleteObjects (BOOL yes=TRUE)
void DisallowDeleteObjects ()
Overrides from class PCollection
virtual PINDEX Append (PObject *obj)
virtual PObjectGetAt (PINDEX index) const
virtual PINDEX GetObjectsIndex (const PObject *obj) const
virtual PINDEX GetValuesIndex (const PObject &obj) const
virtual PINDEX Insert (const PObject &before, PObject *obj)
virtual PINDEX InsertAt (PINDEX index, PObject *obj)
virtual BOOL Remove (const PObject *obj)
virtual void RemoveAll ()
virtual PObjectRemoveAt (PINDEX index)
virtual BOOL SetAt (PINDEX index, PObject *val)
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
Overrides from class PContainer
virtual PINDEX GetSize () const
 Get size of array.
virtual BOOL SetSize (PINDEX newSize)
Common functions for containers
virtual BOOL IsEmpty () const
BOOL IsUnique () const
virtual BOOL MakeUnique ()
BOOL SetMinSize (PINDEX minSize)
PINLINE PArrayObjects (PINDEX initialSize=0)
Overrides from class PObject
virtual void PrintOn (ostream &strm) const

Protected Member Functions

virtual void AssignContents (const PContainer &c)
void CloneContents (const PContainer *src)
void CopyContents (const PContainer &c)
virtual void DestroyContents ()=0
void Destruct ()
 PBASEARRAY (ObjPtrArray, PObject *)

Protected Attributes

class PContainer::Reference * reference
ObjPtrArray * theArray

Private Member Functions

 PCONTAINERINFO (PArrayObjects, PCollection)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index