From 35270ca2fab9684f41f098a2eabbf4d4be8312f7 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Sun, 21 Jan 2018 15:12:25 +0100 Subject: [PATCH] H5Writer refactoring --- src/H5Writer.cpp | 2 +- src/H5Writer.hpp | 2 +- src/h5_zmq_writer.cpp | 15 ++++++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/H5Writer.cpp b/src/H5Writer.cpp index dc5226b..ec35f2d 100644 --- a/src/H5Writer.cpp +++ b/src/H5Writer.cpp @@ -71,7 +71,7 @@ void H5Writer::close_file() max_frame_index = 0; } -void H5Writer::write_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, size_t* frame_shape, size_t data_bytes_size, char* data, string data_type, 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); diff --git a/src/H5Writer.hpp b/src/H5Writer.hpp index 3e2f299..5372f03 100644 --- a/src/H5Writer.hpp +++ b/src/H5Writer.hpp @@ -32,7 +32,7 @@ class H5Writer ~H5Writer(); bool is_file_open(); void close_file(); - void write_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, std::string data_type, std::string endianness); + void write_frame_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, std::string data_type, std::string endianness); H5::H5File& get_h5_file(); }; diff --git a/src/h5_zmq_writer.cpp b/src/h5_zmq_writer.cpp index 605563f..536b212 100644 --- a/src/h5_zmq_writer.cpp +++ b/src/h5_zmq_writer.cpp @@ -5,7 +5,6 @@ #include #include #include - #include "config.hpp" #include "WriterManager.hpp" @@ -14,8 +13,6 @@ #include "rest_interface.hpp" #include "h5_utils.hpp" - - using namespace std; namespace pt = boost::property_tree; @@ -38,12 +35,12 @@ void write_h5(WriterManager *manager, RingBuffer *ring_buffer, string output_fil continue; } - writer.write_data(received_data.first.frame_index, - received_data.first.frame_shape, - received_data.first.frame_bytes_size, - received_data.second, - received_data.first.type, - received_data.first.endianness); + writer.write_frame_data(received_data.first.frame_index, + received_data.first.frame_shape, + received_data.first.frame_bytes_size, + received_data.second, + received_data.first.type, + received_data.first.endianness); ring_buffer->release(received_data.first.buffer_slot_index);