|
join 1.0
lightweight network framework library
|
pool of buffers provided to the I/O backend. More...
#include <io_ring_buffer.hpp>
Public Member Functions | |
| IoRingBuffer () noexcept=default | |
| create instance. | |
| IoRingBuffer (const IoRingBuffer &other)=delete | |
| copy constructor. | |
| IoRingBuffer & | operator= (const IoRingBuffer &other)=delete |
| copy assignment operator. | |
| ~IoRingBuffer () | |
| destroy instance. | |
| template<size_t Count, size_t Size> | |
| int | registerBuffer (uint16_t group, LocalMem::Allocator< Count, Size > &arena) |
| provide the arena buffers to the backend. | |
| int | unregisterBuffer () noexcept |
| withdraw the buffers and give them back to the arena. | |
| int | select () noexcept |
| take a free buffer. | |
| void | recycle (uint16_t bid) noexcept |
| give a buffer back. | |
| void | bind () noexcept |
| bind an operation to this buffer ring. | |
| void | unbind () noexcept |
| unbind an operation from this buffer ring. | |
| bool | armed () const noexcept |
| check whether operations are still bound to this buffer ring. | |
| void * | get (uint16_t bid) const noexcept |
| get the address of a buffer. | |
| uint16_t | group () const noexcept |
| get the buffer group id. | |
| uint32_t | size () const noexcept |
| get the size of a buffer. | |
| uint16_t | count () const noexcept |
| get the number of buffers. | |
pool of buffers provided to the I/O backend.
|
defaultnoexcept |
create instance.
|
delete |
copy constructor.
| other | other object to copy. |
|
inline |
destroy instance.
|
inlinenoexcept |
check whether operations are still bound to this buffer ring.
|
inlinenoexcept |
bind an operation to this buffer ring.
|
inlinenoexcept |
get the number of buffers.
|
inlinenoexcept |
get the address of a buffer.
| bid | buffer index. |
|
inlinenoexcept |
get the buffer group id.
|
delete |
copy assignment operator.
| other | other object to copy. |
|
inlinenoexcept |
give a buffer back.
| bid | buffer index. |
| int join::IoRingBuffer::registerBuffer | ( | uint16_t | group, |
| LocalMem::Allocator< Count, Size > & | arena ) |
provide the arena buffers to the backend.
| group | buffer group id. |
| arena | arena owning the buffers, reserved until unregistered, must outlive this object. |
| std::system_error | if the descriptor ring cannot be mapped. |
MIT License
Copyright (c) 2026 Mathieu Rabine
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
inlinenoexcept |
take a free buffer.
|
inlinenoexcept |
get the size of a buffer.
|
inlinenoexcept |
unbind an operation from this buffer ring.
|
inlinenoexcept |
withdraw the buffers and give them back to the arena.