LibreOffice Module store (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
store::PageCache Class Reference

#include <storcach.hxx>

Inheritance diagram for store::PageCache:
[legend]
Collaboration diagram for store::PageCache:
[legend]

Public Member Functions

 PageCache (sal_uInt16 nPageSize)
 
 PageCache (const PageCache &)=delete
 
PageCacheoperator= (const PageCache &)=delete
 
storeError lookupPageAt (std::shared_ptr< PageData > &rxPage, sal_uInt32 nOffset)
 
storeError insertPageAt (std::shared_ptr< PageData > const &rxPage, sal_uInt32 nOffset)
 
storeError updatePageAt (std::shared_ptr< PageData > const &rxPage, sal_uInt32 nOffset)
 
storeError removePageAt (sal_uInt32 nOffset)
 
- Public Member Functions inherited from store::OStoreObject
 OStoreObject ()
 
virtual bool isKindOf (sal_uInt32 nTypeId)
 Replaces dynamic_cast type checking. More...
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Protected Member Functions

virtual ~PageCache () override
 
- Protected Member Functions inherited from store::OStoreObject
virtual ~OStoreObject () override
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

int hash_index_Impl (sal_uInt32 nOffset)
 
Entrylookup_Impl (Entry *entry, sal_uInt32 nOffset)
 
void rescale_Impl (std::size_t new_size)
 

Static Private Member Functions

static int hash_Impl (sal_uInt32 a, size_t s, size_t q, size_t m)
 

Private Attributes

Entry ** m_hash_table
 
Entrym_hash_table_0 [theTableSize] = {}
 
size_t m_hash_size
 
size_t m_hash_shift
 
size_t const m_page_shift
 
size_t m_hash_entries
 
size_t m_nHit
 
size_t m_nMissed
 

Static Private Attributes

static size_t const theTableSize = 32
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * operator new (std::size_t nSize)
 
static void * operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 
- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

Definition at line 39 of file storcach.hxx.

Constructor & Destructor Documentation

◆ PageCache() [1/2]

PageCache::PageCache ( sal_uInt16  nPageSize)
explicit

Definition at line 167 of file storcach.cxx.

References m_hash_table_0, SAL_N_ELEMENTS, and theTableSize.

◆ PageCache() [2/2]

store::PageCache::PageCache ( const PageCache )
delete

◆ ~PageCache()

PageCache::~PageCache ( )
overrideprotectedvirtual

Member Function Documentation

◆ hash_Impl()

static int store::PageCache::hash_Impl ( sal_uInt32  a,
size_t  s,
size_t  q,
size_t  m 
)
inlinestaticprivate

Definition at line 55 of file storcach.hxx.

References a, and m.

Referenced by hash_index_Impl().

◆ hash_index_Impl()

int store::PageCache::hash_index_Impl ( sal_uInt32  nOffset)
inlineprivate

◆ insertPageAt()

storeError PageCache::insertPageAt ( std::shared_ptr< PageData > const &  rxPage,
sal_uInt32  nOffset 
)

◆ lookup_Impl()

Entry * PageCache::lookup_Impl ( Entry entry,
sal_uInt32  nOffset 
)
private

◆ lookupPageAt()

storeError PageCache::lookupPageAt ( std::shared_ptr< PageData > &  rxPage,
sal_uInt32  nOffset 
)

◆ operator=()

PageCache & store::PageCache::operator= ( const PageCache )
delete

◆ removePageAt()

storeError PageCache::removePageAt ( sal_uInt32  nOffset)

◆ rescale_Impl()

void PageCache::rescale_Impl ( std::size_t  new_size)
private

◆ updatePageAt()

storeError PageCache::updatePageAt ( std::shared_ptr< PageData > const &  rxPage,
sal_uInt32  nOffset 
)

Member Data Documentation

◆ m_hash_entries

size_t store::PageCache::m_hash_entries
private

Definition at line 51 of file storcach.hxx.

Referenced by insertPageAt(), lookup_Impl(), removePageAt(), and rescale_Impl().

◆ m_hash_shift

size_t store::PageCache::m_hash_shift
private

Definition at line 48 of file storcach.hxx.

Referenced by hash_index_Impl(), lookup_Impl(), rescale_Impl(), and ~PageCache().

◆ m_hash_size

size_t store::PageCache::m_hash_size
private

Definition at line 47 of file storcach.hxx.

Referenced by hash_index_Impl(), lookup_Impl(), rescale_Impl(), and ~PageCache().

◆ m_hash_table

Entry** store::PageCache::m_hash_table
private

◆ m_hash_table_0

Entry* store::PageCache::m_hash_table_0[theTableSize] = {}
private

Definition at line 46 of file storcach.hxx.

Referenced by PageCache(), rescale_Impl(), and ~PageCache().

◆ m_nHit

size_t store::PageCache::m_nHit
private

Definition at line 52 of file storcach.hxx.

Referenced by lookupPageAt(), and ~PageCache().

◆ m_nMissed

size_t store::PageCache::m_nMissed
private

Definition at line 53 of file storcach.hxx.

Referenced by lookupPageAt(), and ~PageCache().

◆ m_page_shift

size_t const store::PageCache::m_page_shift
private

Definition at line 49 of file storcach.hxx.

Referenced by hash_index_Impl().

◆ theTableSize

size_t const store::PageCache::theTableSize = 32
staticprivate

Definition at line 42 of file storcach.hxx.

Referenced by PageCache(), and ~PageCache().


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