Belle II Software light-2406-ragdoll
InMessage Class Reference

Reusable Message class derived from TMessage (for reading only) More...

#include <MsgHandler.h>

Inheritance diagram for InMessage:
Collaboration diagram for InMessage:

Public Member Functions

void SetBuffer (const void *ptr, UInt_t bufsize)
 Replace buffer (doesn't take ownership).
 
TObject * readTObject ()
 Read one object from the message assuming it inherits from TObject.
 

Detailed Description

Reusable Message class derived from TMessage (for reading only)

Definition at line 76 of file MsgHandler.h.

Constructor & Destructor Documentation

◆ InMessage()

InMessage ( )
inline

Definition at line 78 of file MsgHandler.h.

78 : TMessage()
79 {
80 SetReadMode();
81 SetWhat(kMESS_OBJECT);
82 }

Member Function Documentation

◆ readTObject()

TObject * readTObject ( )
inline

Read one object from the message assuming it inherits from TObject.

Definition at line 99 of file MsgHandler.h.

99{ return static_cast<TObject*>(ReadObjectAny(TObject::Class())); }

◆ SetBuffer()

void SetBuffer ( const void *  ptr,
UInt_t  bufsize 
)
inline

Replace buffer (doesn't take ownership).

Definition at line 85 of file MsgHandler.h.

86 {
87 TBuffer::SetBuffer(const_cast<void*>(ptr), bufsize, false);
88 // TMessage has an extra header of two ints: a reserved size field and a
89 // fWhat pointer indicating the type of the message. We force the message
90 // to be MESS_OBJECT so we don't care. Let's put the buffer where we need
91 // it to be. The original constructor has a ReadClass() here but we skip
92 // it since we read everything as TObject.
93 SetBufferOffset(sizeof(UInt_t) * 2);
94 // and reset the map of objects/classes seen so far
95 ResetMap();
96 }

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