Condy v1.8
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
condy::ProvidedBufferPool Class Reference

Provided buffer pool. More...

#include <provided_buffers.hpp>

Public Member Functions

 ProvidedBufferPool (uint32_t num_buffers, size_t buffer_size, unsigned int flags=0)
 Construct a new ProvidedBufferPool object in current Runtime.
 ProvidedBufferPool (Runtime &runtime, uint32_t num_buffers, size_t buffer_size, unsigned int flags=0)
 Construct a new Provided Buffer Pool object with specified Runtime.
 ProvidedBufferPool (void *buffer_data, uint32_t num_buffers, size_t buffer_size, unsigned int flags=0)
 Construct with externally provided buffer memory.
 ProvidedBufferPool (Runtime &runtime, void *buffer_data, uint32_t num_buffers, size_t buffer_size, unsigned int flags=0)
 Construct with externally provided buffer memory and specified Runtime.
size_t capacity () const noexcept
 Get the capacity of the buffer pool.
size_t buffer_size () const noexcept
 Get the size of each buffer in the pool.

Detailed Description

Provided buffer pool.

A provided buffer pool manages a pool of buffers that can be used in asynchronous operations. Only receiving operations can obtain buffers from the pool.

Returns
std::pair<int32_t, ProvidedBuffer> When passed to async operations, the return type will be a pair of the operation result and the ProvidedBuffer.
Note
The lifetime of this pool must not exceed the running period of the associated Runtime, and the lifetime of any ProvidedBuffer obtained from this pool must not exceed the lifetime of this pool.

Definition at line 395 of file provided_buffers.hpp.

Constructor & Destructor Documentation

◆ ProvidedBufferPool() [1/4]

condy::ProvidedBufferPool::ProvidedBufferPool ( uint32_t num_buffers,
size_t buffer_size,
unsigned int flags = 0 )
inline

Construct a new ProvidedBufferPool object in current Runtime.

Parameters
num_buffersNumber of buffers to allocate in the pool.
buffer_sizeSize of each buffer in bytes.
flagsOptional flags for io_uring buffer registration (default: 0).

Definition at line 404 of file provided_buffers.hpp.

◆ ProvidedBufferPool() [2/4]

condy::ProvidedBufferPool::ProvidedBufferPool ( Runtime & runtime,
uint32_t num_buffers,
size_t buffer_size,
unsigned int flags = 0 )
inline

Construct a new Provided Buffer Pool object with specified Runtime.

Parameters
runtimeThe Runtime to associate with this buffer pool.
num_buffersNumber of buffers to allocate in the pool.
buffer_sizeSize of each buffer in bytes.
flagsOptional flags for io_uring buffer registration (default: 0).

Definition at line 418 of file provided_buffers.hpp.

◆ ProvidedBufferPool() [3/4]

condy::ProvidedBufferPool::ProvidedBufferPool ( void * buffer_data,
uint32_t num_buffers,
size_t buffer_size,
unsigned int flags = 0 )
inline

Construct with externally provided buffer memory.

Parameters
buffer_dataPointer to externally allocated buffer memory.
num_buffersNumber of buffers in the pool.
buffer_sizeSize of each buffer in bytes.
flagsOptional flags for io_uring buffer registration.

Definition at line 433 of file provided_buffers.hpp.

◆ ProvidedBufferPool() [4/4]

condy::ProvidedBufferPool::ProvidedBufferPool ( Runtime & runtime,
void * buffer_data,
uint32_t num_buffers,
size_t buffer_size,
unsigned int flags = 0 )
inline

Construct with externally provided buffer memory and specified Runtime.

Parameters
runtimeThe Runtime to associate with this buffer pool.
buffer_dataPointer to externally allocated buffer memory.
num_buffersNumber of buffers in the pool.
buffer_sizeSize of each buffer in bytes.
flagsOptional flags for io_uring buffer registration.

Definition at line 447 of file provided_buffers.hpp.


The documentation for this class was generated from the following file: