Belle II Software  release-05-01-25
ZMQNoIdMessage.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Anselm Baur *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/pcore/zmq/messages/ZMQModuleMessage.h>
13 #include <framework/pcore/zmq/messages/ZMQDefinitions.h>
14 
15 #include <zmq.hpp>
16 
17 namespace Belle2 {
22  class ZMQNoIdMessage : public ZMQModuleMessage<3> {
24  friend class ZMQMessageFactory;
25 
26  public:
28  static constexpr const unsigned int c_type = 0;
30  static constexpr const unsigned int c_data = 1;
32  static constexpr const unsigned int c_additionalData = 2;
33 
35  std::string getData() const;
36 
38  zmq::message_t& getDataMessage()
39  {
40  return getMessagePart<c_data>();
41  }
42 
44  zmq::message_t& getAdditionalDataMessage()
45  {
46  return getMessagePart<c_additionalData>();
47  }
48 
50  bool isMessage(EMessageTypes isType) const;
51 
52  private:
55  };
57 }
Belle2::ZMQNoIdMessage::c_data
static constexpr const unsigned int c_data
Where the data is stored.
Definition: ZMQNoIdMessage.h:38
Belle2::EMessageTypes
EMessageTypes
Type the messages can have.
Definition: ZMQDefinitions.h:26
Belle2::ZMQModuleMessage::ZMQModuleMessage
ZMQModuleMessage()=default
Do not allow to create a new message from scratch publicly.
Belle2::ZMQNoIdMessage::c_type
static constexpr const unsigned int c_type
Where the type is stored.
Definition: ZMQNoIdMessage.h:36
Belle2::ZMQNoIdMessage::isMessage
bool isMessage(EMessageTypes isType) const
The if the message is of a given type.
Definition: ZMQNoIdMessage.cc:16
Belle2::ZMQNoIdMessage::getAdditionalDataMessage
zmq::message_t & getAdditionalDataMessage()
Get the additional data part.
Definition: ZMQNoIdMessage.h:52
Belle2::ZMQNoIdMessage::c_additionalData
static constexpr const unsigned int c_additionalData
Where the additional data is stored.
Definition: ZMQNoIdMessage.h:40
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
Belle2::ZMQNoIdMessage::getDataMessage
zmq::message_t & getDataMessage()
Get the data part.
Definition: ZMQNoIdMessage.h:46