Holds a Span of AsyncBufferView (allocated by user) holding available memory for the streams. More...
#include <AsyncStreams.h>
Public Member Functions | |
void | refBuffer (AsyncBufferView::ID bufferID) |
Increments a buffer reference count. More... | |
void | unrefBuffer (AsyncBufferView::ID bufferID) |
Decrements a buffer reference count. More... | |
Result | getData (AsyncBufferView::ID bufferID, Span< const char > &data) |
Access data span owned by the buffer. More... | |
Result | getData (AsyncBufferView::ID bufferID, Span< char > &data) |
Access data span owned by the buffer. More... | |
AsyncBufferView * | getBuffer (AsyncBufferView::ID bufferID) |
Access the raw AsyncBufferView (if any) at a given bufferID (or nullptr if invalid) More... | |
Result | requestNewBuffer (size_t minimumSizeInBytes, AsyncBufferView::ID &bufferID, Span< char > &data) |
Requests a new available buffer that is at least minimumSizeInBytes, incrementing its refcount. More... | |
void | setNewBufferSize (AsyncBufferView::ID bufferID, size_t newSizeInBytes) |
Sets the new size in bytes for the buffer. More... | |
Public Attributes | |
Span< AsyncBufferView > | buffers |
Span of buffers to be filled in by the user. More... | |
Holds a Span of AsyncBufferView (allocated by user) holding available memory for the streams.
Span
of AsyncBufferView AsyncBufferView * SC::AsyncBuffersPool::getBuffer | ( | AsyncBufferView::ID | bufferID | ) |
Access the raw AsyncBufferView (if any) at a given bufferID (or nullptr if invalid)
Result SC::AsyncBuffersPool::getData | ( | AsyncBufferView::ID | bufferID, |
Span< char > & | data | ||
) |
Access data span owned by the buffer.
Result SC::AsyncBuffersPool::getData | ( | AsyncBufferView::ID | bufferID, |
Span< const char > & | data | ||
) |
Access data span owned by the buffer.
void SC::AsyncBuffersPool::refBuffer | ( | AsyncBufferView::ID | bufferID | ) |
Increments a buffer reference count.
Result SC::AsyncBuffersPool::requestNewBuffer | ( | size_t | minimumSizeInBytes, |
AsyncBufferView::ID & | bufferID, | ||
Span< char > & | data | ||
) |
Requests a new available buffer that is at least minimumSizeInBytes, incrementing its refcount.
void SC::AsyncBuffersPool::setNewBufferSize | ( | AsyncBufferView::ID | bufferID, |
size_t | newSizeInBytes | ||
) |
Sets the new size in bytes for the buffer.
void SC::AsyncBuffersPool::unrefBuffer | ( | AsyncBufferView::ID | bufferID | ) |
Decrements a buffer reference count.
When reference count becomes zero the buffer will be re-used
Span<AsyncBufferView> SC::AsyncBuffersPool::buffers |
Span of buffers to be filled in by the user.