36 lines
888 B
C++
36 lines
888 B
C++
// Copyright (2019-2023) Paul Scherrer Institute
|
|
|
|
#ifndef JUNGFRAUJOCH_STREAMWRITER_H
|
|
#define JUNGFRAUJOCH_STREAMWRITER_H
|
|
|
|
#include <future>
|
|
|
|
#include "ZMQImagePuller.h"
|
|
#include "HDF5DataFile.h"
|
|
|
|
struct StreamWriterStatistics {
|
|
ZMQImagePullerStatistics image_puller_stats;
|
|
std::vector<HDF5DataFileStatistics> data_file_stats;
|
|
};
|
|
|
|
class StreamWriter {
|
|
bool running;
|
|
std::mutex m;
|
|
|
|
ZMQImagePuller image_puller;
|
|
Logger &logger;
|
|
StartMessage start_message;
|
|
|
|
void StartDataCollection();
|
|
void CollectImages(std::vector<HDF5DataFileStatistics> &v);
|
|
void EndDataCollection();
|
|
public:
|
|
StreamWriter(ZMQContext& context, Logger &logger, const std::string& zmq_addr, const std::string& repub_address = "");
|
|
StreamWriterStatistics Run();
|
|
std::future<StreamWriterStatistics> RunFuture();
|
|
void Cancel();
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_STREAMWRITER_H
|