mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 06:32:41 +02:00
35 lines
792 B
C++
35 lines
792 B
C++
#ifndef ZMQRECVMODULE_H
|
|
#define ZMQRECVMODULE_H
|
|
|
|
#include <thread>
|
|
#include "ZmqReceiver.hpp"
|
|
#include "RingBuffer.hpp"
|
|
|
|
class ZmqRecvModule
|
|
{
|
|
typedef std::unordered_map<std::string, HeaderDataType> header_map;
|
|
|
|
RingBuffer& ring_buffer_;
|
|
const header_map& header_values_;
|
|
std::atomic_bool is_receiving_;
|
|
std::atomic_bool is_writing_;
|
|
std::vector<std::thread> receiving_threads_;
|
|
|
|
protected:
|
|
void receive_thread(
|
|
const std::string& connect_address);
|
|
|
|
public:
|
|
ZmqRecvModule(
|
|
RingBuffer& ring_buffer,
|
|
const header_map& header_values);
|
|
|
|
void start_recv(const std::string& connect_address,
|
|
const uint8_t n_receiving_threads);
|
|
void stop_recv();
|
|
|
|
void start_writing();
|
|
void stop_writing();
|
|
};
|
|
|
|
#endif |