KaliVeda
Toolkit for HIC analysis
KVProtobufDataReader.h
1 
4 #ifndef __KVProtobufDataReader_H
5 #define __KVProtobufDataReader_H
6 
7 #include "KVRawDataReader.h"
16 protected:
18  char* fBuffer;
19  std::unique_ptr<TFile> fFile;
22  ptrdiff_t fEvOffset;
25 
26  virtual bool read_buffer();
27 
29  {
32  return (UInt_t)(fBufSize - fEvOffset);
33  }
34 
35  virtual bool parse_event_from_message() = 0;
36 
37  void open_file(const Char_t* filepath);
38 
39 public:
40  KVProtobufDataReader(Int_t bufSiz = 16 * 1024 * 1024);
41  KVProtobufDataReader(const Char_t* filepath, Int_t bufSiz = 16 * 1024 * 1024);
42  virtual ~KVProtobufDataReader();
43 
46  {
47  return "PROTOBUF";
48  }
50 
51  ClassDef(KVProtobufDataReader, 1) //Read Google Protobuf DAQ files
52 };
53 
54 #endif
int Int_t
unsigned int UInt_t
bool Bool_t
char Char_t
#define ClassDef(name, id)
Read Google Protobuf DAQ files.
void open_file(const Char_t *filepath)
UInt_t fEvSize
size of next event in buffer
virtual bool read_buffer()
read a buffer from the file
UInt_t get_remaining_readable_buffer() const
Int_t fBufSize
buffer size
bool fReachedEndOfFile
true when we have read all bytes from file
KVProtobufDataReader(Int_t bufSiz=16 *1024 *1024)
Create file reader of given buffer size, do not open any files yet.
Int_t GetRunNumberReadFromFile() const
Long64_t fFileSize
size of file in bytes
TString GetDataFormat() const
bool fNeedToReadBuffer
true when the buffer is empty/incomplete
char * fBuffer
current buffer
ptrdiff_t fEvOffset
next position to read in buffer
virtual ~KVProtobufDataReader()
Destructor.
std::unique_ptr< TFile > fFile
TFile plugin handle.
virtual bool parse_event_from_message()=0
Abstract base class for reading raw (DAQ) data.
long long Long64_t