Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:34

0001 #ifndef __LISTEVENTITERATOR_H__
0002 #define __LISTEVENTITERATOR_H__
0003 
0004 #include <cstdio>
0005 
0006 #ifndef __CINT__
0007 #include <fstream>
0008 #endif
0009 
0010 #include "fileEventiterator.h"
0011 #include "Event.h"
0012 
0013 #define FEMAXFILENAMELENGTH 256
0014 
0015 /**
0016    The listEventiterator reads the event data from a list of data files
0017    on disk.  It creates and returns pointers to Event objects. At the
0018    end of the file it returns 0 when there are no events left.  */
0019 
0020 #ifndef __CINT__
0021 class WINDOWSEXPORT listEventiterator : public Eventiterator {
0022 #else
0023 class  listEventiterator : public Eventiterator {
0024 #endif
0025 public:
0026 
0027   virtual ~listEventiterator();
0028 
0029   /// This simple constructor just needs the file name of the file 
0030   /// that contains, line by line, teh filenames.
0031 
0032   listEventiterator(const char *filename);
0033 
0034   /**
0035   This constructor gives you a status so you can learn that the creation
0036   of the fileEventiterator object was successful. If the status is not 0,
0037   something went wrong and you should delete the object again.
0038   */
0039   listEventiterator(const char *filename, int &status);
0040 
0041   const char * getIdTag() const;
0042 
0043   virtual void identify(std::ostream& os = std::cout) const;
0044 
0045   virtual const char * getCurrentFileName() const;
0046 
0047 /**
0048    this member function returns a pointer to the Event object, or
0049    NULL if there are no events left.
0050 */   
0051   Event *getNextEvent();
0052 
0053 
0054 private:
0055 
0056   Eventiterator * getNextIterator();
0057 
0058   char thefilename[FEMAXFILENAMELENGTH];
0059   char * listfilename;
0060 
0061 #ifndef __CINT__
0062   std::ifstream *liststream;
0063 #endif
0064 
0065   Eventiterator *it;
0066   int defunct;
0067   int finished;
0068 
0069 };
0070 
0071 
0072 
0073 #endif /* __LISTEVENTITERATOR_H__ */