Add buffering to replay

This commit is contained in:
2020-05-19 09:28:50 +02:00
parent 5483fe0ea2
commit 78c3ae0262
3 changed files with 78 additions and 38 deletions
+8 -1
View File
@@ -4,6 +4,7 @@
#include <string>
#include "jungfrau.hpp"
#include <H5Cpp.h>
#include <memory>
class ReplayH5Reader {
@@ -16,7 +17,13 @@ class ReplayH5Reader {
H5::DataSet dset_metadata_;
H5::DataSet dset_frame_;
void prepare_file_for_pulse(const uint64_t pulse_id);
std::unique_ptr<char[]> frame_buffer = make_unique<char[]>(
MODULE_N_BYTES * REPLAY_READ_BUFFER_SIZE);
std::unique_ptr<char[]> metadata_buffer = make_unique<char[]>(
sizeof(ModuleFrame) * FILE_MOD);
uint64_t buffer_start_pulse_id_ = 0;
uint64_t buffer_end_pulse_id_ = 0;
void prepare_buffer_for_pulse(const uint64_t pulse_id);
public:
ReplayH5Reader(const std::string device, const std::string channel_name);
+2
View File
@@ -32,6 +32,8 @@ namespace core_buffer {
const std::string REPLAY_STREAM_IPC_URL = "ipc:///tmp/sf-replay-";
const size_t REPLAY_READ_BUFFER_SIZE = 100;
const size_t BUFFER_UDP_N_RECV_MSG = 64;
// Size of UDP recv buffer