BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawFile/include/RawFile/RawFileReader.h
Go to the documentation of this file.
1#ifndef BESIII_RAW_FILE_READER_H
2#define BESIII_RAW_FILE_READER_H
3
4#include "IRawFile/IRawReader.h"
5#include "RawFile/RawFileUtil.h"
6#include <string>
7#include <vector>
8
9// forward declaration
10class raw_ifstream;
11class EvtIdxHandler;
13
14typedef std::vector<std::string> VFileNames_t;
15
16class RawFileReader : public IRawReader {
17public:
19
20 static std::vector<int> getEventNumber( const VFileNames_t& idxfnames );
21
22 // thread safe
23 RawFileReader( const std::string& fname );
24 RawFileReader( const VFileNames_t& fnames );
25 RawFileReader( const std::string& fname, const std::string& idxfname );
26 RawFileReader( const VFileNames_t& fnames, const VFileNames_t& idxfnames );
27 virtual ~RawFileReader();
28
29 // thread safe
30 const uint32_t* nextEvent();
31 const uint32_t* currentEvent() const { return m_buffer; }
32
33 // following interface are not thread safe !!!
34 const uint32_t* nextEvent( int nIgnore );
35 const uint32_t* findEventById( uint32_t evtId );
36 const uint32_t* roughlyNextEvent( int nIgnore, int evtByte = 0 );
37
38 uint32_t runNo();
39
40 std::string currentFile();
41 uint32_t tellg();
42 uint32_t stat();
43
44private:
45 const uint32_t* notSafeNextEvent();
46
47 void read_one_event();
48 RawFileReader& nextFile( RawFileException& e );
49
50 RawFileReader(); // stop default
51
52private:
53 uint32_t m_bufferSize;
54 uint32_t* m_buffer;
55
56 raw_ifstream* m_rfs;
57 EvtIdxHandler* m_idxHandler;
58
59 DataSeparatorRecord m_dataSeparatorRecord;
60};
61
62#endif
std::vector< std::string > VFileNames_t
virtual ~RawFileReader()
const uint32_t * findEventById(uint32_t evtId)
const uint32_t * roughlyNextEvent(int nIgnore, int evtByte=0)
RawFileReader(const std::string &fname)
const uint32_t * nextEvent()
static std::vector< int > getEventNumber(const VFileNames_t &idxfnames)
std::string currentFile()