LibreOffice Module sw (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwCache Class Reference

#include <swcache.hxx>

Inheritance diagram for SwCache:
[legend]
Collaboration diagram for SwCache:
[legend]

Public Member Functions

 SwCache (const sal_uInt16 nInitSize, const OString &rNm)
 
 ~SwCache ()
 The dtor will free all objects still in the vector. More...
 
void Flush ()
 
SwCacheObjGet (const void *pOwner, const bool bToTop=true)
 
SwCacheObjGet (const void *pOwner, const sal_uInt16 nIndex, const bool bToTop=true)
 
void ToTop (SwCacheObj *pObj)
 
bool Insert (SwCacheObj *pNew, bool isDuplicateOwnerAllowed)
 
void Delete (const void *pOwner, sal_uInt16 nIndex)
 
void Delete (const void *pOwner)
 
void SetLRUOfst (const sal_uInt16 nOfst)
 
void ResetLRUOfst ()
 nOfst determines how many are not to be touched More...
 
void IncreaseMax (const sal_uInt16 nAdd)
 
void DecreaseMax (const sal_uInt16 nSub)
 
sal_uInt16 GetCurMax () const
 
SwCacheObjFirst ()
 
SwCacheObjoperator[] (sal_uInt16 nIndex)
 
sal_uInt16 size ()
 

Static Public Member Functions

static SwCacheObjNext (SwCacheObj *pCacheObj)
 

Private Member Functions

void DeleteObj (SwCacheObj *pObj)
 
void Check ()
 number of cache size decreases More...
 

Private Attributes

std::vector< std::unique_ptr< SwCacheObj > > m_aCacheObjects
 
std::vector< sal_uInt16 > m_aFreePositions
 
SwCacheObjm_pRealFirst
 Free positions for the Insert if the maximum has not been reached. More...
 
SwCacheObjm_pFirst
 ALWAYS the real first LRU More...
 
SwCacheObjm_pLast
 The virtual first. More...
 
sal_uInt16 m_nCurMax
 
OString m_aName
 
long m_nAppend
 
long m_nInsertFree
 number of entries appended More...
 
long m_nReplace
 number of entries inserted on freed position More...
 
long m_nGetSuccess
 number of LRU replacements More...
 
long m_nGetFail
 
long m_nToTop
 
long m_nDelete
 number of reordering (LRU) More...
 
long m_nGetSeek
 number of explicit deletes More...
 
long m_nAverageSeekCnt
 number of gets without index More...
 
long m_nFlushCnt
 number of seeks for all gets without index More...
 
long m_nFlushedObjects
 number of flush calls More...
 
long m_nIncreaseMax
 
long m_nDecreaseMax
 number of cache size increases More...
 

Detailed Description

Definition at line 53 of file swcache.hxx.

Constructor & Destructor Documentation

SwCache::SwCache ( const sal_uInt16  nInitSize,
const OString &  rNm 
)

Definition at line 77 of file swcache.cxx.

References m_aCacheObjects.

SwCache::~SwCache ( )

The dtor will free all objects still in the vector.

Definition at line 107 of file swcache.cxx.

References Check(), m_aName, m_nAppend, m_nAverageSeekCnt, m_nDecreaseMax, m_nDelete, m_nFlushCnt, m_nFlushedObjects, m_nGetFail, m_nGetSeek, m_nGetSuccess, m_nIncreaseMax, m_nInsertFree, m_nReplace, m_nToTop, and SAL_INFO.

Member Function Documentation

void SwCache::Check ( )
private

number of cache size decreases

Definition at line 29 of file swcache.cxx.

References SwCacheObj::GetNext(), SwCacheObj::GetPrev(), m_aFreePositions, m_nCurMax, m_pFirst, m_pLast, m_pRealFirst, SAL_WARN_IF, size(), and void().

Referenced by ~SwCache().

void SwCache::DecreaseMax ( const sal_uInt16  nSub)

Definition at line 140 of file swcache.cxx.

References m_nCurMax, and m_nDecreaseMax.

Referenced by SwViewShell::~SwViewShell().

void SwCache::Delete ( const void pOwner,
sal_uInt16  nIndex 
)
void SwCache::Delete ( const void pOwner)

Definition at line 335 of file swcache.cxx.

References DeleteObj(), Get(), INCREMENT, and m_nDelete.

void SwCache::DeleteObj ( SwCacheObj pObj)
private
SwCacheObj* SwCache::First ( )
inline

Definition at line 114 of file swcache.hxx.

References m_pRealFirst.

Referenced by SwFntCache::First().

void SwCache::Flush ( void  )
SwCacheObj * SwCache::Get ( const void pOwner,
const bool  bToTop = true 
)
SwCacheObj * SwCache::Get ( const void pOwner,
const sal_uInt16  nIndex,
const bool  bToTop = true 
)
sal_uInt16 SwCache::GetCurMax ( ) const
inline

Definition at line 113 of file swcache.hxx.

References m_nCurMax.

Referenced by SwSaveSetLRUOfst::SwSaveSetLRUOfst().

void SwCache::IncreaseMax ( const sal_uInt16  nAdd)
bool SwCache::Insert ( SwCacheObj pNew,
bool  isDuplicateOwnerAllowed 
)
SwCacheObj * SwCache::Next ( SwCacheObj pCacheObj)
inlinestatic

Definition at line 221 of file swcache.hxx.

References SwCacheObj::GetNext().

Referenced by SwFntCache::Next().

SwCacheObj* SwCache::operator[] ( sal_uInt16  nIndex)
inline

Definition at line 116 of file swcache.hxx.

void SwCache::ResetLRUOfst ( )
inline

nOfst determines how many are not to be touched

Definition at line 109 of file swcache.hxx.

References m_pRealFirst.

Referenced by SwSaveSetLRUOfst::~SwSaveSetLRUOfst().

void SwCache::SetLRUOfst ( const sal_uInt16  nOfst)
sal_uInt16 SwCache::size ( )
inline

Definition at line 117 of file swcache.hxx.

Referenced by Check().

void SwCache::ToTop ( SwCacheObj pObj)

Member Data Documentation

std::vector<std::unique_ptr<SwCacheObj> > SwCache::m_aCacheObjects
private

Definition at line 55 of file swcache.hxx.

Referenced by DeleteObj(), Flush(), Get(), Insert(), SetLRUOfst(), and SwCache().

std::vector<sal_uInt16> SwCache::m_aFreePositions
private

Definition at line 56 of file swcache.hxx.

Referenced by Check(), DeleteObj(), Flush(), Insert(), and SetLRUOfst().

OString SwCache::m_aName
private

Definition at line 67 of file swcache.hxx.

Referenced by ~SwCache().

long SwCache::m_nAppend
private

Definition at line 68 of file swcache.hxx.

Referenced by Insert(), and ~SwCache().

long SwCache::m_nAverageSeekCnt
private

number of gets without index

Definition at line 76 of file swcache.hxx.

Referenced by Get(), and ~SwCache().

sal_uInt16 SwCache::m_nCurMax
private

Definition at line 62 of file swcache.hxx.

Referenced by Check(), DecreaseMax(), DeleteObj(), GetCurMax(), IncreaseMax(), Insert(), and SetLRUOfst().

long SwCache::m_nDecreaseMax
private

number of cache size increases

Definition at line 80 of file swcache.hxx.

Referenced by DecreaseMax(), and ~SwCache().

long SwCache::m_nDelete
private

number of reordering (LRU)

Definition at line 74 of file swcache.hxx.

Referenced by Delete(), and ~SwCache().

long SwCache::m_nFlushCnt
private

number of seeks for all gets without index

Definition at line 77 of file swcache.hxx.

Referenced by Flush(), and ~SwCache().

long SwCache::m_nFlushedObjects
private

number of flush calls

Definition at line 78 of file swcache.hxx.

Referenced by Flush(), and ~SwCache().

long SwCache::m_nGetFail
private

Definition at line 72 of file swcache.hxx.

Referenced by Get(), and ~SwCache().

long SwCache::m_nGetSeek
private

number of explicit deletes

Definition at line 75 of file swcache.hxx.

Referenced by Get(), and ~SwCache().

long SwCache::m_nGetSuccess
private

number of LRU replacements

Definition at line 71 of file swcache.hxx.

Referenced by Get(), and ~SwCache().

long SwCache::m_nIncreaseMax
private

Definition at line 79 of file swcache.hxx.

Referenced by IncreaseMax(), and ~SwCache().

long SwCache::m_nInsertFree
private

number of entries appended

Definition at line 69 of file swcache.hxx.

Referenced by Insert(), and ~SwCache().

long SwCache::m_nReplace
private

number of entries inserted on freed position

Definition at line 70 of file swcache.hxx.

Referenced by Insert(), and ~SwCache().

long SwCache::m_nToTop
private

Definition at line 73 of file swcache.hxx.

Referenced by ToTop(), and ~SwCache().

SwCacheObj* SwCache::m_pFirst
private

ALWAYS the real first LRU

Definition at line 59 of file swcache.hxx.

Referenced by Check(), DeleteObj(), Flush(), Get(), Insert(), SetLRUOfst(), and ToTop().

SwCacheObj* SwCache::m_pLast
private

The virtual first.

Definition at line 60 of file swcache.hxx.

Referenced by Check(), DeleteObj(), Flush(), Insert(), and ToTop().

SwCacheObj* SwCache::m_pRealFirst
private

Free positions for the Insert if the maximum has not been reached.

Every time an object is deregistered, its position is added here

Definition at line 58 of file swcache.hxx.

Referenced by Check(), DeleteObj(), First(), Flush(), Get(), Insert(), ResetLRUOfst(), SetLRUOfst(), and ToTop().


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