4 #include "KVProtobufDataReader.h" 
    6 #include <google/protobuf/io/coded_stream.h> 
   10 #define KV_PROTOBUF_MSG_SIZE 4 
   55       google::protobuf::io::CodedInputStream codedIStream((
const uint8_t*)(
fBuffer + 
fEvOffset), KV_PROTOBUF_MSG_SIZE);
 
   56       codedIStream.ReadLittleEndian32(&
fEvSize);
 
   58          Error(
"GetNextEvent", 
"read zero size event");
 
   95    ptrdiff_t fFillOffset = 0;
 
  107    fFile->ReadBuffer((
char*)(
fBuffer + fFillOffset), bytes_to_read);
 
  114    return (bytes_read > 0);
 
  124    fp.
Append(
"?filetype=raw");
 
  125 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) 
  132    Info(
"open_file", 
"%s : size of file = %lld bytes", filepath, 
fFileSize);
 
  148      fBufSize(bufSiz), 
fBuffer(new char[bufSiz]), fFile(nullptr), fEvSize(0), fEvOffset(0), fNeedToReadBuffer(true),
 
  149      fReachedEndOfFile(false)
 
  166      fBufSize(bufSiz), 
fBuffer(new char[bufSiz]), fFile(nullptr), fFileSize(0), fEvSize(0), fEvOffset(0), fNeedToReadBuffer(true),
 
  167      fReachedEndOfFile(false)
 
  181 #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) 
void Error(const char *method, const char *msgfmt,...) const override
Read Google Protobuf DAQ files.
Bool_t GetNextEvent() override
Int_t GetRunNumberReadFromFile() const override
void open_file(const Char_t *filepath)
UInt_t fEvSize
size of file in bytes
virtual bool read_buffer()
true when we have read all bytes from file
UInt_t get_remaining_readable_buffer() const
bool fReachedEndOfFile
true when the buffer is empty/incomplete
KVProtobufDataReader(Int_t bufSiz=16 *1024 *1024)
Create file reader of given buffer size, do not open any files yet.
Long64_t fFileSize
TFile plugin handle.
bool fNeedToReadBuffer
next position to read in buffer
char * fBuffer
buffer size
ptrdiff_t fEvOffset
size of next event in buffer
virtual ~KVProtobufDataReader()
Destructor.
std::unique_ptr< TFile > fFile
current buffer
virtual bool parse_event_from_message()=0
Abstract base class for reading raw (DAQ) data.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
virtual void Info(const char *method, const char *msgfmt,...) const
TString & Append(char c, Ssiz_t rep=1)