mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-09 07:32:04 +02:00
Ringbuffer returns nullptr when the buffer is full
This feature will allow us to make a push/pull mechanism for the sf_h5_writer. All classes using RingBuffer have been updated to maintain the exact same behaviour as before.
This commit is contained in:
@@ -132,17 +132,7 @@ char* RingBuffer<T>::reserve(shared_ptr<T> frame_metadata)
|
||||
buffer_used_slots_++;
|
||||
|
||||
} else {
|
||||
stringstream err_msg;
|
||||
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
err_msg << "[" << system_clock::now() << "]";
|
||||
err_msg << "[RingBuffer::reserve]";
|
||||
err_msg << " Ring buffer is full.";
|
||||
err_msg << " Collision at write_index = " << write_index_;
|
||||
err_msg << endl;
|
||||
|
||||
throw runtime_error(err_msg.str());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user