Move configuration closer to writer

This commit is contained in:
2020-06-04 09:33:03 +02:00
parent 7a310f98d5
commit 436a3c43d2
7 changed files with 26 additions and 13 deletions
+2 -8
View File
@@ -24,6 +24,8 @@ namespace core_buffer {
const size_t STATS_MODULO = 100;
// If the RB is empty, how much time to wait before trying to read it again.
const size_t RB_READ_RETRY_INTERVAL_MS = 5;
// How many frames to read at once from file.
const size_t BUFFER_BLOCK_SIZE = 100;
const size_t BUFFER_UDP_N_RECV_MSG = 64;
@@ -45,14 +47,6 @@ namespace core_buffer {
const size_t STREAM_RCVHWM = 100;
// Size of buffer between the receiving and sending part.
const int STREAM_FASTQUEUE_SLOTS = 5;
// How many frames to read at once from file.
const size_t BUFFER_BLOCK_SIZE = 100;
// MS to retry reading from the image assembler.
const size_t WRITER_IMAGE_ASSEMBLER_RETRY_MS = 5;
// Number of slots in the reconstruction buffer.
const size_t WRITER_IA_N_SLOTS = 2;
}
#endif //BUFFERCONFIG_HPP
+1 -1
View File
@@ -4,7 +4,7 @@
#include <memory>
#include <string>
#include <H5Cpp.h>
#include "buffer_config.hpp"
#include "formats.hpp"
class JFH5Writer {
+9
View File
@@ -0,0 +1,9 @@
#include <cstddef>
namespace writer_config
{
// MS to retry reading from the image assembler.
const size_t WRITER_IMAGE_ASSEMBLER_RETRY_MS = 5;
// Number of slots in the reconstruction buffer.
const size_t WRITER_IA_N_SLOTS = 2;
}
+4 -3
View File
@@ -7,8 +7,11 @@
#include <fcntl.h>
#include "BufferUtils.hpp"
#include "writer_config.hpp"
#include "buffer_config.hpp"
using namespace std;
using namespace writer_config;
using namespace core_buffer;
BufferBinaryReader::BufferBinaryReader(
@@ -18,9 +21,7 @@ BufferBinaryReader::BufferBinaryReader(
channel_name_(channel_name),
current_input_file_(""),
input_file_fd_(-1)
{
}
{}
BufferBinaryReader::~BufferBinaryReader()
{
+4
View File
@@ -1,7 +1,11 @@
#include <cstring>
#include "ImageAssembler.hpp"
#include "writer_config.hpp"
#include "buffer_config.hpp"
using namespace std;
using namespace writer_config;
using namespace core_buffer;
ImageAssembler::ImageAssembler(const size_t n_modules) :
+4
View File
@@ -1,8 +1,11 @@
#include "JFH5Writer.hpp"
#include <sstream>
#include <cstring>
#include <hdf5_hl.h>
#include "writer_config.hpp"
#include "buffer_config.hpp"
//extern "C"
//{
@@ -11,6 +14,7 @@
//}
using namespace std;
using namespace writer_config;
using namespace core_buffer;
JFH5Writer::JFH5Writer(const std::string& output_file,
+2 -1
View File
@@ -2,10 +2,10 @@
#include <string>
#include <thread>
#include <chrono>
#include <cstring>
#include "date.h"
#include "zmq.h"
#include "writer_config.hpp"
#include "buffer_config.hpp"
#include "bitshuffle/bitshuffle.h"
#include "JFH5Writer.hpp"
@@ -13,6 +13,7 @@
#include "BufferBinaryReader.hpp"
using namespace std;
using namespace writer_config;
using namespace core_buffer;
using namespace chrono;