From e5157979cad746419eb10acfde2d5170f1cc9aee Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Tue, 2 Jun 2020 14:06:47 +0200 Subject: [PATCH] Change bunch_id to uint64_t --- sf-writer/include/ImageAssembler.hpp | 12 ++++++------ sf-writer/src/ImageAssembler.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sf-writer/include/ImageAssembler.hpp b/sf-writer/include/ImageAssembler.hpp index 83e1f67..38ae694 100644 --- a/sf-writer/include/ImageAssembler.hpp +++ b/sf-writer/include/ImageAssembler.hpp @@ -21,17 +21,17 @@ public: virtual ~ImageAssembler(); - bool is_slot_free(const int bunch_id); - bool is_slot_full(const int bunch_id); + bool is_slot_free(const uint64_t bunch_id); + bool is_slot_full(const uint64_t bunch_id); - void process(int bunch_id, + void process(uint64_t bunch_id, const int i_module, const BufferBinaryBlock* block_buffer); - void free_slot(const int bunch_id); + void free_slot(const uint64_t bunch_id); - ImageMetadataBlock* get_metadata_buffer(const int bunch_id); - char* get_data_buffer(const int bunch_id); + ImageMetadataBlock* get_metadata_buffer(const uint64_t bunch_id); + char* get_data_buffer(const uint64_t bunch_id); }; diff --git a/sf-writer/src/ImageAssembler.cpp b/sf-writer/src/ImageAssembler.cpp index 0582c53..3f09064 100644 --- a/sf-writer/src/ImageAssembler.cpp +++ b/sf-writer/src/ImageAssembler.cpp @@ -25,20 +25,20 @@ ImageAssembler::~ImageAssembler() delete[] meta_buffer_; } -bool ImageAssembler::is_slot_free(const int bunch_id) +bool ImageAssembler::is_slot_free(const uint64_t bunch_id) { auto slot_id = bunch_id % IA_N_SLOTS; return buffer_status_[slot_id].load() > 0; } -bool ImageAssembler::is_slot_full(const int bunch_id) +bool ImageAssembler::is_slot_full(const uint64_t bunch_id) { auto slot_id = bunch_id % IA_N_SLOTS; return buffer_status_[slot_id].load() == 0; } void ImageAssembler::process( - int bunch_id, + const uint64_t bunch_id, const int i_module, const BufferBinaryBlock* block_buffer) { @@ -71,13 +71,13 @@ void ImageAssembler::process( buffer_status_[slot_id].fetch_sub(1); } -void ImageAssembler::free_slot(const int bunch_id) +void ImageAssembler::free_slot(const uint64_t bunch_id) { auto slot_id = bunch_id % IA_N_SLOTS; buffer_status_[slot_id].store(n_modules_); } -ImageMetadataBlock* ImageAssembler::get_metadata_buffer(const int bunch_id) +ImageMetadataBlock* ImageAssembler::get_metadata_buffer(const uint64_t bunch_id) { auto slot_id = bunch_id % IA_N_SLOTS; @@ -92,13 +92,13 @@ ImageMetadataBlock* ImageAssembler::get_metadata_buffer(const int bunch_id) // } } - meta_buffer_[slot_id].pulse_id[i_pulse] + meta_buffer_[slot_id].pulse_id[i_pulse]; } return &(meta_buffer_[slot_id]); } -char* ImageAssembler::get_data_buffer(const int bunch_id) +char* ImageAssembler::get_data_buffer(const uint64_t bunch_id) { auto slot_id = bunch_id % IA_N_SLOTS; return image_buffer_ + (slot_id * image_buffer_slot_n_bytes_);