Remove unused methods from the WriterManager

This commit is contained in:
2019-04-25 09:41:09 +02:00
parent e2e49e5e11
commit 179223639e
2 changed files with 13 additions and 20 deletions
+10 -16
View File
@@ -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();
+3 -4
View File
@@ -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.