HepCList


HepCList is a template based list class for storing copies of objects. A HepCList can be made of any class where a copy constructor and a operator== is defined.

Author

Leif Lonnblad

See also

HepAListBase, HepAList, HepConstAList, HepAListIteratorBase, HepAListIterator, HepCListIterator, HepConstAListIterator

Declaration

#include "CLHEP/Alist/CList.h"

template <class T>
class HepCList : public HepAListBase

Public Member Functions

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

inline void operator += (const HepAList<T> &l)
inline void operator += (const HepCList<T> &l)
inline void operator += (const HepConstAList<T> &l)
Appends all objects of the list l to the end of this list.
[]
inline 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 &)
Appends the object in the end of the list.

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 HepCList<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
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
Returns true if the object is a member of the list.
index
inline int index(const T &) const
Returns the index of the last occurrence equal to the object.
NOTE! The objects are numbered from 0 to n-1.
insert
inline void insert(const T &)
Inserts an object first in the list.

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)
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
Returns true if the object is a member of the list.
purge
inline void purge()
Remove and delete all duplicate objects in the list.
remove
inline void remove(const T &)
Remove and delete all occurencies equal to the object from the list.

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

inline void remove(const HepAList<T> &l)
inline void remove(const HepCList<T> &l)
inline void remove(const HepConstAList<T> &l)
Remove and delete all occurencies equal to the objects in list l from this list.
removeAll
inline void removeAll()
Remove and delete all objects in the list.
replace
inline void replace(const T &eo, const T &en)
Replace all occurencies of the object eo with the object en.

Example

CLHEP/test/testAList.cc


24 September 1997
EVC