mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-30 08:02:23 +02:00
Const correctness enforcement
This commit is contained in:
+4
-4
@@ -12,7 +12,7 @@ extern "C"
|
||||
|
||||
using namespace std;
|
||||
|
||||
H5Writer::H5Writer(const std::string filename, const std::string dataset_name,
|
||||
H5Writer::H5Writer(const std::string& filename, const std::string& dataset_name,
|
||||
hsize_t frames_per_file, hsize_t initial_dataset_size, hsize_t dataset_increase_step) :
|
||||
filename(filename), dataset_name(dataset_name), frames_per_file(frames_per_file),
|
||||
initial_dataset_size(initial_dataset_size), dataset_increase_step(dataset_increase_step)
|
||||
@@ -74,7 +74,7 @@ void H5Writer::close_file()
|
||||
max_frame_index = 0;
|
||||
}
|
||||
|
||||
void H5Writer::write_frame_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, string data_type, string endianness)
|
||||
void H5Writer::write_frame_data(size_t frame_index, const size_t* frame_shape, size_t data_bytes_size, const char* data, const string& data_type, const string& endianness)
|
||||
{
|
||||
// Define the ofset of the currently received image in the file.
|
||||
hsize_t relative_frame_index = prepare_storage_for_frame(frame_index, frame_shape, data_type, endianness);
|
||||
@@ -92,7 +92,7 @@ void H5Writer::write_frame_data(size_t frame_index, size_t* frame_shape, size_t
|
||||
}
|
||||
}
|
||||
|
||||
void H5Writer::create_file(size_t* frame_shape, hsize_t frame_chunk, string& type, string& endianness)
|
||||
void H5Writer::create_file(const size_t* frame_shape, hsize_t frame_chunk, const string& type, const string& endianness)
|
||||
{
|
||||
|
||||
if (file.getId() != -1) {
|
||||
@@ -162,7 +162,7 @@ bool H5Writer::is_file_open()
|
||||
return (file.getId() != -1);
|
||||
}
|
||||
|
||||
hsize_t H5Writer::prepare_storage_for_frame(size_t frame_index, size_t* frame_shape, string& data_type, string& endianness)
|
||||
hsize_t H5Writer::prepare_storage_for_frame(size_t frame_index, const size_t* frame_shape, const string& data_type, const string& endianness)
|
||||
{
|
||||
|
||||
hsize_t relative_frame_index = frame_index;
|
||||
|
||||
Reference in New Issue
Block a user