Started refactoring of WriterManager

This commit is contained in:
2019-03-29 16:47:00 +01:00
parent 3869f27972
commit e6d4f0fa04
2 changed files with 12 additions and 22 deletions
+7 -11
View File
@@ -21,12 +21,9 @@ class WriterManager
{
std::unordered_map<std::string, boost::any> parameters = {};
std::mutex parameters_mutex;
// Initialize in constructor.
const std::unordered_map<std::string, DATA_TYPE>& parameters_type;
std::string output_file;
size_t n_frames;
std::atomic_bool running_flag;
std::atomic_bool killed_flag;
std::atomic<uint64_t> n_received_frames;
@@ -34,27 +31,26 @@ class WriterManager
std::atomic<uint64_t> n_lost_frames;
public:
WriterManager(const std::unordered_map<std::string, DATA_TYPE>& parameters_type, const std::string& output_file, uint64_t n_frames=0);
WriterManager(const std::unordered_map<std::string, DATA_TYPE>& parameters_type);
virtual ~WriterManager();
void start(const std::unordered_map<std::string, boost:any>& parameters);
const std::unordered_map<std::string, DATA_TYPE>& get_parameters_type() const;
void stop();
void kill();
std::string get_status();
std::unordered_map<std::string, uint64_t> get_statistics() const;
bool is_running();
bool is_killed() const;
std::string get_status();
bool are_all_parameters_set();
std::string get_output_file() const;
const std::unordered_map<std::string, DATA_TYPE>& get_parameters_type() const;
std::unordered_map<std::string, boost::any> get_parameters();
void set_parameters(const std::unordered_map<std::string, boost::any>& new_parameters);
std::unordered_map<std::string, uint64_t> get_statistics() const;
void received_frame(size_t frame_index);
void written_frame(size_t frame_index);
void lost_frame(size_t frame_index);
size_t get_n_frames();
};
#endif
#endif