H5Writer refactoring

This commit is contained in:
2018-01-21 15:12:25 +01:00
parent 0a13643ac1
commit 35270ca2fa
3 changed files with 8 additions and 11 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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();
};
+6 -9
View File
@@ -5,7 +5,6 @@
#include <thread>
#include <chrono>
#include <boost/property_tree/json_parser.hpp>
#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);