LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCReader.h
1 // -*- C++ -*-
2 // AID-GENERATED
3 // =========================================================================
4 // This class was generated by AID - Abstract Interface Definition
5 // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
6 // =========================================================================
7 #ifndef IO_LCREADER_H
8 #define IO_LCREADER_H 1
9 
10 #include <string>
11 #include <vector>
12 
13 #include "EVENT/LCEvent.h"
14 #include "EVENT/LCRunHeader.h"
15 #include "Exceptions.h"
16 #include "LCIOSTLTypes.h"
17 
18 namespace IO {
19 
20 class LCEventListener;
21 class LCRunListener;
22 
32 class LCReader {
33 
34 public:
36  virtual ~LCReader() { /* nop */; }
37 
41  static const int directAccess = 0x00000001 << 0 ;
46  virtual void open(const std::string & filename) throw (IOException, std::exception ) = 0;
47 
55  virtual void open(const std::vector<std::string> & filenames) throw (IOException, std::exception ) = 0;
56 
62  virtual EVENT::LCRunHeader * readNextRunHeader() throw (IOException, std::exception ) = 0;
63 
69  virtual EVENT::LCRunHeader * readNextRunHeader(int accessMode) throw (IOException, std::exception ) = 0;
70 
76  virtual EVENT::LCEvent * readNextEvent() throw (IOException, std::exception ) = 0;
77 
83  virtual EVENT::LCEvent * readNextEvent(int accessMode) throw (IOException, std::exception ) = 0;
84 
89  virtual int getNumberOfEvents() throw (IOException, std::exception ) = 0;
90 
95  virtual int getNumberOfRuns() throw (IOException, std::exception ) = 0;
96 
101  virtual void getRuns(EVENT::IntVec & runs) = 0;
102 
109  virtual void getEvents(EVENT::IntVec & events) = 0;
110 
115  virtual void setReadCollectionNames(const std::vector<std::string> & colnames) = 0;
116 
120  virtual void skipNEvents(int n) throw (IOException, std::exception ) = 0;
121 
127  virtual EVENT::LCRunHeader * readRunHeader(int runNumber) throw (IOException, std::exception ) = 0;
128 
134  virtual EVENT::LCRunHeader * readRunHeader(int runNumber, int accessMode) throw (IOException, std::exception ) = 0;
135 
141  virtual EVENT::LCEvent * readEvent(int runNumber, int evtNumber) throw (IOException, std::exception ) = 0;
142 
148  virtual EVENT::LCEvent * readEvent(int runNumber, int evtNumber, int accessMode) throw (IOException, std::exception ) = 0;
149 
154  virtual void close() throw (IOException, std::exception ) = 0;
155 
158  virtual void registerLCEventListener(LCEventListener * ls) = 0;
159 
162  virtual void removeLCEventListener(LCEventListener * ls) = 0;
163 
166  virtual void registerLCRunListener(LCRunListener * ls) = 0;
167 
170  virtual void removeLCRunListener(LCRunListener * ls) = 0;
171 
178  virtual void readStream() throw (IOException, std::exception ) = 0;
179 
186  virtual void readStream(int maxRecord) throw (IOException, std::exception ) = 0;
187 }; // class
188 } // namespace IO
189 #endif /* ifndef IO_LCREADER_H */
virtual void registerLCRunListener(LCRunListener *ls)=0
Registers a listener for reading LCEventsLCRunHeaders from a stream.
virtual EVENT::LCRunHeader * readNextRunHeader()=0
Reads the next run header from the file.
Interface for the run header.
Definition: LCRunHeader.h:23
virtual EVENT::LCEvent * readEvent(int runNumber, int evtNumber)=0
Reads the specified event from file.
virtual int getNumberOfEvents()=0
Return the number of events in the file - the file has to be open.
virtual void getEvents(EVENT::IntVec &events)=0
Return the run and event numbers of the events in the file - the file has to be open.
virtual int getNumberOfRuns()=0
Return the number of runs (run headers) in the file - the file has to be open.
Listener for the occurence of LCEvents when reading a stream.
Definition: LCEventListener.h:24
virtual EVENT::LCEvent * readNextEvent()=0
Reads the next event from the file.
virtual void setReadCollectionNames(const std::vector< std::string > &colnames)=0
Limit the collection names that are going to be read to the subset given in the vector - all other co...
virtual void getRuns(EVENT::IntVec &runs)=0
Return the run numbers of the runs (run headers) in the file - the file has to be open...
virtual void skipNEvents(int n)=0
Skips the next n events from the current position.
Listener for the occurence of LCRunHeader when reading a stream.
Definition: LCRunListener.h:24
IOException used for reading/writing errors.
Definition: Exceptions.h:92
Interface for reading data from LCIO.
Definition: LCReader.h:32
virtual EVENT::LCRunHeader * readRunHeader(int runNumber)=0
Reads the specified runHeader from file.
virtual void removeLCEventListener(LCEventListener *ls)=0
Remove a listener for reading LCEvents from a stream.
static const int directAccess
Configuration flags for the LCReader instance - to be used with LCFactory::createLCReader().
Definition: LCReader.h:41
virtual void removeLCRunListener(LCRunListener *ls)=0
Remove a listener for reading LCRunHeaders from a stream.
virtual void readStream()=0
Reads the input stream and notifies registered listeners according to the object type found in the st...
virtual void close()=0
Closes the output file/stream etc.
virtual void open(const std::string &filename)=0
Opens a file for reading (read-only).
virtual void registerLCEventListener(LCEventListener *ls)=0
Registers a listener for reading LCEvents from a stream.
virtual ~LCReader()
Destructor.
Definition: LCReader.h:36