mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-09 14:32:04 +02:00
Remove unused methods from the WriterManager
This commit is contained in:
+10
-16
@@ -2,6 +2,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "WriterManager.hpp"
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -86,17 +87,14 @@ string WriterManager::get_status()
|
||||
|
||||
unordered_map<string, uint64_t> WriterManager::get_statistics() const
|
||||
{
|
||||
unordered_map<string, uint64_t> result = {{"n_received_frames", n_received_frames.load()},
|
||||
{"n_written_frames", n_written_frames.load()},
|
||||
{"n_lost_frames", n_lost_frames.load()}};
|
||||
unordered_map<string, uint64_t> result = {
|
||||
{"n_frames_receive", n_frames_to_receive.load()},
|
||||
{"n_frames_to_write", n_frames_to_write.load()}
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
unordered_map<string, boost::any> WriterManager::get_parameters()
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
|
||||
void WriterManager::start(const string output_file,
|
||||
const int n_frames,
|
||||
@@ -119,21 +117,17 @@ void WriterManager::start(const string output_file,
|
||||
cout << output_message.str() << endl;
|
||||
#endif
|
||||
|
||||
uint64_t n_frames = 100;
|
||||
string output_file = "output_file";
|
||||
|
||||
|
||||
n_frames_to_write = n_frames;
|
||||
writing_flag = true;
|
||||
|
||||
n_frames_to_receive = n_frames;
|
||||
receiving_flag = true;
|
||||
|
||||
boost::thread writer_thread(&ProcessManager::write_h5, this, output_file, n_frames);
|
||||
|
||||
//TODO: Sent this event somewhere?
|
||||
}
|
||||
|
||||
const unordered_map<string, DATA_TYPE>& WriterManager::get_parameters_type() const
|
||||
{
|
||||
return parameters_type;
|
||||
}
|
||||
|
||||
bool WriterManager::is_running()
|
||||
{
|
||||
return running_flag.load();
|
||||
|
||||
@@ -32,9 +32,11 @@ class WriterManager
|
||||
// Initialize in constructor.
|
||||
const std::deque<WriterManagerLog> logs;
|
||||
|
||||
std::atomic<bool> writing_flag;
|
||||
std::atomic<bool> running_flag;
|
||||
|
||||
std::atomic<bool> writing_flag;
|
||||
std::atomic<bool> receiving_flag;
|
||||
|
||||
std::atomic<int64_t> n_frames_to_receive;
|
||||
std::atomic<int64_t> n_frames_to_write;
|
||||
|
||||
@@ -48,9 +50,6 @@ class WriterManager
|
||||
std::string get_status();
|
||||
std::unordered_map<std::string, uint64_t> get_statistics() const;
|
||||
|
||||
std::unordered_map<std::string, boost::any> get_parameters();
|
||||
const std::unordered_map<std::string, DATA_TYPE>& get_parameters_type() const;
|
||||
|
||||
// Return True if the frame is to be received, False if is to be dropped.
|
||||
bool receive_frame();
|
||||
// True if the process should conitnue.
|
||||
|
||||
Reference in New Issue
Block a user