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

PAbstractList Class Reference

#include <lists.h>

Inheritance diagram for PAbstractList:

PCollection PContainer PObject

List of all members.

Detailed Description

This class is a collection of objects which are descendents of the PObject# class. It is implemeted as a doubly linked list.

The implementation of a list allows very fast inserting and deleting of objects in the collection, but has severe penalties for random access. All object access should be done sequentially to avoid these speed penalties.

The class remembers the last accessed element. This state information is used to optimise access by the "virtual array" model of collections. If access via ordinal index is made sequentially there is little overhead.

The PAbstractList class would very rarely be descended from directly by the user. The PDECLARE_LIST# and PLIST# macros would normally be used to create descendent classes. They will instantiate the template based on PList# or directly declare and define the class (using inline functions) if templates are not being used.

The PList# class or PDECLARE_LIST# macro will define the correctly typed operators for subscript access (operator[]#).

Definition at line 164 of file lists.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

virtual Comparison Compare (const PObject &obj) const
Common functions for collections
PINLINE void AllowDeleteObjects (BOOL yes=TRUE)
void DisallowDeleteObjects ()
virtual void RemoveAll ()
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 PObjectRemoveAt (PINDEX index)
virtual BOOL ReplaceAt (PINDEX index, PObject *val)
virtual BOOL SetAt (PINDEX index, PObject *val)
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Common functions for containers
virtual PINDEX GetSize () const
virtual BOOL IsEmpty () const
BOOL IsUnique () const
virtual BOOL MakeUnique ()
BOOL SetMinSize (PINDEX minSize)
PINLINE PAbstractList ()
Overrides from class PObject
virtual void PrintOn (ostream &strm) const
Overrides from class PContainer
virtual BOOL SetSize (PINDEX newSize)

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 ()
PINLINE PObjectGetReferenceAt (PINDEX index) const
BOOL SetCurrent (PINDEX index) const

Protected Attributes

class PAbstractList::Info * info
class PContainer::Reference * reference

Private Member Functions

 PCONTAINERINFO (PAbstractList, PCollection)


class  Element
class  Info

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

Generated by  Doxygen 1.6.0   Back to index