6 #include "SIO_record.h"
7 #include "SIO_definitions.h"
12 #define LCSIO_RUNRECORDNAME "LCRunHeader"
13 #define LCSIO_RUNBLOCKNAME "RunHeader"
14 #define LCSIO_EVENTRECORDNAME "LCEvent"
15 #define LCSIO_EVENTBLOCKNAME "Event"
16 #define LCSIO_HEADERRECORDNAME "LCEventHeader"
17 #define LCSIO_HEADERBLOCKNAME "EventHeader"
19 #define LCSIO_ACCESSRECORDNAME "LCIORandomAccess"
20 #define LCSIO_ACCESSBLOCKNAME "LCIORandomAccess"
21 #define LCSIO_RANDOMACCESS_SIZE 136
22 #define LCSIO_INDEXRECORDNAME "LCIOIndex"
23 #define LCSIO_INDEXBLOCKNAME "LCIOIndex"
58 static const unsigned Event = 0x0001 << SIORecords::Event ;
59 static const unsigned Header = 0x0001 << SIORecords::Header ;
60 static const unsigned Run = 0x0001 << SIORecords::Run ;
61 static const unsigned Access = 0x0001 << SIORecords::Access ;
62 static const unsigned Index = 0x0001 << SIORecords::Index ;
64 static const unsigned All = 0xFFFFFFFF ;
66 Unpack(
unsigned recordFlag ) ;
70 bool _flags[ NumberOfRecords ] ;
75 SIO_record* operator[](
size_t idx) ;
77 void setCompress(
bool flag=
true ) ;
80 void add(SIO_record*& rec,
const char* name) ;
82 SIO_record* _records[ NumberOfRecords ] ;
88 #define LCSIO_READ( rec, pnt ) status = LCSIO::read( (rec), (pnt) ); if( !(status & 1) ) return status;
89 #define LCSIO_READ_LEN( rec, pnt , len ) status = LCSIO::read( (rec), (pnt) , (len) ); if( !(status & 1) ) return status;
91 #define LCSIO_WRITE( rec, pnt ) status = LCSIO::write( (rec), (pnt) ); if( !(status & 1) ) return status;
114 static const char* FILE_EXTENSION ;
130 static unsigned int read( SIO_stream* stream ,
char** c ,
int* len=0) ;
140 static unsigned int write( SIO_stream* stream ,
int i) ;
144 static unsigned int write( SIO_stream* stream ,
unsigned int i) ;
148 #if defined(_LP64) || defined(__APPLE_CC__)
150 static unsigned int write( SIO_stream* stream ,
size_t i) ;
159 static unsigned int write( SIO_stream* stream ,
float f) ;
164 static unsigned int write(SIO_stream* stream ,
const std::string& s) ;
184 static int dummy_size ;
186 static const int dummy_initial_size = 1024 ;
191 #endif // ifndef SIO_LCSIO_H
Manager class that holds instances of all known LCIO-SIO records.
Definition: LCSIO.h:37
static const bool COMPRESSION
the compression mode for SIO
Definition: LCSIO.h:118
static std::string getValidSIOName(const std::string &aName)
Creates a valid SIO name (basically equivalent to a valid C++ name) by replacing every [...
Definition: LCSIO.cc:223
static unsigned int write(SIO_stream *stream, int i)
This version checks the versionId to be able to read 'old' files with trailing '\00' (version <= 00-0...
Definition: LCSIO.cc:154
Collection of static helper functions for reading and writing data with SIO.
Definition: LCSIO.h:100
long long long64
64 bit signed integer,e.g.to be used for timestamps
Definition: LCIOTypes.h:14
Definition: lcrtrelation.cc:19
static void seekStream(SIO_stream *stream, EVENT::long64 pos)
Seek stream to the given absolute position - if pos<0 from end of file.
Definition: LCSIO.cc:94
static void checkVersion(int versionID)
Checks the version of the file - oldefile (version < v00-08) are no longer supported.
Definition: LCSIO.cc:116
static unsigned int read(SIO_stream *stream, char **c, int *len=0)
Read a string from the stream into a dummy buffer.
Definition: LCSIO.cc:127
Helper class that sets the unpack flag of known SIO records as specified by the constructor.
Definition: LCSIO.h:56