#ifndef _io_EventFile_h_ #define _io_EventFile_h_ /** \file \author Stefano Argiro` \version $Id$ \date 03 Feb 2004 */ static const char CVSId_io_EventFile[] = "$Id$"; #include #include #include #include namespace evt { class Event; } namespace io { class VEventFile; /** \class EventFile EventFile.h "io/EventFile.h" \brief Interface to file I/O objects \author Stefano Argiro` \date 03 Feb 2004 \ingroup offline_io */ class EventFile { private: // set default switch (constructed with all streamers on) static const io::StreamerSwitch defaultSwitch; public: EventFile(const Type type = eOffline); EventFile(const std::string& filename, const Mode mode = eRead, const Type type = eOffline, const io::StreamerSwitch& streamerSwitch = EventFile::defaultSwitch); ~EventFile(); void Open(const std::string filename, const Mode mode = eRead); void Close(); void Write(const evt::Event& theEvent); /// read current event, advance cursor by 1 Status Read(evt::Event& theEvent); /// seek Event id set cursor there Status FindEvent(const unsigned int eventId); /// goto by position in the file Status GotoPosition(const unsigned int position); int GetNEvents(); const std::string& GetFilename() const; private: /// copy disallowed EventFile(const EventFile& theEventFile); /// copy disallowed EventFile& operator=(const EventFile& theEventFile); static io::VEventFile* Factory(const std::string& filename, const Mode mode, const Type type, const io::StreamerSwitch& streamerSwitch); io::VEventFile* fVEventFile; io::Type fType; io::StreamerSwitch fStreamerSwitch; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: