xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdEc::BufferPool Class Reference

Pool of buffer for caching writes. More...

#include <XrdEcWrtBuff.hh>

Public Member Functions

XrdCl::Buffer Create (const ObjCfg &objcfg)
 Create now buffer (or recycle existing one)
 
void Recycle (XrdCl::Buffer &&buffer)
 Give back a buffer to the poool.
 

Static Public Member Functions

static BufferPoolInstance ()
 Singleton access to the object.
 

Private Member Functions

 BufferPool ()
 
 BufferPool (const BufferPool &)=delete
 
 BufferPool (BufferPool &&)=delete
 
BufferPooloperator= (const BufferPool &)=delete
 
BufferPooloperator= (BufferPool &&)=delete
 

Private Attributes

const size_t totalsize
 
size_t currentsize
 
std::condition_variable cv
 
std::mutex mtx
 
std::queue< XrdCl::Bufferpool
 

Detailed Description

Pool of buffer for caching writes.

Constructor & Destructor Documentation

◆ BufferPool() [1/3]

XrdEc::BufferPool::BufferPool ( )
inlineprivate

◆ BufferPool() [2/3]

XrdEc::BufferPool::BufferPool ( const BufferPool )
privatedelete

◆ BufferPool() [3/3]

XrdEc::BufferPool::BufferPool ( BufferPool &&  )
privatedelete

Member Function Documentation

◆ Create()

XrdCl::Buffer XrdEc::BufferPool::Create ( const ObjCfg objcfg)
inline

Create now buffer (or recycle existing one)

References XrdEc::ObjCfg::blksize, currentsize, cv, mtx, pool, and totalsize.

◆ Instance()

static BufferPool & XrdEc::BufferPool::Instance ( )
inlinestatic

Singleton access to the object.

Referenced by XrdEc::WrtBuff::~WrtBuff().

◆ operator=() [1/2]

BufferPool & XrdEc::BufferPool::operator= ( BufferPool &&  )
privatedelete

◆ operator=() [2/2]

BufferPool & XrdEc::BufferPool::operator= ( const BufferPool )
privatedelete

◆ Recycle()

void XrdEc::BufferPool::Recycle ( XrdCl::Buffer &&  buffer)
inline

Give back a buffer to the poool.

References cv, mtx, and pool.

Referenced by XrdEc::WrtBuff::~WrtBuff().

Member Data Documentation

◆ currentsize

size_t XrdEc::BufferPool::currentsize
private

Referenced by Create().

◆ cv

std::condition_variable XrdEc::BufferPool::cv
private

Referenced by Create(), and Recycle().

◆ mtx

std::mutex XrdEc::BufferPool::mtx
private

Referenced by Create(), and Recycle().

◆ pool

std::queue<XrdCl::Buffer> XrdEc::BufferPool::pool
private

Referenced by Create(), and Recycle().

◆ totalsize

const size_t XrdEc::BufferPool::totalsize
private

Referenced by Create().


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