KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVProtobufDataReader.h
Go to the documentation of this file.
1 
4 #ifndef __KVProtobufDataReader_H
5 #define __KVProtobufDataReader_H
6 
7 #include "KVRawDataReader.h"
15 protected:
17  char* fBuffer;
18  std::unique_ptr<TFile> fFile;
21  ptrdiff_t fEvOffset;
24 
25  virtual bool read_buffer();
26 
28  {
31  return (UInt_t)(fBufSize - fEvOffset);
32  }
33 
34  virtual bool parse_event_from_message() = 0;
35 
36  void open_file(const Char_t* filepath);
37 
38 public:
39  KVProtobufDataReader(Int_t bufSiz = 16 * 1024 * 1024);
40  KVProtobufDataReader(const Char_t* filepath, Int_t bufSiz = 16 * 1024 * 1024);
41  virtual ~KVProtobufDataReader();
42 
45  {
46  return "PROTOBUF";
47  }
49 
50  ClassDef(KVProtobufDataReader, 1) //Read Google Protobuf DAQ files
51 };
52 
53 #endif
int Int_t
unsigned int UInt_t
char Char_t
bool Bool_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