19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWCACHE_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_SWCACHE_HXX
49 #include <rtl/string.hxx>
90 SwCache(
const sal_uInt16 nInitSize,
const OString &rNm );
92 SwCache(
const sal_uInt16 nInitSize );
100 SwCacheObj *
Get(
const void *pOwner,
const bool bToTop =
true );
101 SwCacheObj *
Get(
const void *pOwner,
const sal_uInt16 nIndex,
102 const bool bToTop =
true );
106 void Delete(
const void * pOwner, sal_uInt16 nIndex);
107 void Delete(
const void *pOwner );
118 sal_uInt16
size() {
return m_aCacheObjects.size(); }
152 if (m_nCachePos != nNew)
169 inline bool IsOwner(
const void *pNew )
const;
199 void Get_(
bool isDuplicateOwnerAllowed);
244 const sal_uInt16 nIndex ) :
260 Get_(isDuplicateOwnerAllowed);
sal_uInt16 GetCachePos() const
bool Insert(SwCacheObj *pNew, bool isDuplicateOwnerAllowed)
SwCacheObj * m_pLast
The virtual first.
void SetLRUOfst(const sal_uInt16 nOfst)
void Get_(bool isDuplicateOwnerAllowed)
tools::Long m_nInsertFree
number of entries appended
sal_uInt16 GetCurMax() const
static SwCacheObj * Next(SwCacheObj *pCacheObj)
virtual SwCacheObj * NewObj()=0
Can be use in NewObj.
SwCacheObj * m_pFirst
ALWAYS the real first LRU
SwCacheObj * Get(bool isDuplicateOwnerAllowed)
void ResetLRUOfst()
nOfst determines how many are not to be touched
void SetNext(SwCacheObj *pNew)
SwCacheObj * m_pPrev
For the LRU chaining.
std::vector< sal_uInt16 > m_aFreePositions
SwCacheObj * Get(const void *pOwner, const bool bToTop=true)
std::vector< std::unique_ptr< SwCacheObj > > m_aCacheObjects
SwCacheObj * m_pRealFirst
Free positions for the Insert if the maximum has not been reached.
void DecreaseMax(const sal_uInt16 nSub)
tools::Long m_nDelete
number of reordering (LRU)
tools::Long m_nGetSuccess
number of LRU replacements
void DeleteObj(SwCacheObj *pObj)
sal_uInt8 m_nLock
Position in the Cache array.
void Check()
number of cache size decreases
SwCacheObj * operator[](sal_uInt16 nIndex)
bool IsOwner(const void *pNew) const
Try to prevent visible SwParaPortions from being deleted.
void IncreaseMax(const sal_uInt16 nAdd)
SwCacheObj(const void *pOwner)
SwCacheObj * m_pNext
Can do everything.
ContentProvider * m_pOwner
void ToTop(SwCacheObj *pObj)
void SetPrev(SwCacheObj *pNew)
tools::Long m_nDecreaseMax
number of cache size increases
tools::Long m_nFlushedObjects
number of flush calls
SwSaveSetLRUOfst()
Prevent the SwParaPortions of the visible paragraphs from being deleted; they would just be recreated...
void Delete(const void *pOwner, sal_uInt16 nIndex)
tools::Long m_nReplace
number of entries inserted on freed position
void SetCachePos(const sal_uInt16 nNew)
The Cache object base class Users of the Cache must derive a class from the SwCacheObj and store thei...
~SwCache()
The dtor will free all objects still in the vector.
SwCacheAccess(SwCache &rCache, const void *pOwner, bool bSeek)
tools::Long m_nGetSeek
number of explicit deletes
tools::Long m_nAverageSeekCnt
number of gets without index
tools::Long m_nIncreaseMax
Access class for the Cache.
tools::Long m_nFlushCnt
number of seeks for all gets without index
virtual void UpdateCachePos()
SwCache(const sal_uInt16 nInitSize, const OString &rNm)
const void * GetOwner() const