32 lines
1.3 KiB
C++
32 lines
1.3 KiB
C++
// Copyright (2019-2023) Paul Scherrer Institute
|
|
|
|
#ifndef JUNGFRAUJOCH_ZMQIMAGEPUSHER_H
|
|
#define JUNGFRAUJOCH_ZMQIMAGEPUSHER_H
|
|
|
|
#include <jfjoch.pb.h>
|
|
|
|
#include "ImagePusher.h"
|
|
#include "ThreadSafeFIFO.h"
|
|
#include "ZMQWrappers.h"
|
|
#include "DiffractionSpot.h"
|
|
#include "../frame_serialize/JFJochFrameSerializer.h"
|
|
|
|
class ZMQImagePusher : public ImagePusher {
|
|
std::vector<std::unique_ptr<ZMQContext>> contexts;
|
|
std::vector<std::unique_ptr<ZMQSocket>> sockets;
|
|
int64_t file_count = 1;
|
|
public:
|
|
void SendImage(const uint8_t *image_data, size_t image_size, int64_t image_number) override;
|
|
void SendImage(const uint8_t *image_data, size_t image_size, int64_t image_number,
|
|
ZeroCopyReturnValue *z) override;
|
|
ZMQImagePusher(ZMQContext &context, const std::vector<std::string>& addr,
|
|
int32_t send_buffer_high_watermark = -1, int32_t send_buffer_size = -1);
|
|
// High performance implementation, where each socket has dedicated ZMQ context
|
|
explicit ZMQImagePusher(const std::vector<std::string>& addr,
|
|
int32_t send_buffer_high_watermark = -1, int32_t send_buffer_size = -1);
|
|
void StartDataCollection(const StartMessage& message) override;
|
|
void EndDataCollection(const EndMessage& message) override;
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_ZMQIMAGEPUSHER_H
|