// // Name: BrRawIO.h // Author: K.Olchanski // Date: 21 Apr 1999 // Descrition: BRAHMS Raw Data Input and Output class. // // $Id: BrRawIO.h,v 1.1.1.1 2001/06/21 14:55:10 hagel Exp $ // // $Log: BrRawIO.h,v $ // Revision 1.1.1.1 2001/06/21 14:55:10 hagel // Initial revision of brat2 // // Revision 1.4 2000/02/11 00:14:05 hagel // 1. Updated to the latest version of all of Konstantin's online routines // 2. Changed ZDC to use updated recordId's which return 8 adc values in // one recordId. // 3. Added an alpha-alpha version of unpacking for RICH. It is mostly // placeholder, but will serve as ground work to quickly get unpacking // once I understand what needs to be unpacked and what the raw structure is // // Revision 1.4 1999/05/30 01:58:53 olchansk // Added code for handling Filemark-vs-EOD errors // // Revision 1.3 1999/05/27 16:22:22 olchansk // Removed all use of std::string from BrRawIO. // Corrected the affected example programs. // // Revision 1.2 1999/05/21 20:00:55 olchansk // Intergrate BrRawEvent into the event builder. // // Revision 1.1 1999/05/14 23:31:51 olchansk // New versions for data IO and record access libraries. // This is new, untested code. // // #ifndef BrRawIOH #define BrRawIOH #include "BrRawEvent.h" class BrRawIO { public: // public definitions typedef enum { kOk = 0, kError = 1, kEof = 2, kNotOpen = 3, kCrcError = 4, kFilemark = 5 } Status; public: // public methods BrRawIO(); // ctor ~BrRawIO(); // dtor Status readopen(const char* filename); Status writeopen(const char* filename); Status fdopen(int fd); Status read(BrRawEvent& event); Status write(BrRawEvent& event); Status findFilemark(int count); Status flush(); Status close(); Status getError() const; const char* getErrorString() const; private: // private data Status fError; char fErrorString[256]; bool fIsOpen; int fFile; private: // private methods Status setOk(); Status setError(Status error,const char*fmt,...); }; #endif // end file