1 // @(#)root/cont:$Id$ 2 // Author: Fons Rademakers 13/08/95 3 4 /************************************************************************* 5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 6 * All rights reserved. * 7 * * 8 * For the licensing terms see $ROOTSYS/LICENSE. * 9 * For the list of contributors see $ROOTSYS/README/CREDITS. * 10 *************************************************************************/ 11 12 #ifndef ROOT_TIterator 13 #define ROOT_TIterator 14 15 16 ////////////////////////////////////////////////////////////////////////// 17 // // 18 // TIterator // 19 // // 20 // Iterator abstract base class. This base class provides the interface // 21 // for collection iterators. // 22 // // 23 ////////////////////////////////////////////////////////////////////////// 24 25 #ifndef ROOT_Rtypes 26 #include "Rtypes.h" 27 #endif 28 29 class TCollection; 30 class TObject; 31 32 class TIterator { 33 34 protected: 35 TIterator() { } 36 TIterator(const TIterator &) { } 37 38 public: 39 virtual TIterator &operator=(const TIterator &) { return *this; } 40 virtual ~TIterator() { } 41 virtual const TCollection *GetCollection() const = 0; 42 virtual Option_t *GetOption() const { return ""; } 43 virtual TObject *Next() = 0; 44 virtual void Reset() = 0; 45 TObject *operator()() { return Next(); } 46 virtual Bool_t operator!=(const TIterator &) const; 47 Bool_t operator==(const TIterator & other) const { return !(*this != other); } 48 virtual TObject *operator*() const; 49 50 ClassDef(TIterator,0) //Iterator abstract base class 51 }; 52 53 #endif 54