#ifndef _io_VEventFile_h_ #define _io_VEventFile_h_ #include #include #include namespace evt { class Event; } namespace io { /** Base class for EventFile \author Stefano Argiro` \date 1 April 2003 \version $Id: VEventFile.h 14717 2009-09-17 20:24:36Z lukas $ \ingroup offline_io */ class VEventFile { public: VEventFile(); VEventFile(const std::string& filename, const Mode mode); virtual ~VEventFile() { } // log error, throw excpt virtual void Open(const std::string& filename, const Mode mode = eRead) = 0; virtual void Close() = 0; virtual void Write(const evt::Event& event) = 0; /// read current event advance cursor by 1 virtual Status Read(evt::Event& event) = 0; /// seek Event id set cursor there virtual Status FindEvent(const unsigned int eventId) = 0; /// goto by position in the file virtual Status GotoPosition(const unsigned int position) = 0; virtual int GetNEvents() = 0; const std::string& GetFilename() const { return fFilename; } protected: /// Copy constructor - not implemented VEventFile(const VEventFile& event); /// Assignment operator - not implemented VEventFile& operator=(const VEventFile& event); /** Checks that we are open for write * Intended to be called in the Write method * of derived classes */ int DefaultWrite(evt::Event& event); /** Checks that file exists * Intended to be called in the Write method * of derived classes */ int DefaultOpen(const std::string& filename, const Mode mode = eRead); std::string fFilename; Mode fMode; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: