mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 11:50:44 +02:00
Add new start method to WriterManager
This commit is contained in:
@@ -48,8 +48,8 @@ void writer_utils::create_destination_folder(const string& output_file)
|
||||
}
|
||||
}
|
||||
|
||||
WriterManager::WriterManager(const unordered_map<string, DATA_TYPE>& parameters_type):
|
||||
parameters_type(parameters_type), logs(10),
|
||||
WriterManager::WriterManager():
|
||||
logs(10),
|
||||
writing_flag(false), running_flag(true),
|
||||
n_frames_to_receive(0), n_frames_to_write(0)
|
||||
{
|
||||
@@ -98,7 +98,9 @@ unordered_map<string, boost::any> WriterManager::get_parameters()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
void WriterManager::start(const unordered_map<string, boost::any>& new_parameters)
|
||||
void WriterManager::start(const string output_file,
|
||||
const int n_frames,
|
||||
const int user_id)
|
||||
{
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace writer_utils {
|
||||
struct WriterManagerLog
|
||||
{
|
||||
std::string filename;
|
||||
std::string status;
|
||||
|
||||
uint64_t n_requested_frames;
|
||||
uint64_t n_received_frames;
|
||||
@@ -29,7 +30,6 @@ struct WriterManagerLog
|
||||
class WriterManager
|
||||
{
|
||||
// Initialize in constructor.
|
||||
const std::unordered_map<std::string, DATA_TYPE>& parameters_type;
|
||||
const std::deque<WriterManagerLog> logs;
|
||||
|
||||
std::atomic<bool> writing_flag;
|
||||
@@ -39,11 +39,12 @@ class WriterManager
|
||||
std::atomic<int64_t> n_frames_to_write;
|
||||
|
||||
public:
|
||||
WriterManager(const std::unordered_map<std::string, DATA_TYPE>& parameters_type);
|
||||
WriterManager();
|
||||
virtual ~WriterManager();
|
||||
|
||||
void start(const std::unordered_map<std::string, boost::any>& new_parameters);
|
||||
void start(std::string output_file, int n_frames, int user_id);
|
||||
void stop();
|
||||
|
||||
std::string get_status();
|
||||
std::unordered_map<std::string, uint64_t> get_statistics() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user