AARE
Data analysis library for PSI hybrid detectors
Loading...
Searching...
No Matches
ZmqSocket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5// Socket to receive data from a ZMQ publisher
6// needs to be in sync with the main library (or maybe better use the versioning in the header)
7
8// forward declare zmq_msg_t to avoid including zmq.h in the header
9class zmq_msg_t;
10
11namespace aare {
12
13class ZmqSocket {
14 protected:
15 void *m_context{nullptr};
16 void *m_socket{nullptr};
17 std::string m_endpoint;
18 int m_zmq_hwm{1000};
19 int m_timeout_ms{1000};
20 size_t m_potential_frame_size{1024 * 1024};
21 constexpr static size_t m_max_header_size = 1024;
23
24 public:
25 ZmqSocket() = default;
26 ~ZmqSocket();
27
28 ZmqSocket(const ZmqSocket &) = delete;
29 ZmqSocket operator=(const ZmqSocket &) = delete;
30 ZmqSocket(ZmqSocket &&) = delete;
31
32 void disconnect();
33 void set_zmq_hwm(int hwm);
34 void set_timeout_ms(int n);
35 void set_potential_frame_size(size_t size);
36};
37
38} // namespace aare
Definition ZmqSocket.hpp:13
void set_zmq_hwm(int hwm)
Definition ZmqSocket.cpp:19
void disconnect()
Definition ZmqSocket.cpp:6
int m_zmq_hwm
Definition ZmqSocket.hpp:18
ZmqSocket()=default
ZmqSocket operator=(const ZmqSocket &)=delete
ZmqSocket(ZmqSocket &&)=delete
int m_timeout_ms
Definition ZmqSocket.hpp:19
void set_potential_frame_size(size_t size)
Definition ZmqSocket.cpp:23
void * m_socket
Definition ZmqSocket.hpp:16
~ZmqSocket()
Definition ZmqSocket.cpp:13
void set_timeout_ms(int n)
Definition ZmqSocket.cpp:21
void * m_context
Definition ZmqSocket.hpp:15
size_t m_potential_frame_size
Definition ZmqSocket.hpp:20
ZmqSocket(const ZmqSocket &)=delete
std::string m_endpoint
Definition ZmqSocket.hpp:17
char * m_header_buffer
Definition ZmqSocket.hpp:22
static constexpr size_t m_max_header_size
Definition ZmqSocket.hpp:21
Frame class to represent a single frame of data model class should be able to work with streams comin...
Definition CircularFifo.hpp:11