PandaRoot
RhoCandListIterator.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef RHOCANDLISTITERATOR_H
14 #define RHOCANDLISTITERATOR_H
15 // //
17 // RhoCandListIterator //
18 // //
19 // Iterator class for RhoCandList //
20 // //
21 // Author List: //
22 // Marcel Kunze, RUB, Feb. 99 //
23 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
24 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
25 // //
27 
28 #include "TObject.h"
29 
30 class RhoCandidate;
31 class RhoCandList;
32 
33 class RhoCandListIterator : public TObject {
34 
35  public:
37  // Constructor taking a corresponding list as argument. Starting at the
38  // first element.
39 
41  // Copy constructor.
42 
44 
45  RhoCandidate *Next();
46  // Returns a pointer to the current object in the associated list, moving
47  // forward to the next. Returns 0 if all objects are done.
48 
50  // Moves backward one step in the list and returns the object found there.
51  // If current object is the first in the list, no stepping is done and 0 is
52  // returned.
53 
55  // Returns a pointer to the current object in the associated list,
56  // without incrementing the index.
57 
58  // public:
59 
60  int Index() const;
61 
62  void Rewind();
63  // Rewinds the iterator to the first element of the list.
64 
65  void Skip(int);
66  // Move iterator forward or backward.
67 
68  void SkipAll();
69  // Move iterator past last element.
70 
71  private:
72  RhoCandList *fList;
73 
74  int fCurrentIndex;
75 
76  public:
77  ClassDef(RhoCandListIterator, 1) // Iterator for RhoCandList
78 };
79 
80 #endif
RhoCandListIterator(RhoCandList &)
RhoCandidate * Current()
RhoCandidate * Next()
RhoCandidate * Previous()