# PSortedList< T > Class Template Reference

This template class maps the PAbstractSortedList to a specific object type. More...

`#include <lists.h>`

Inheritance diagram for PSortedList< T >:

List of all members.

## Public Member Functions

Construction
| PSortedList ()
| Create a new, empty, sorted list.
Overrides from class PObject
virtual PObject * | Clone () const
| Make a complete duplicate of the list.
New functions for class
T & | operator[] (PINDEX index) const
| Retrieve a reference to the object in the list.

## Protected Member Functions

| PSortedList (int dummy, const PSortedList *c)

## Detailed Description

### template<class T>
class PSortedList< T >

This template class maps the PAbstractSortedList to a specific object type.

The functions in this class primarily do all the appropriate casting of types.

Note that if templates are not used the `PDECLARE_SORTED_LIST` macro will simulate the template instantiation.

## Constructor & Destructor Documentation

template<class T>

PSortedList< T >::PSortedList | ( |  | ) | `[inline]`

Create a new, empty, sorted list.

Note that by default, objects placed into the list will be deleted when removed or when all references to the list are destroyed.

template<class T>

PSortedList< T >::PSortedList | ( | int | dummy,
|  | const PSortedList< T > * | c |
| ) |  |  | `[inline, protected]`

## Member Function Documentation

template<class T>

virtual PObject* PSortedList< T >::Clone | ( |  | ) | const`[inline, virtual]`

Make a complete duplicate of the list.

Note that all objects in the array are also cloned, so this will make a complete copy of the list.

Reimplemented from PObject.

template<class T>

T& PSortedList< T >::operator[] | ( | PINDEX | index | ) | const`[inline]`

Retrieve a reference to the object in the list.

If there was not an object at that ordinal position or the index was beyond the size of the array then the function asserts.

The object accessed in this way is remembered by the class and further access will be fast.

Returns:
  reference to the object at `index` position.

Parameters:

  index | Index for entry

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

- lists.h