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