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:
2020-04-21 17:25:22 +02:00
parent 89328f700f
commit 77141a559c
3 changed files with 50 additions and 11 deletions
+1 -11
View File
@@ -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;
}
}