BufferPool Class Reference

Space-ng SDK: sol3::net::BufferPool Class Reference
Space-ng SDK
sol3::net::BufferPool Class Reference

#include <sol3/net/buffer_pool.h>

Public Member Functions

 BufferPool (std::size_t reserve_bytes)
 
 BufferPool (BufferPool const &)=delete
 
BufferPooloperator= (BufferPool const &)=delete
 
 BufferPool (BufferPool &&)=delete
 
BufferPooloperator= (BufferPool &&)=delete
 
 ~BufferPool ()=default
 
std::shared_ptr< std::vector< uint8_t > > acquire ()
 

Detailed Description

A thread-safe pool for reusing heap-allocated byte vectors, by handing out shared_ptrs with a custom deleter.

Vectors may outlive the pool instance safely.

Constructor & Destructor Documentation

◆ BufferPool() [1/3]

sol3::net::BufferPool::BufferPool ( std::size_t  reserve_bytes)
explicit

◆ BufferPool() [2/3]

sol3::net::BufferPool::BufferPool ( BufferPool const &  )
delete

◆ BufferPool() [3/3]

sol3::net::BufferPool::BufferPool ( BufferPool &&  )
delete

◆ ~BufferPool()

sol3::net::BufferPool::~BufferPool ( )
default

Member Function Documentation

◆ acquire()

std::shared_ptr<std::vector<uint8_t> > sol3::net::BufferPool::acquire ( )

◆ operator=() [1/2]

BufferPool& sol3::net::BufferPool::operator= ( BufferPool &&  )
delete

◆ operator=() [2/2]

BufferPool& sol3::net::BufferPool::operator= ( BufferPool const &  )
delete

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