1 #ifndef SIO_LCIORandomAccessMgr_H
2 #define SIO_LCIORandomAccessMgr_H 1
4 #include "LCIORandomAccess.h"
5 #include "RunEventMap.h"
15 class LCIORandomAccessMgr ;
16 class SIOIndexHandler ;
17 class SIORandomAccessHandler ;
19 std::ostream & operator<<(std::ostream& os,
const LCIORandomAccessMgr& ra ) ;
60 _runEvtMap.
add( re , pos ) ;
114 return (_list.empty() ? 0 : _list.back() ) ;
121 std::list< LCIORandomAccess* > _list ;
Manager class for LCIO direct access.
Definition: LCIORandomAccessMgr.h:38
LCIORandomAccess * createFromEventMap()
Prepare an LCIORandomAccess object from the current contents of RunEventMap (all file locations set t...
Definition: LCIORandomAccessMgr.cc:57
bool initAppend(SIO_stream *s)
Initialize random access for append mode: read last LCIORandomAccess record if it exists - recreate t...
Definition: LCIORandomAccessMgr.cc:211
Helper struct that stores run and event positions in the file.
Definition: LCIORandomAccess.h:17
Map that holds positions of Run and Event records.
Definition: RunEventMap.h:20
bool readLCIOIndexAt(SIO_stream *stream, long64 pos)
Read the LCIOIndex record at the specified position.
Definition: LCIORandomAccessMgr.cc:172
const LCIORandomAccess * lastLCIORandomAccess()
Pointer to the last LCIORandomAccess in the list.
Definition: LCIORandomAccessMgr.h:113
long64 getPosition(const RunEvent &re)
Return the position of the specified Event record or Run record respectively (if EventNum == -1 )...
Definition: RunEventMap.h:43
Implementation class for LCIORandomAccess records.
Definition: LCIORandomAccess.h:47
bool createEventMap(SIO_stream *s)
Get the run and event header map from the stream - either by reading the random access records or by ...
Definition: LCIORandomAccessMgr.cc:232
void add(const RunEvent &re, long64 pos)
Add a new entry to the event map - if the RunEvent already exists the new position will be stored...
Definition: LCIORandomAccessMgr.h:59
Handler for LCIOrandomAccess and LCIOIndex objects/blocks.
Definition: SIORandomAccessHandler.h:16
void add(const RunEvent &re, long64 pos)
Add a new entry to the event map - if the RunEvent already exists the new position will be stored...
Definition: RunEventMap.cc:20
bool readLCIORandomAccess(SIO_stream *stream)
Helper for reading the next LCIORandomAccess record (need preceeding call to LCSIO::seek() ) ...
Definition: LCIORandomAccessMgr.cc:139
const RunEventMap & getEventMap()
Return the event map - it will be empty, if not yet created.
Definition: LCIORandomAccessMgr.h:70
void writeRandomAccessRecords(SIO_stream *stream)
Write the current random access records LCIOIndex and LCIORandomAccess to the stream.
Definition: LCIORandomAccessMgr.cc:367
void createFileRecord()
Create file record from all LCIORandomAccess records.
Definition: LCIORandomAccessMgr.cc:77
bool readLCIOIndex(SIO_stream *stream)
Helper for reading the next LCIOIndex record (need preceeding call to LCSIO::seek() ) ...
Definition: LCIORandomAccessMgr.cc:179
bool readLCIORandomAccessAt(SIO_stream *stream, long64 pos)
Read the LCIORandomAccess record at the specified position.
Definition: LCIORandomAccessMgr.cc:131
void addLCIORandomAccess(LCIORandomAccess *ra)
Add a new LCIORandomAccess object to the list.
Definition: LCIORandomAccessMgr.cc:119
void clear()
Clear all lists and maps before closing a file.
Definition: LCIORandomAccessMgr.cc:41
long64 getPosition(const RunEvent &re)
Return the position of the specified Event record or Run record respectively (if EventNum == -1 )...
Definition: LCIORandomAccessMgr.h:53
bool recreateEventMap(SIO_stream *)
Fill the RunEventMap from the event and run header records in the file.
Definition: LCIORandomAccessMgr.cc:290
Handler for LCIOrandomAccess and LCIOIndex objects/blocks.
Definition: SIOIndexHandler.h:16