Belle II Software  release-05-02-19
GetEventFromSocket.h
1 //+
2 // File : GetEventFromSocket.h
3 // Description : Module to receive event from socket
4 //
5 // Author : Ryosuke Itoh, IPNS, KEK
6 // Date : 13 - Jan - 2021
7 //-
8 
9 #ifndef GET_EVENT_FROM_SOCKET_MODULE_H
10 #define GET_EVENT_FROM_SOCKET_MODULE_H
11 
12 #include <framework/core/Module.h>
13 #include <daq/dataflow/EvtSocket.h>
14 
15 #include <string>
16 
17 #include <framework/pcore/DataStoreStreamer.h>
18 
19 namespace Belle2 {
28 
29  // Public functions
30  public:
31 
34  virtual ~GetEventFromSocketModule();
35 
37  virtual void initialize();
38 
40  virtual void beginRun();
41  virtual void event();
42  virtual void endRun();
43  virtual void terminate();
44 
45  private:
46  EvtMessage* receive();
47 
48  // Data members
49  private:
50 
52  std::vector<std::string> m_hosts;
53  std::vector<int> m_ports;
54 
56  std::vector<EvtSocketSend*> m_socks;
57 
60 
63 
65  int m_nrecv;
66 
67  };
68 
70 } // end namespace Belle2
71 
72 #endif // MODULEHELLO_H
Belle2::GetEventFromSocketModule::beginRun
virtual void beginRun()
Module functions to be called from event process.
Definition: GetEventFromSocket.cc:130
Belle2::GetEventFromSocketModule::endRun
virtual void endRun()
This method is called if the current run ends.
Definition: GetEventFromSocket.cc:163
Belle2::EvtMessage
Class to manage streamed object.
Definition: EvtMessage.h:60
Belle2::GetEventFromSocketModule
A class definition of an input module for Sequential ROOT I/O.
Definition: GetEventFromSocket.h:27
Belle2::GetEventFromSocketModule::event
virtual void event()
This method is the core of the module.
Definition: GetEventFromSocket.cc:136
Belle2::GetEventFromSocketModule::m_nrecv
int m_nrecv
No. of sent events.
Definition: GetEventFromSocket.h:65
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::GetEventFromSocketModule::m_compressionLevel
int m_compressionLevel
Compression Level.
Definition: GetEventFromSocket.h:62
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GetEventFromSocketModule::m_streamer
DataStoreStreamer * m_streamer
DataStoreStreamer.
Definition: GetEventFromSocket.h:59
Belle2::GetEventFromSocketModule::GetEventFromSocketModule
GetEventFromSocketModule()
Constructor / Destructor.
Definition: GetEventFromSocket.cc:36
Belle2::GetEventFromSocketModule::m_socks
std::vector< EvtSocketSend * > m_socks
Reciever Socket.
Definition: GetEventFromSocket.h:56
Belle2::DataStoreStreamer
Stream/restore DataStore objects to/from EvtMessage.
Definition: DataStoreStreamer.h:33
Belle2::GetEventFromSocketModule::terminate
virtual void terminate()
This method is called at the end of the event processing.
Definition: GetEventFromSocket.cc:171
Belle2::GetEventFromSocketModule::initialize
virtual void initialize()
Module functions to be called from main process.
Definition: GetEventFromSocket.cc:58
Belle2::GetEventFromSocketModule::m_hosts
std::vector< std::string > m_hosts
Receiver Port.
Definition: GetEventFromSocket.h:52