Condy v1.5.0
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.
size_t capacity () const
 Get the capacity of the buffer pool.
size_t buffer_size () const
 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<int, ProvidedBuffer> When pass 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 433 of file provided_buffers.hpp.

Constructor & Destructor Documentation

◆ ProvidedBufferPool()

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 444 of file provided_buffers.hpp.


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