Move stream configs to separate file

This commit is contained in:
2020-06-04 11:56:32 +02:00
parent 871030f2d7
commit a6e1c6c84e
4 changed files with 20 additions and 18 deletions
-7
View File
@@ -40,13 +40,6 @@ namespace core_buffer {
const int BUFFER_ZMQ_SNDHWM = 100;
// IPC address of the live stream.
const std::string BUFFER_LIVE_IPC_URL = "ipc:///tmp/sf-live-";
// N of IO threads to receive data from modules.
const int STREAM_ZMQ_IO_THREADS = 4;
// How long should the RECV queue be.
const size_t STREAM_RCVHWM = 100;
// Size of buffer between the receiving and sending part.
const int STREAM_FASTQUEUE_SLOTS = 5;
}
#endif //BUFFERCONFIG_HPP
+9
View File
@@ -0,0 +1,9 @@
namespace stream_config
{
// N of IO threads to receive data from modules.
const int STREAM_ZMQ_IO_THREADS = 4;
// How long should the RECV queue be.
const size_t STREAM_RCVHWM = 100;
// Size of buffer between the receiving and sending part.
const int STREAM_FASTQUEUE_SLOTS = 5;
}
+2
View File
@@ -4,10 +4,12 @@
#include <cstring>
#include "zmq.h"
#include "buffer_config.hpp"
#include "stream_config.hpp"
using namespace std;
using namespace chrono;
using namespace core_buffer;
using namespace stream_config;
LiveRecvModule::LiveRecvModule(
FastQueue<ModuleFrameBuffer>& queue_,
+9 -11
View File
@@ -1,23 +1,24 @@
#include <iostream>
#include <stdexcept>
#include "buffer_config.hpp"
#include <string>
#include <jungfrau.hpp>
#include <thread>
#include <chrono>
#include <FastQueue.hpp>
#include <cstring>
#include <zmq.h>
#include <LiveRecvModule.hpp>
#include "rapidjson/istreamwrapper.h"
#include <fstream>
#include "rapidjson/document.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h"
#include <rapidjson/istreamwrapper.h>
#include <fstream>
#include "FastQueue.hpp"
#include "LiveRecvModule.hpp"
#include "buffer_config.hpp"
#include "stream_config.hpp"
using namespace std;
using namespace core_buffer;
using namespace stream_config;
int main (int argc, char *argv[])
{
@@ -50,8 +51,7 @@ int main (int argc, char *argv[])
size_t n_modules = config_parameters["n_modules"].GetInt();
FastQueue<ModuleFrameBuffer> queue(
n_modules * MODULE_N_BYTES,
STREAM_FASTQUEUE_SLOTS);
n_modules * MODULE_N_BYTES, STREAM_FASTQUEUE_SLOTS);
auto ctx = zmq_ctx_new();
zmq_ctx_set (ctx, ZMQ_IO_THREADS, STREAM_ZMQ_IO_THREADS);
@@ -263,6 +263,4 @@ int main (int argc, char *argv[])
read_max_us = 0;
}
}
return 0;
}