KaliVeda  1.12/06
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 #ifdef USING_ROOT6
19  unique_ptr<TFile> fFile;
20 #else
21  TFile* fFile;
22 #endif
25  ptrdiff_t fEvOffset;
28 
29  virtual bool read_buffer();
30 
32  {
35  return (UInt_t)(fBufSize - fEvOffset);
36  }
37 
38  virtual bool parse_event_from_message() = 0;
39 
40  void open_file(const Char_t* filepath);
41 
42 public:
43  KVProtobufDataReader(Int_t bufSiz = 16 * 1024 * 1024);
44  KVProtobufDataReader(const Char_t* filepath, Int_t bufSiz = 16 * 1024 * 1024);
45  virtual ~KVProtobufDataReader();
46 
50  {
51  return "PROTOBUF";
52  }
54 
55  ClassDef(KVProtobufDataReader, 1) //Read Google Protobuf DAQ files
56 };
57 
58 #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)
KVSeqCollection * GetFiredDataParameters() const
unique_ptr< TFile > fFile
TFile plugin handle.
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.
virtual bool parse_event_from_message()=0
Abstract base class for reading raw (DAQ) data.
KaliVeda extensions to ROOT collection classes.
long long Long64_t