Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 1491)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 1492)
@@ -14,4 +14,6 @@
 
 #pragma link C++ class MLog+;
+
+#pragma link C++ class MIter+;
 
 #pragma link C++ class MTask+;
Index: trunk/MagicSoft/Mars/mbase/MIter.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MIter.cc	(revision 1492)
+++ trunk/MagicSoft/Mars/mbase/MIter.cc	(revision 1492)
@@ -0,0 +1,65 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  08/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MIter                                                                    //
+//                                                                          //
+// This is the original MIter, but returns a MParContainer instead of a     //
+// TObject.                                                                 //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MIter.h"
+
+ClassImp(MIter);
+
+//______________________________________________________________________________
+MIter::MIter(const MIter &iter)
+{
+   // Copy a MIter. This involves allocating a new MIterator of the right
+   // sub class and assigning it with the original.
+
+   if (iter.fIterator) {
+      fIterator = iter.GetCollection()->MakeIterator();
+      fIterator->operator=(*iter.fIterator);
+   } else
+      fIterator = 0;
+}
+
+//______________________________________________________________________________
+MIter &MIter::operator=(const MIter &rhs)
+{
+   // Assigning an MIter to another. This involves allocatiing a new MIterator
+   // of the right sub class and assigning it with the original.
+
+   if (this != &rhs) {
+      if (rhs.fIterator) {
+         delete fIterator;
+         fIterator = rhs.GetCollection()->MakeIterator();
+         fIterator->operator=(*rhs.fIterator);
+      }
+   }
+   return *this;
+}
Index: trunk/MagicSoft/Mars/mbase/MIter.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MIter.h	(revision 1492)
+++ trunk/MagicSoft/Mars/mbase/MIter.h	(revision 1492)
@@ -0,0 +1,43 @@
+#ifndef MARS_MIter
+#define MARS_MIter
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MIter                                                                   //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#ifndef MARS_MAGIC
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TIterator
+#include <TIterator.h>
+#endif
+
+class MParContainer;
+
+class MIter
+{
+private:
+   TIterator *fIterator;         //collection iterator
+
+protected:
+   MIter() : fIterator(0) { }
+
+public:
+   MIter(const TCollection *col, Bool_t dir = kIterForward)
+        : fIterator(col ? col->MakeIterator(dir) : 0) { }
+   MIter(TIterator *it) : fIterator(it) { }
+   MIter(const MIter &iter);
+   MIter &operator=(const MIter &rhs);
+   virtual            ~MIter() { SafeDelete(fIterator) }
+   MParContainer     *operator()() { return (MParContainer*)(fIterator ? fIterator->Next() : 0); }
+   MParContainer     *Next() { return (MParContainer*)(fIterator ? fIterator->Next() : 0); }
+   const TCollection *GetCollection() const { return fIterator ? fIterator->GetCollection() : 0; }
+   Option_t          *GetOption() const { return fIterator ? fIterator->GetOption() : ""; }
+   void               Reset() { if (fIterator) fIterator->Reset(); }
+
+   ClassDef(MIter,0)  //Iterator wrapper
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 1491)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 1492)
@@ -39,4 +39,5 @@
            MFilter.cc \
            MEvtLoop.cc \
+           MIter.cc \
            MGList.cc \
            MGTask.cc \
