Change bunch_id to uint64_t

This commit is contained in:
2020-06-02 14:06:47 +02:00
parent b1cba5633f
commit e5157979ca
2 changed files with 13 additions and 13 deletions
+6 -6
View File
@@ -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);
};
+7 -7
View File
@@ -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_);