BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/ConstAIterator.h
Go to the documentation of this file.
1// -*- C++ -*-
2// CLASSDOC OFF
3// $Id: ConstAIterator.h,v 1.2 2010/03/25 09:55:57 zhangy Exp $
4// CLASSDOC ON
5//
6// This file is a part of what might beome the CLHEP -
7// a Class Library for High Energy Physics.
8//
9// This is the definition of the HepConstAListIterator class. It is used
10// in the same way as the HepAListIterator class but can also be used with
11// HepConstAList and it only returns const pointers to objects.
12//
13// .SS
14// AList.h, ConstAList.h, AIterator.h, AListBase.h, AIteratorBase.h
15//
16// .SS History
17// HepConstAListIterator was developed from an original (non-template) list
18// iterator class written by Dag Bruck.
19//
20// Author: Leif Lonnblad
21//
22
23#ifndef _CONSTAITERATOR_H_
24#define _CONSTAITERATOR_H_
25
26#include "MdcRecoUtil/AIteratorBase.h"
27#include "MdcRecoUtil/ConstAList.h"
28
29#ifdef HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
30# define inline
31#endif
32
33template <class T> class HepConstAListIterator : public HepAListIteratorBase {
34
35public:
38 // Constructor taking a corresponding list as argument. Starting at the
39 // first element.
40
42 // Copy constructor.
43
45
46 inline const T* operator()();
47 inline const T* next();
48 // Returns a pointer to the current object in the associated list, moving
49 // forward to the next. Returns 0 if all objects are done.
50
51 inline const T* prev();
52 // Moves backward one step in the list and returns the object found there.
53 // If current object is the first in the list, no stepping is done and 0 is
54 // returned.
55
56 inline const T* current() const;
57 // Returns a pointer to the current object in the associated list,
58 // without incrementing the index.
59};
60
61#ifdef HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
62# undef inline
63#endif
64
65#ifdef HEP_SHORT_NAMES
66# define CAIterator HepConstAListIterator
67#endif
68
69#include "MdcRecoUtil/ConstAIterator.icc"
70
71#endif // _ALISTITERATOR_H_
const T * operator()()
const T * current() const
HepConstAListIterator(const HepConstAList< T > &)
HepConstAListIterator(const HepConstAListIterator< T > &)
HepConstAListIterator(const HepAList< T > &)