LibreOffice Module sw (master)
1
|
#include <swcache.hxx>
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 () |
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) |
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 |
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. More... | |
SwCacheObj * | m_pFirst |
ALWAYS the real first LRU More... | |
SwCacheObj * | m_pLast |
The virtual first. 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, |
const OString & | rNm | ||
) |
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 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.
|
private |
number of cache size decreases
Definition at line 29 of file swcache.cxx.
References assert(), 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().
Referenced by SwModify::CheckCaching(), SwContentNode::ChgFormatColl(), SwFormat::CopyAttrs(), SaveTable::CreateNew(), SwFormat::DelDiffs(), SwTextNode::MakeNewTextNode(), SwTextNode::NumRuleChgd(), SwFormat::operator=(), SwTextFrame::RemoveFromCache(), SwContentNode::ResetAllAttr(), SwFormat::ResetAllFormatAttr(), SwContentNode::ResetAttr(), SaveTable::RestoreAttr(), SwContentNode::SetAttr(), SwContentNode::SetCondFormatColl(), SwFormat::SetDerivedFrom(), SwFormat::SetFormatAttr(), SwTextNode::SplitContentNode(), SwFormat::~SwFormat(), and SwModify::~SwModify().
Definition at line 335 of file swcache.cxx.
References DeleteObj(), Get(), INCREMENT, and m_nDelete.
|
private |
Definition at line 274 of file swcache.cxx.
References assert(), 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 115 of file swcache.hxx.
References m_pRealFirst.
Referenced by SwFntCache::First().
Definition at line 149 of file swcache.cxx.
References assert(), 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 252 of file swcache.cxx.
References SwCacheObj::GetNext(), INCREMENT, SwCacheObj::IsOwner(), m_nAverageSeekCnt, m_nGetFail, m_nGetSeek, m_nGetSuccess, m_pFirst, m_pRealFirst, 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 230 of file swcache.cxx.
References SwCacheObj::IsOwner(), m_aCacheObjects, m_nGetFail, m_nGetSuccess, m_pFirst, and ToTop().
|
inline |
Definition at line 114 of file swcache.hxx.
References m_nCurMax.
Referenced by SwSaveSetLRUOfst::SwSaveSetLRUOfst().
void SwCache::IncreaseMax | ( | const sal_uInt16 | nAdd | ) |
Definition at line 129 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 343 of file swcache.cxx.
References assert(), CHECK, SwCacheObj::GetCachePos(), SwCacheObj::GetNext(), SwCacheObj::GetOwner(), SwCacheObj::GetPrev(), IncreaseMax(), INCREMENT, 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(), SwCacheObj::SetPrev(), and void().
Referenced by SwCacheAccess::Get_().
|
inlinestatic |
Definition at line 222 of file swcache.hxx.
References SwCacheObj::GetNext().
Referenced by SwFntCache::Next().
|
inline |
Definition at line 117 of file swcache.hxx.
|
inline |
nOfst determines how many are not to be touched
Definition at line 110 of file swcache.hxx.
References m_pRealFirst.
Referenced by SwSaveSetLRUOfst::~SwSaveSetLRUOfst().
void SwCache::SetLRUOfst | ( | const sal_uInt16 | nOfst | ) |
Definition at line 445 of file swcache.cxx.
References assert(), CHECK, SwCacheObj::GetNext(), i, m_aCacheObjects, m_aFreePositions, m_nCurMax, m_pFirst, and m_pRealFirst.
Referenced by SwSaveSetLRUOfst::SwSaveSetLRUOfst().
|
inline |
Definition at line 118 of file swcache.hxx.
Referenced by Check().
void SwCache::ToTop | ( | SwCacheObj * | pObj | ) |
Definition at line 168 of file swcache.cxx.
References assert(), 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(), SetLRUOfst(), 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(), SetLRUOfst(), and ToTop().
|
private |
The virtual first.
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().