ucommon  7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
  Fossies Dox: ucommon-7.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
ucommon::PagerPool Class Reference

Pager pool base class for managed memory pools. More...

#include <memory.h>

Inheritance diagram for ucommon::PagerPool:
[legend]
Collaboration diagram for ucommon::PagerPool:
[legend]

Public Member Functions

void put (PagerObject *object)
 Return a pager object back to our free list. More...
 

Protected Member Functions

 PagerPool ()
 
virtual ~PagerPool ()
 
PagerObjectget (size_t size)
 

Private Member Functions

 __DELETE_COPY (PagerPool)
 

Private Attributes

LinkedObjectfreelist
 
pthread_mutex_t mutex
 

Detailed Description

Pager pool base class for managed memory pools.

This is a helper base class for the pager template and generally is not used by itself. If different type pools are intended to use a common memory pager then you will need to mixin a memory protocol object that performs redirection such as the MemoryRedirect class.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 824 of file memory.h.

Constructor & Destructor Documentation

◆ PagerPool()

ucommon::PagerPool::PagerPool ( )
protected

Definition at line 926 of file memory.cpp.

References freelist, and mutex.

◆ ~PagerPool()

ucommon::PagerPool::~PagerPool ( )
protectedvirtual

Definition at line 932 of file memory.cpp.

References mutex.

Member Function Documentation

◆ __DELETE_COPY()

ucommon::PagerPool::__DELETE_COPY ( PagerPool  )
private

◆ get()

PagerObject * ucommon::PagerPool::get ( size_t  size)
protected

Definition at line 946 of file memory.cpp.

References freelist, mutex, ucommon::LinkedObject::Next, ucommon::PagerObject::pager, and ucommon::PagerObject::reset().

Referenced by ucommon::pager< T >::operator()(), and ucommon::pager< T >::operator*().

Here is the call graph for this function:

◆ put()

void ucommon::PagerPool::put ( PagerObject object)

Return a pager object back to our free list.

Parameters
objectto return to pool.

Definition at line 937 of file memory.cpp.

References ucommon::LinkedObject::enlist(), freelist, and mutex.

Referenced by ucommon::PagerObject::dealloc().

Here is the call graph for this function:

Member Data Documentation

◆ freelist

LinkedObject* ucommon::PagerPool::freelist
private

Definition at line 827 of file memory.h.

Referenced by get(), PagerPool(), and put().

◆ mutex

pthread_mutex_t ucommon::PagerPool::mutex
mutableprivate

Definition at line 828 of file memory.h.

Referenced by get(), PagerPool(), put(), and ~PagerPool().


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