/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcRecoUtil/MdcRecoUtil-00-01-08/MdcRecoUtil/ConstAList.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // CLASSDOC OFF
00003 // $Id: ConstAList.h,v 1.2 2010/03/25 09:55:57 zhangy Exp $
00004 // CLASSDOC ON
00005 //
00006 // This file is a part of what might become CLHEP -
00007 // a Class Library for High Energy Physics.
00008 // 
00009 // This is the definition of the HepConstAList class. It is used in the same
00010 // way as the HepAList class but the object are stored as const pointers.
00011 // HepAListIterator cannot be used for this list, use HepConstAListIterator
00012 // instead.
00013 //
00014 // .SS See Also
00015 // AIterator.h, List.h, ConstAIterator.h, AListBase.h, AIteratorBase.h
00016 //
00017 // .SS History
00018 // HepConstAList was developed from an original (non-template) list class
00019 // written by Dag Bruck.
00020 //
00021 // Author: Leif Lonnblad
00022 //
00023 
00024 #ifndef _CONSTALIST_H_
00025 #define _CONSTALIST_H_
00026 
00027 #include "MdcRecoUtil/AList.h"
00028 
00029 #ifdef HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
00030 #define inline
00031 #endif
00032 
00033 template <class T>
00034 class  HepConstAList : public HepAListBase {
00035 
00036 public:
00037 
00038   inline HepConstAList();
00039   // Constructs a list with no objects.
00040 
00041   inline HepConstAList(const HepAList<T> &);
00042   // Copy constructor from non-const HepAList
00043 
00044   inline HepConstAList(const HepConstAList<T> &);
00045   // Copy constructor
00046 
00047   inline ~HepConstAList();
00048   // Destroys the list. The objects in the list are not destroyed.
00049 
00050   inline void insert(const T *);
00051   inline void insert(const T &);
00052   // Inserts an object first in the list.
00053 
00054   inline void insert(const T * e, const T * r);
00055   inline void insert(const T & e, const T & r);
00056   // Inserts the object e just before the first occurence of
00057   // object r in the list. 
00058 
00059   inline void insert(const T * e, unsigned pos);
00060   inline void insert(const T & e, unsigned pos);
00061   // Inserts the object e at the position pos in the list. If pos is outside
00062   // the list, the object will be appended.
00063 
00064   inline void append(const T *);
00065   inline void append(const T & e);
00066   inline void operator += (const T *);
00067   inline void operator += (const T &);
00068   // Appends an object in the end of the list
00069 
00070   inline void append(const T * e, const T * r);
00071   inline void append(const T & e, const T & r);
00072   // Appends the object e just after the last occurrence of object r
00073   // in the list
00074 
00075   inline void append(const HepAList<T> & l);
00076   inline void append(const HepConstAList<T> & l);
00077   inline void operator += (const HepAList<T> & l);
00078   inline void operator += (const HepConstAList<T> & l);
00079   // Appends all objects of list l to the end of this list.
00080 
00081   inline void remove(const T *);
00082   inline void remove(const T &);
00083   // Remove all occurencies of the object from the list.
00084 
00085   inline void remove(unsigned);
00086   // Remove an object from the list.
00087 
00088   inline void remove(const HepAList<T> &);
00089   inline void remove(const HepConstAList<T> &);
00090   // Remove all occurencies of the objects in list l from this list.
00091 
00092   inline HepBoolean member(const T *) const;
00093   inline HepBoolean member(const T &) const;
00094   inline HepBoolean hasMember(const T *) const;
00095   inline HepBoolean hasMember(const T &) const;
00096   // Returns true if the object is a member of the list.
00097 
00098   inline void replace(const T * eo, const T * en);
00099   inline void replace(const T & eo, const T & en);
00100   // Replace all occurencies of object eo with object en.
00101 
00102   inline const T * operator[] (unsigned i) const;
00103   // Returns the i:th object in the list.
00104   // NOTE! the objects are numbered 0 to n-1.
00105 
00106   inline int index(const T *) const;
00107   inline int index(const T &) const;
00108   // Returns the index of the last occurrence of the object.
00109   // NOTE! the objects are numbered 0 to n-1.
00110 
00111   inline int fIndex(const T *) const;
00112   inline int fIndex(const T &) const;
00113   // Returns the index of the first occurence of the object.
00114   // NOTE! the objects are numbered 0 to n-1.
00115 
00116   inline const T * first() const;
00117   inline const T * last() const;
00118   // Returns a pointer to the first and last object in the list.
00119 
00120   inline void operator = (const HepAList<T> &);
00121   inline void operator = (const HepConstAList<T> &);
00122   // Assignment.
00123   
00124   inline void sort(int (*compfunc)(const T **, const T **) );
00125   // sort the list according to the function.
00126   // the function is the same as one used by the C standard routine qsort.
00127 
00128 };
00129 
00130 #ifdef HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
00131 #undef inline
00132 #endif
00133 
00134 #ifdef HEP_SHORT_NAMES
00135 #define CAList HepConstAList
00136 #endif
00137 
00138 #include "MdcRecoUtil/ConstAList.icc"
00139 
00140 #endif

Generated on Tue Nov 29 23:13:31 2016 for BOSS_7.0.2 by  doxygen 1.4.7