Provides scoped access to a GenTL buffer and requeues it on destruction. More...
#include <peak/buffer/peak_buffer_guard.hpp>
Public Member Functions | |
| BufferGuard (std::shared_ptr< core::Buffer > buffer) | |
| Creates a buffer guard for the given buffer. | |
| ~BufferGuard () | |
| Requeues the guarded buffer. | |
| BufferGuard (const BufferGuard &other)=delete | |
| BufferGuard & | operator= (const BufferGuard &other)=delete |
| BufferGuard (BufferGuard &&other) noexcept=default | |
| BufferGuard & | operator= (BufferGuard &&other) noexcept=default |
| PEAK_COMMON_NO_DISCARD std::shared_ptr< core::Buffer > | Buffer () const |
| Returns the guarded buffer. | |
| PEAK_COMMON_NO_DISCARD core::Buffer * | operator-> () const |
| Returns the guarded buffer. | |
Provides scoped access to a GenTL buffer and requeues it on destruction.
This class holds a reference to a Buffer while it is being processed. When the guard is destroyed, the buffer is automatically requeued to the data stream.
|
inlineexplicit |
Creates a buffer guard for the given buffer.
The buffer is requeued when this guard is destroyed.
| [in] | buffer | The buffer to guard. |
| InvalidArgumentException | If the provided buffer is nullptr. |
|
inline |
Requeues the guarded buffer.
|
delete |
|
defaultnoexcept |
|
inline |
Returns the guarded buffer.
|
inline |
Returns the guarded buffer.
|
defaultnoexcept |
|
delete |