Belle II Software development
REvtSocket.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef REVTSOCKET_H
9#define REVTSOCKET_H
10
11#include <string>
12
13#include <daq/dataflow/RSocketLib.h>
14#include <framework/pcore/EvtMessage.h>
15
16#define MAXEVTSIZE 80000000
17
18namespace Belle2 {
23
24 typedef unsigned short u_short;
25
26 class REvtSocketRecv {
27 public:
28 REvtSocketRecv(const std::string& hostname, int port);
29 ~REvtSocketRecv();
31 REvtSocketRecv(const REvtSocketRecv&) = delete;
32
34 REvtSocketRecv& operator=(const REvtSocketRecv&) = delete;
35
36 int status();
37
38 int send(EvtMessage* msg);
39 EvtMessage* recv(void);
40
41 int send_buffer(int size, char* buf);
42 int recv_buffer(char* buf);
43
44 RSocketRecv* sock(void);
45
46 private:
47 RSocketRecv* m_sock;
48 char* m_recbuf;
49 };
50
51 class REvtSocketSend {
52 public:
53 explicit REvtSocketSend(int port, bool accept_at_init = true);
54 ~REvtSocketSend();
56 REvtSocketSend(const REvtSocketSend&) = delete;
57
59 REvtSocketSend& operator=(const REvtSocketSend&) = delete;
60
61 int status();
62
63 int send(EvtMessage* msg);
64 EvtMessage* recv(void);
65
66 int send_buffer(int size, char* buf);
67 int recv_buffer(char* buf);
68
69 RSocketSend* sock(void);
70
71 private:
72 RSocketSend* m_sock;
73 char* m_recbuf;
74 };
75
77}
78
79#endif
80
81
Class to manage streamed object.
Definition EvtMessage.h:59
REvtSocketRecv & operator=(const REvtSocketRecv &)=delete
Operator = (disabled).
REvtSocketRecv(const REvtSocketRecv &)=delete
Copy constructor (disabled).
REvtSocketSend & operator=(const REvtSocketSend &)=delete
Operator = (disabled).
REvtSocketSend(const REvtSocketSend &)=delete
Copy constructor (disabled).
Abstract base class for different kinds of events.