mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-08-05 04:12:25 +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:
@@ -185,6 +185,19 @@ void ZmqRecvModule::receive_thread(const string& connect_address)
|
||||
}
|
||||
|
||||
char* buffer = ring_buffer_.reserve(frame_metadata);
|
||||
if (buffer == nullptr) {
|
||||
stringstream err_msg;
|
||||
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
err_msg << "[" << system_clock::now() << "]";
|
||||
err_msg << "[UdpRecvModule::receive_thread]";
|
||||
err_msg << " Ring buffer is full.";
|
||||
err_msg << endl;
|
||||
|
||||
throw runtime_error(err_msg.str());
|
||||
}
|
||||
|
||||
memcpy(
|
||||
buffer,
|
||||
static_cast<const char*>(frame_data),
|
||||
|
||||
Reference in New Issue
Block a user