00001 #ifndef SIO_LCIORandomAccess_H
00002 #define SIO_LCIORandomAccess_H 1
00003
00004
00005 #include "LCIOTypes.h"
00006
00007 #include <iostream>
00008
00009
00010 typedef EVENT::long64 long64 ;
00011
00012 namespace SIO{
00013
00017 struct RunEvent{
00018 RunEvent(): RunNum( 0 ), EvtNum( 0 ) {}
00019 RunEvent(int run, int evt): RunNum( run ), EvtNum( evt ) {}
00020 RunEvent(long64 runEvt): RunNum( (runEvt >> 32 ) & 0xffffffff ), EvtNum( runEvt & 0xffffffff ) {}
00021 int RunNum ;
00022 int EvtNum ;
00023
00024 operator long64() const { return ( long64( RunNum ) << 32 | ( long64(EvtNum) & 0xffffffff ) ) ; }
00025 };
00026
00027 std::ostream & operator<<(std::ostream& os, const RunEvent& re ) ;
00028
00029 bool operator < ( const RunEvent& r0, const RunEvent& other) ;
00030
00031
00032 class SIORandomAccessHandler ;
00033 class LCIORandomAccess ;
00034 class LCIORandomAccessMgr ;
00035
00036 std::ostream & operator<<(std::ostream& os, const LCIORandomAccess& ra ) ;
00037
00038 bool operator < (const LCIORandomAccess ra0, const LCIORandomAccess& other) ;
00039
00040
00046
00047 class LCIORandomAccess {
00048
00049 friend class SIORandomAccessHandler ;
00050 friend class LCIORandomAccessMgr ;
00051 friend std::ostream & operator<<(std::ostream& os, const LCIORandomAccess& ra ) ;
00052 friend bool operator < (const LCIORandomAccess ra0, const LCIORandomAccess& other) ;
00053
00054 public:
00055
00056 virtual ~LCIORandomAccess(){ ; }
00057
00058 long64 getIndexLocation() const { return _indexLocation ; }
00059 long64 getPrevLocation() const { return _prevLocation ; }
00060
00061 long64 getFirstRecordLocation() const { return _firstRecordLocation ; }
00062
00063
00064 void setIndexLocation(long64 il) { _indexLocation = il ; }
00065 void setPreviousLocation(long64 pl) { _prevLocation = pl ; }
00066
00067 void setFirstRecordLocation(long64 fl) { _firstRecordLocation = fl ; }
00068
00069 protected:
00070 RunEvent _minRunEvt{} ;
00071 RunEvent _maxRunEvt{} ;
00072 int _nRunHeaders{0} ;
00073 int _nEvents{0} ;
00074 int _recordsAreInOrder{0} ;
00075 long64 _indexLocation{0} ;
00076 long64 _prevLocation{0} ;
00077 long64 _nextLocation{0} ;
00078 long64 _firstRecordLocation{0} ;
00079 };
00080
00081
00082
00083 }
00084 #endif