Belle II Software  release-08-01-10
MsgHandler Class Reference

A class to encode/decode an EvtMessage. More...

#include <MsgHandler.h>

Collaboration diagram for MsgHandler:

Public Member Functions

 MsgHandler (int complevel=0)
 Constructor. More...
 
virtual ~MsgHandler ()
 Destructor.
 
virtual void clear ()
 Clear object list.
 
virtual void add (const TObject *, const std::string &name)
 Add an object to be streamed.
 
virtual EvtMessageencode_msg (ERecordType rectype)
 Stream object list into an EvtMessage. More...
 
virtual void decode_msg (EvtMessage *msg, std::vector< TObject * > &objlist, std::vector< std::string > &namelist)
 Decode an EvtMessage into a vector list of objects with names.
 

Private Attributes

CharBuffer m_buf
 EvtMessage character buffer for encode_msg().
 
CharBuffer m_compBuf
 EvtMessage character buffer for compressing/decompressing.
 
std::unique_ptr< TMessage > m_msg
 Used for serialising objects into m_buf.
 
InMessage m_inMsg
 Used for deserializing in decode_msg()
 
int m_complevel
 compression algorithm * 100 + compression level. More...
 

Detailed Description

A class to encode/decode an EvtMessage.

Definition at line 103 of file MsgHandler.h.

Constructor & Destructor Documentation

◆ MsgHandler()

MsgHandler ( int  complevel = 0)
explicit

Constructor.

Parameters
complevelCompression level and algorithm: algorithm*100 + level where algorithm can be one of 0: default root system algorithm (usually zlib) 1: zlib 2: lzma 3: old root compression code and level can be between 1 and 9 (0 disables compression). So for example 101 corresponds to zlib with minimal compression while 209 means lzma with maximal compression.

Definition at line 25 of file MsgHandler.cc.

25  :
26  m_buf(100000),
27  m_compBuf(0),
28  m_msg(new TMessage(kMESS_OBJECT))
29 {
30  m_complevel = complevel;
31 
32  //Schema evolution is needed to stream genfit tracks
33  //If disabled, streamers will crash when reading data.
34  TMessage::EnableSchemaEvolutionForAll();
35  m_msg->SetWriteMode();
36 }
int m_complevel
compression algorithm * 100 + compression level.
Definition: MsgHandler.h:134
CharBuffer m_buf
EvtMessage character buffer for encode_msg().
Definition: MsgHandler.h:130
CharBuffer m_compBuf
EvtMessage character buffer for compressing/decompressing.
Definition: MsgHandler.h:131
std::unique_ptr< TMessage > m_msg
Used for serialising objects into m_buf.
Definition: MsgHandler.h:132

Member Function Documentation

◆ encode_msg()

EvtMessage * encode_msg ( ERecordType  rectype)
virtual

Stream object list into an EvtMessage.

Caller is responsible for deletion.

Definition at line 67 of file MsgHandler.cc.

Member Data Documentation

◆ m_complevel

int m_complevel
private

compression algorithm * 100 + compression level.

level can be 0 for no compression to 9 for highes compression, algorithm can be one of default (0), zlib (1) or lzma (2)

Definition at line 134 of file MsgHandler.h.


The documentation for this class was generated from the following files: