#include <PagePool.h>

Collaboration diagram for Ipc::Mem::PagePool:

Public Types

typedef Ipc::Mem::Owner
< PageStack
Owner
 

Public Member Functions

 PagePool (const char *const id)
 
unsigned int capacity () const
 
size_t pageSize () const
 
unsigned int size () const
 lower bound for the number of free pages More...
 
size_t level () const
 approximate number of shared memory pages used now More...
 
size_t level (const int purpose) const
 approximate number of shared memory pages used now for given purpose More...
 
bool get (const PageId::Purpose purpose, PageId &page)
 sets page ID and returns true unless no free pages are found More...
 
void put (PageId &page)
 makes identified page available as a free page to future get() callers More...
 
char * pagePointer (const PageId &page)
 converts page handler into a temporary writeable shared memory pointer More...
 

Static Public Member Functions

static OwnerInit (const char *const id, const unsigned int capacity, const size_t pageSize)
 

Private Types

typedef std::atomic< size_tLevels_t
 

Private Attributes

Ipc::Mem::Pointer< PageStackpageIndex
 free pages index More...
 
Levels_t *const theLevels
 number of shared memory pages used now for each purpose More...
 
char *const theBuf
 pages storage More...
 

Detailed Description

Atomic container of shared memory pages. Implemented using a collection of Segments, each with a PageStack index of free pages. All pools must be created by a single process.

Definition at line 25 of file PagePool.h.

Member Typedef Documentation

typedef std::atomic<size_t> Ipc::Mem::PagePool::Levels_t
private

Definition at line 52 of file PagePool.h.

Definition at line 28 of file PagePool.h.

Constructor & Destructor Documentation

Ipc::Mem::PagePool::PagePool ( const char *const  id)

Definition at line 27 of file PagePool.cc.

Member Function Documentation

unsigned int Ipc::Mem::PagePool::capacity ( ) const
inline

Definition at line 34 of file PagePool.h.

References pageIndex.

Referenced by Init(), and level().

bool Ipc::Mem::PagePool::get ( const PageId::Purpose  purpose,
PageId page 
)

Definition at line 44 of file PagePool.cc.

References Ipc::Mem::PageId::maxPurpose, Must, and Ipc::Mem::PageId::purpose.

Referenced by Ipc::Mem::GetPage().

Ipc::Mem::PagePool::Owner * Ipc::Mem::PagePool::Init ( const char *const  id,
const unsigned int  capacity,
const size_t  pageSize 
)
static

Definition at line 19 of file PagePool.cc.

References capacity(), pageSize(), and shm_new.

Referenced by SharedMemPagesRr::create().

size_t Ipc::Mem::PagePool::level ( ) const
inline

Definition at line 39 of file PagePool.h.

References capacity(), and size().

Referenced by Ipc::Mem::PageLevel().

size_t Ipc::Mem::PagePool::level ( const int  purpose) const

Definition at line 37 of file PagePool.cc.

References Ipc::Mem::PageId::maxPurpose, and Must.

char * Ipc::Mem::PagePool::pagePointer ( const PageId page)

Definition at line 68 of file PagePool.cc.

References Must, and Ipc::Mem::PageId::number.

Referenced by Ipc::Mem::PagePointer().

size_t Ipc::Mem::PagePool::pageSize ( ) const
inline

Definition at line 35 of file PagePool.h.

References pageIndex.

Referenced by Init().

void Ipc::Mem::PagePool::put ( PageId page)

Definition at line 56 of file PagePool.cc.

References Ipc::Mem::PageId::maxPurpose, Must, and Ipc::Mem::PageId::purpose.

Referenced by Ipc::Mem::PutPage().

unsigned int Ipc::Mem::PagePool::size ( ) const
inline

Definition at line 37 of file PagePool.h.

References pageIndex.

Referenced by level().

Member Data Documentation

Ipc::Mem::Pointer<PageStack> Ipc::Mem::PagePool::pageIndex
private

Definition at line 51 of file PagePool.h.

Referenced by capacity(), pageSize(), and size().

char* const Ipc::Mem::PagePool::theBuf
private

Definition at line 55 of file PagePool.h.

Levels_t* const Ipc::Mem::PagePool::theLevels
private

Definition at line 54 of file PagePool.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors