LibreOffice Module sw (master) 1
|
#include <swcache.hxx>
Public Member Functions | |
SwCache (const sal_uInt16 nInitSize, OString aNm) | |
~SwCache () | |
The dtor will free all objects still in the vector. More... | |
void | Flush () |
SwCacheObj * | Get (const void *pOwner, const bool bToTop=true) |
SwCacheObj * | Get (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) |
Mark some entries as "do not delete". More... | |
void | ResetLRUOfst () |
void | IncreaseMax (const sal_uInt16 nAdd) |
void | DecreaseMax (const sal_uInt16 nSub) |
sal_uInt16 | GetCurMax () const |
SwCacheObj * | First () |
SwCacheObj * | operator[] (sal_uInt16 nIndex) |
sal_uInt16 | size () |
Static Public Member Functions | |
static SwCacheObj * | Next (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 |
SwCacheObj * | m_pRealFirst |
Free positions for the Insert if the maximum has not been reached Every time an object is deregistered, its position is added here. More... | |
SwCacheObj * | m_pFirst |
ALWAYS the real first LRU More... | |
SwCacheObj * | m_pLast |
The virtual first, only different to m_pRealFirst when SetLRUOfst has been called. More... | |
sal_uInt16 | m_nCurMax |
OString | m_aName |
tools::Long | m_nAppend |
tools::Long | m_nInsertFree |
number of entries appended More... | |
tools::Long | m_nReplace |
number of entries inserted on freed position More... | |
tools::Long | m_nGetSuccess |
number of LRU replacements More... | |
tools::Long | m_nGetFail |
tools::Long | m_nToTop |
tools::Long | m_nDelete |
number of reordering (LRU) More... | |
tools::Long | m_nGetSeek |
number of explicit deletes More... | |
tools::Long | m_nAverageSeekCnt |
number of gets without index More... | |
tools::Long | m_nFlushCnt |
number of seeks for all gets without index More... | |
tools::Long | m_nFlushedObjects |
number of flush calls More... | |
tools::Long | m_nIncreaseMax |
tools::Long | m_nDecreaseMax |
number of cache size increases More... | |
Definition at line 54 of file swcache.hxx.
SwCache::SwCache | ( | const sal_uInt16 | nInitSize, |
OString | aNm | ||
) |
Definition at line 77 of file swcache.cxx.
References m_aCacheObjects, and m_aName.
SwCache::~SwCache | ( | ) |
The dtor will free all objects still in the vector.
Definition at line 106 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.
|
private |
number of cache size decreases
Definition at line 30 of file swcache.cxx.
References SwCacheObj::GetNext(), SwCacheObj::GetPrev(), m_aFreePositions, m_nCurMax, m_pFirst, m_pLast, m_pRealFirst, SAL_WARN_IF, and size().
Referenced by ~SwCache().
void SwCache::DecreaseMax | ( | const sal_uInt16 | nSub | ) |
Definition at line 139 of file swcache.cxx.
References m_nCurMax, and m_nDecreaseMax.
Referenced by SwViewShell::~SwViewShell().
void SwCache::Delete | ( | const void * | pOwner | ) |
Definition at line 329 of file swcache.cxx.
References DeleteObj(), Get(), INCREMENT, m_nDelete, and pOwner.
void SwCache::Delete | ( | const void * | pOwner, |
sal_uInt16 | nIndex | ||
) |
Definition at line 322 of file swcache.cxx.
References DeleteObj(), Get(), INCREMENT, m_nDelete, nIndex, and pOwner.
Referenced by sw::BorderCacheOwner::InvalidateInSwCache(), SwTextFrame::RemoveFromCache(), sw::BorderCacheOwner::~BorderCacheOwner(), and SwTextFormatColl::~SwTextFormatColl().
|
private |
Definition at line 270 of file swcache.cxx.
References CHECK, SwCacheObj::GetCachePos(), SwCacheObj::GetNext(), SwCacheObj::GetPrev(), i, SwCacheObj::IsLocked(), m_aCacheObjects, m_aFreePositions, m_nCurMax, m_pFirst, m_pLast, m_pRealFirst, SwCacheObj::SetCachePos(), SwCacheObj::SetNext(), and SwCacheObj::SetPrev().
Referenced by Delete().
|
inline |
Definition at line 117 of file swcache.hxx.
References m_pRealFirst.
Referenced by SwFntCache::First().
void SwCache::Flush | ( | void | ) |
Definition at line 148 of file swcache.cxx.
References SwCacheObj::GetCachePos(), SwCacheObj::GetNext(), INCREMENT, SwCacheObj::IsLocked(), m_aCacheObjects, m_aFreePositions, m_nFlushCnt, m_nFlushedObjects, m_pFirst, m_pLast, and m_pRealFirst.
Referenced by SwFntCache::Flush(), and FlushFontCache().
SwCacheObj * SwCache::Get | ( | const void * | pOwner, |
const bool | bToTop = true |
||
) |
Definition at line 248 of file swcache.cxx.
References SwCacheObj::GetNext(), INCREMENT, SwCacheObj::IsOwner(), m_nAverageSeekCnt, m_nGetFail, m_nGetSeek, m_nGetSuccess, m_pFirst, m_pRealFirst, pOwner, and ToTop().
Referenced by Delete(), and SwCacheAccess::SwCacheAccess().
SwCacheObj * SwCache::Get | ( | const void * | pOwner, |
const sal_uInt16 | nIndex, | ||
const bool | bToTop = true |
||
) |
Definition at line 226 of file swcache.cxx.
References sw::proofreadingiterator::get(), SwCacheObj::IsOwner(), m_aCacheObjects, m_nGetFail, m_nGetSuccess, m_pFirst, nIndex, pOwner, and ToTop().
|
inline |
Definition at line 116 of file swcache.hxx.
References m_nCurMax.
Referenced by SwSaveSetLRUOfst::SwSaveSetLRUOfst(), and SwViewShell::SwViewShell().
void SwCache::IncreaseMax | ( | const sal_uInt16 | nAdd | ) |
Definition at line 128 of file swcache.cxx.
References o3tl::checked_add(), m_nCurMax, and m_nIncreaseMax.
Referenced by Insert(), SwSaveSetLRUOfst::SwSaveSetLRUOfst(), and SwViewShell::SwViewShell().
bool SwCache::Insert | ( | SwCacheObj * | pNew, |
bool | isDuplicateOwnerAllowed | ||
) |
Definition at line 337 of file swcache.cxx.
References CHECK, SwCacheObj::GetCachePos(), SwCacheObj::GetNext(), SwCacheObj::GetOwner(), SwCacheObj::GetPrev(), IncreaseMax(), INCREMENT, Insert(), SwCacheObj::IsLocked(), m_aCacheObjects, m_aFreePositions, m_nAppend, m_nCurMax, m_nInsertFree, m_nReplace, m_pFirst, m_pLast, m_pRealFirst, nPos, SAL_WARN, SwCacheObj::SetCachePos(), SwCacheObj::SetNext(), and SwCacheObj::SetPrev().
Referenced by SwCacheAccess::Get_(), and Insert().
|
inlinestatic |
Definition at line 224 of file swcache.hxx.
References SwCacheObj::GetNext().
Referenced by SwFntCache::Next().
|
inline |
Definition at line 119 of file swcache.hxx.
References m_aCacheObjects, and nIndex.
|
inline |
Definition at line 112 of file swcache.hxx.
References m_pFirst, and m_pRealFirst.
Referenced by SwSaveSetLRUOfst::~SwSaveSetLRUOfst().
void SwCache::SetLRUOfst | ( | const sal_uInt16 | nOfst | ) |
Mark some entries as "do not delete".
nOfst | determines how many are not to be touched |
Definition at line 439 of file swcache.cxx.
References CHECK, SwCacheObj::GetNext(), i, m_aCacheObjects, m_aFreePositions, m_nCurMax, m_pFirst, and m_pRealFirst.
Referenced by SwSaveSetLRUOfst::SwSaveSetLRUOfst().
|
inline |
void SwCache::ToTop | ( | SwCacheObj * | pObj | ) |
Definition at line 164 of file swcache.cxx.
References CHECK, SwCacheObj::GetNext(), SwCacheObj::GetPrev(), INCREMENT, m_nToTop, m_pFirst, m_pLast, m_pRealFirst, SwCacheObj::SetNext(), and SwCacheObj::SetPrev().
Referenced by Get().
|
private |
Definition at line 56 of file swcache.hxx.
Referenced by DeleteObj(), Flush(), Get(), Insert(), operator[](), SetLRUOfst(), size(), and SwCache().
|
private |
Definition at line 57 of file swcache.hxx.
Referenced by Check(), DeleteObj(), Flush(), Insert(), and SetLRUOfst().
|
private |
Definition at line 68 of file swcache.hxx.
Referenced by ~SwCache().
|
private |
Definition at line 69 of file swcache.hxx.
Referenced by Insert(), and ~SwCache().
|
private |
number of gets without index
Definition at line 77 of file swcache.hxx.
Referenced by Get(), and ~SwCache().
|
private |
Definition at line 63 of file swcache.hxx.
Referenced by Check(), DecreaseMax(), DeleteObj(), GetCurMax(), IncreaseMax(), Insert(), and SetLRUOfst().
|
private |
number of cache size increases
Definition at line 81 of file swcache.hxx.
Referenced by DecreaseMax(), and ~SwCache().
|
private |
number of reordering (LRU)
Definition at line 75 of file swcache.hxx.
Referenced by Delete(), and ~SwCache().
|
private |
number of seeks for all gets without index
Definition at line 78 of file swcache.hxx.
Referenced by Flush(), and ~SwCache().
|
private |
number of flush calls
Definition at line 79 of file swcache.hxx.
Referenced by Flush(), and ~SwCache().
|
private |
Definition at line 73 of file swcache.hxx.
Referenced by Get(), and ~SwCache().
|
private |
number of explicit deletes
Definition at line 76 of file swcache.hxx.
Referenced by Get(), and ~SwCache().
|
private |
number of LRU replacements
Definition at line 72 of file swcache.hxx.
Referenced by Get(), and ~SwCache().
|
private |
Definition at line 80 of file swcache.hxx.
Referenced by IncreaseMax(), and ~SwCache().
|
private |
number of entries appended
Definition at line 70 of file swcache.hxx.
Referenced by Insert(), and ~SwCache().
|
private |
number of entries inserted on freed position
Definition at line 71 of file swcache.hxx.
Referenced by Insert(), and ~SwCache().
|
private |
Definition at line 74 of file swcache.hxx.
Referenced by ToTop(), and ~SwCache().
|
private |
ALWAYS the real first LRU
Definition at line 60 of file swcache.hxx.
Referenced by Check(), DeleteObj(), Flush(), Get(), Insert(), ResetLRUOfst(), SetLRUOfst(), and ToTop().
|
private |
The virtual first, only different to m_pRealFirst when SetLRUOfst has been called.
Definition at line 61 of file swcache.hxx.
Referenced by Check(), DeleteObj(), Flush(), Insert(), and ToTop().
|
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 59 of file swcache.hxx.
Referenced by Check(), DeleteObj(), First(), Flush(), Get(), Insert(), ResetLRUOfst(), SetLRUOfst(), and ToTop().