HepConstAList


The HepConstAList class is used in the same way as the HepAList class but the object are stored as const pointers. HepAListIterator cannot be used for this list, use HepConstAListIterator instead.

HepConstAList was developed from an original (non-template) list class written by Dag Bruck.

Author

Leif Lonnblad

See also

HepAListBase, HepAList, HepCList, HepAListIteratorBase, HepAListIterator, HepCListIterator, HepConstAListIterator

Declaration

#include "CLHEP/Alist/ConstAList.h"

template <class T>
class HepConstAList : public HepAListBase

Public Member Functions

Constructor
inline HepConstAList()
Constructs a list with no objects.
Copy constructor
inline HepConstAList(const HepAList<T> &)
Copy constructor from non-const HepAList
Copy constructor
inline HepConstAList(const HepConstAList<T> &)
Destructor
inline ~HepConstAList()
Destroys the list. The objects in the list are not destroyed.
=
inline void operator = (const HepAList<T> &)
inline void operator = (const HepConstAList<T> &)
Assignment.
+=
inline void operator += (const T *)
inline void operator += (const T &)
Appends an object in the end of the list.

inline void operator += (const HepAList<T> &l)
inline void operator += (const HepConstAList<T> &l)
Appends all objects of the list l to the end of this list.
[]
inline const T * operator[] (unsigned i) const
Returns the i-th object in the list.
NOTE! The objects are numbered from 0 to n-1.
append
inline void append(const T *)
inline void append(const T &)
Appends the object in the end of the list.

inline void append(const T *e, const T *r)
inline void append(const T &e, const T &r)
Appends the object e just after the last occurrence of the object r in the list.

inline void append(const HepAList<T> &l)
inline void append(const HepConstAList<T> &l)
Appends all objects of list l to the end of this list.
fIndex
inline int fIndex(const T *) const
inline int fIndex(const T &) const
Returns the index of the first occurence of the object.
NOTE! The objects are numbered from 0 to n-1.
first
inline T * first() const
Returns a pointer to the first object in the list.
hasMember
inline HepBoolean hasMember(const T *) const
inline HepBoolean hasMember(const T &) const
Returns true if the object is a member of the list.
index
inline int index(const T *) const
inline int index(const T &) const
Returns the index of the last occurrence of the object.
NOTE! The objects are numbered from 0 to n-1.
insert
inline void insert(const T *)
inline void insert(const T &)
Inserts an object first in the list.

inline void insert(const T *e, const T *r)
inline void insert(const T &e, const T &r)
Inserts the object e just before the first occurence of the object r in the list.

inline void insert(const T *e, unsigned pos)
inline void insert(const T &e, unsigned pos)
Inserts the object e at the position pos in the list.
If pos is outside the list, the object will be appended.
last
inline T * last() const
Returns a pointer to the last object in the list.
member
inline HepBoolean member(const T *) const
inline HepBoolean member(const T &) const
Returns true if the object is a member of the list.
remove
inline void remove(const T *)
inline void remove(const T &)
Remove all occurencies of the object from the list.

inline void remove(unsigned)
Remove an object from the list.

inline void remove(const HepAList<T> &l)
inline void remove(const HepConstAList<T> &l)
Remove all occurencies of the objects in list l from this list.
replace
inline void replace(const T *eo, const T *en)
inline void replace(const T &eo, const T &en)
Replace all occurencies of the object eo with object en.
sort
inline void sort(int (*compfunc)(const T **, const T **) )
Sort the list according to the function.
The function is the same as one used by the C standard routine qsort.


24 September 1997
EVC