class PAbstractList |
This class is a collection of objects which are descendents of the PObject class.
![]() | Construction |
![]() | Compare (const PObject & obj) const Get the relative rank of the two lists. |
![]() | Overrides from class PContainer |
![]() | Overrides from class PCollection |
![]() | GetReferenceAt ( PINDEX index ) const Get the object at the specified ordinal position. |
![]() | SetCurrent ( PINDEX index ) const Move the internal "cursor" to the index position specified. |
Overrides from class PObject
Common functions for collections
Common functions for containers
Run Time Type functions
I/O functions
Miscellaneous functions
Comparison functions
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[]).
Note that by default, objects placed into the list will be deleted when removed or when all references to the list are destroyed.
This is also returned if all objects are equal and the instances list length is less than the obj parameters list length.
This is also returned if all objects are equal and the instances list length is greater than the obj parameters list length.
Note that the object values are compared for the search of the before parameter, not the pointers. So the objects in the collection must correctly implement the PObject::Compare() function.
Note if the index is beyond the size of the collection then the function will assert.
The object accessed in this way is remembered by the class and further access will be fast. Access to elements one either side of that saved element, and the head and tail of the list, will always be fast.
Note if the index is beyond the size of the collection then the function will assert.
The object accessed in this way is remembered by the class and further access will be fast. Access to elements one either side of that saved element, and the head and tail of the list, will always be fast.
The object accessed in this way is remembered by the class and further access will be fast. Access to elements one either side of that saved element, and the head and tail of the list, will always be fast.
Alphabetic index HTML hierarchy of classes or Java