xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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) More...
 
void Recycle (XrdCl::Buffer &&buffer)
 Give back a buffer to the poool. More...
 

Static Public Member Functions

static BufferPoolInstance ()
 Singleton access to the object. More...
 

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

XrdEc::BufferPool::BufferPool ( )
inlineprivate
XrdEc::BufferPool::BufferPool ( const BufferPool )
privatedelete
XrdEc::BufferPool::BufferPool ( BufferPool &&  )
privatedelete

Member Function Documentation

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.

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

Singleton access to the object.

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

BufferPool& XrdEc::BufferPool::operator= ( const BufferPool )
privatedelete
BufferPool& XrdEc::BufferPool::operator= ( BufferPool &&  )
privatedelete
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

size_t XrdEc::BufferPool::currentsize
private

Referenced by Create().

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

Referenced by Create(), and Recycle().

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

Referenced by Create(), and Recycle().

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

Referenced by Create(), and Recycle().

const size_t XrdEc::BufferPool::totalsize
private

Referenced by Create().


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