Refactor RamBuffer

This commit is contained in:
2020-09-04 12:31:57 +02:00
parent 15302c8597
commit 4a031d6e62
3 changed files with 62 additions and 18 deletions
+4 -6
View File
@@ -6,8 +6,9 @@
class RamBuffer {
const std::string detector_name_;
const int n_modules_;
const int module_n_;
const size_t n_slots_;
const size_t meta_size_;
const size_t image_size_;
const size_t buffer_size_;
@@ -20,15 +21,12 @@ class RamBuffer {
public:
RamBuffer(const std::string& detector_name,
const size_t n_modules,
const size_t n_slots,
const int n_modules,
const int module_n=0);
~RamBuffer();
void write_frame(const ModuleFrame *src_meta, const char *src_data) const;
void read_image(const uint64_t pulse_id,
ModuleFrame *&dst_meta,
char *&dst_data) const;
char* read_image(const uint64_t pulse_id, ImageMetadata &image_meta) const;
};
+2
View File
@@ -40,6 +40,8 @@ namespace buffer_config {
const int BUFFER_ZMQ_SNDHWM = 100;
// IPC address of the live stream.
const std::string BUFFER_LIVE_IPC_URL = "ipc:///tmp/sf-live-";
// Number of image slots in ram buffer - 10 seconds should be enough
const int RAM_BUFFER_N_SLOTS = 100 * 10;
}
#endif //BUFFERCONFIG_HPP