Belle II Software development
ZMQMessageHelper Class Reference

Internal helper for creating ZMQ messages (should not be used otherwise). More...

#include <ZMQMessageHelper.h>

Static Public Member Functions

static zmq::message_t createZMQMessage (zmq::message_t message)
 Just pass a zmq message.
 
static zmq::message_t createZMQMessage (const EMessageTypes &c)
 Create a message out of a type by casting to a char.
 
static zmq::message_t createZMQMessage (const std::string &s)
 Create a message out of a string.
 
static zmq::message_t createZMQMessage (const int i)
 Create a message out of an int by casting to a string.
 
static zmq::message_t createZMQMessage (const StoreObjPtr< EventMetaData > &evtMetaData)
 Create a message out of an event meta data by serialization.
 
static zmq::message_t createZMQMessage (const std::unique_ptr< EvtMessage > &evtMessage)
 Create a message out of an event message.
 

Detailed Description

Internal helper for creating ZMQ messages (should not be used otherwise).

Definition at line 26 of file ZMQMessageHelper.h.

Member Function Documentation

◆ createZMQMessage() [1/6]

static zmq::message_t createZMQMessage ( const EMessageTypes c)
inlinestatic

Create a message out of a type by casting to a char.

Definition at line 35 of file ZMQMessageHelper.h.

36 {
37 return createZMQMessage(std::string(1, static_cast<char>(c)));
38 }
static zmq::message_t createZMQMessage(zmq::message_t message)
Just pass a zmq message.

◆ createZMQMessage() [2/6]

static zmq::message_t createZMQMessage ( const int  i)
inlinestatic

Create a message out of an int by casting to a string.

Definition at line 47 of file ZMQMessageHelper.h.

48 {
49 return createZMQMessage(std::to_string(i));
50 }

◆ createZMQMessage() [3/6]

static zmq::message_t createZMQMessage ( const std::string &  s)
inlinestatic

Create a message out of a string.

Definition at line 41 of file ZMQMessageHelper.h.

42 {
43 return zmq::message_t(s.c_str(), s.length());
44 }

◆ createZMQMessage() [4/6]

static zmq::message_t createZMQMessage ( const std::unique_ptr< EvtMessage > &  evtMessage)
inlinestatic

Create a message out of an event message.

Definition at line 60 of file ZMQMessageHelper.h.

61 {
62 // TODO: here are the messages copied
63 return zmq::message_t(evtMessage->buffer(), evtMessage->size());
64 }

◆ createZMQMessage() [5/6]

static zmq::message_t createZMQMessage ( const StoreObjPtr< EventMetaData > &  evtMetaData)
inlinestatic

Create a message out of an event meta data by serialization.

Definition at line 53 of file ZMQMessageHelper.h.

54 {
55 const auto& message = EventMetaDataSerialization::serialize(*evtMetaData);
56 return zmq::message_t(message.c_str(), message.length());
57 }
static std::string serialize(const EventMetaData &eventMetaData)
Serialize the event meta data to a string.

◆ createZMQMessage() [6/6]

static zmq::message_t createZMQMessage ( zmq::message_t  message)
inlinestatic

Just pass a zmq message.

Definition at line 29 of file ZMQMessageHelper.h.

30 {
31 return message;
32 }

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