mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 10:20:45 +02:00
Add start_writing method to H5WriteModule
This commit is contained in:
@@ -14,6 +14,32 @@ H5WriteModule::H5WriteModule(
|
||||
{
|
||||
}
|
||||
|
||||
void H5WriteModule::start_writing()
|
||||
{
|
||||
if (is_writing_ == true) {
|
||||
stringstream err_msg;
|
||||
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
err_msg << "[" << system_clock::now() << "]";
|
||||
err_msg << "[H5WriteModule::start_writing]";
|
||||
err_msg << " Writer already running." << endl;
|
||||
|
||||
throw runtime_error(err_msg.str());
|
||||
}
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
cout << "[" << system_clock::now() << "]";
|
||||
cout << "[H5WriteModule::start_writing]";
|
||||
cout << " Start writing." << endl;
|
||||
#endif
|
||||
|
||||
is_writing_ = true;
|
||||
writing_thread_ = thread(&H5WriteModule::write_thread, this);
|
||||
}
|
||||
|
||||
void H5WriteModule::stop_writing()
|
||||
{
|
||||
#ifdef DEBUG_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user