Belle II Software  release-05-01-25
ZMQNoIdMessage.cc
1 #include <framework/pcore/zmq/messages/ZMQNoIdMessage.h>
2 
3 #include <framework/logging/Logger.h>
4 
5 using namespace Belle2;
6 
8 std::string ZMQNoIdMessage::getData() const
9 {
10  B2ASSERT("The message is an event message",
11  not isMessage(EMessageTypes::c_eventMessage));
12  return getMessagePartAsString<c_data>();
13 }
14 
16 bool ZMQNoIdMessage::isMessage(const EMessageTypes isType) const
17 {
18  const auto& type = getMessagePartAsString<c_type>();
19  return type.size() == 1 and type[0] == static_cast<char>(isType);
20 }
Belle2::EMessageTypes
EMessageTypes
Type the messages can have.
Definition: ZMQDefinitions.h:26
Belle2::ZMQNoIdMessage::isMessage
bool isMessage(EMessageTypes isType) const
The if the message is of a given type.
Definition: ZMQNoIdMessage.cc:16
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ZMQNoIdMessage::getData
std::string getData() const
Get the data as string.
Definition: ZMQNoIdMessage.cc:8