Ardour  9.0-pre0-582-g084a23a80d
PBD::Pool Class Reference

#include <pool.h>

Inheritance diagram for PBD::Pool:
[legend]

Public Member Functions

 Pool (std::string name, unsigned long item_size, unsigned long nitems, PoolDumpCallback cb=NULL)
 
virtual ~Pool ()
 
virtual void * alloc ()
 
virtual void release (void *)
 
std::string name () const
 
guint available () const
 
guint used () const
 
guint total () const
 

Protected Attributes

PBD::RingBuffer< void * > free_list
 a list of pointers to free items within block More...
 
std::string _name
 

Private Attributes

void * _block
 data storage area More...
 
PoolDumpCallback _dump
 callback to print pool contents More...
 
unsigned long max_usage
 

Detailed Description

A pool of data items that can be allocated, read from and written to without system memory allocation or locking.

Definition at line 39 of file pool.h.

Constructor & Destructor Documentation

◆ Pool()

PBD::Pool::Pool ( std::string  name,
unsigned long  item_size,
unsigned long  nitems,
PoolDumpCallback  cb = NULL 
)

◆ ~Pool()

virtual PBD::Pool::~Pool ( )
virtual

Member Function Documentation

◆ alloc()

virtual void* PBD::Pool::alloc ( )
virtual

◆ available()

guint PBD::Pool::available ( ) const
inline

Definition at line 52 of file pool.h.

◆ name()

std::string PBD::Pool::name ( ) const
inline

Definition at line 48 of file pool.h.

◆ release()

virtual void PBD::Pool::release ( void *  )
virtual

◆ total()

guint PBD::Pool::total ( ) const
inline

Definition at line 60 of file pool.h.

◆ used()

guint PBD::Pool::used ( ) const
inline

Definition at line 56 of file pool.h.

Member Data Documentation

◆ _block

void* PBD::Pool::_block
private

data storage area

Definition at line 71 of file pool.h.

◆ _dump

PoolDumpCallback PBD::Pool::_dump
private

callback to print pool contents

Definition at line 72 of file pool.h.

◆ _name

std::string PBD::Pool::_name
protected

Definition at line 68 of file pool.h.

◆ free_list

PBD::RingBuffer<void*> PBD::Pool::free_list
protected

a list of pointers to free items within block

Definition at line 66 of file pool.h.

◆ max_usage

unsigned long PBD::Pool::max_usage
private

Definition at line 74 of file pool.h.


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