LibreOffice Module sw (master)  1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BigPtrArray Class Reference

#include <bparr.hxx>

Inheritance diagram for BigPtrArray:
[legend]

Public Member Functions

 BigPtrArray ()
 
 ~BigPtrArray ()
 
sal_uLong Count () const
 
void Insert (BigPtrEntry *p, sal_uLong pos)
 
void Remove (sal_uLong pos, sal_uLong n=1)
 
void Move (sal_uLong from, sal_uLong to)
 
void Replace (sal_uLong pos, BigPtrEntry *p)
 
BigPtrEntryoperator[] (sal_uLong) const
 

Protected Member Functions

sal_uInt16 Index2Block (sal_uLong) const
 block search More...
 
BlockInfoInsBlock (sal_uInt16)
 insert block More...
 
void BlockDel (sal_uInt16)
 some blocks were deleted More...
 
void UpdIndex (sal_uInt16)
 recalculate indices More...
 
sal_uInt16 Compress ()
 Compress the array. More...
 

Protected Attributes

std::unique_ptr< BlockInfo *[]> m_ppInf
 block info More...
 
sal_uLong m_nSize
 number of elements More...
 
sal_uInt16 m_nMaxBlock
 current max. number of blocks More...
 
sal_uInt16 m_nBlock
 number of blocks More...
 
sal_uInt16 m_nCur
 last used block More...
 

Detailed Description

Definition at line 64 of file bparr.hxx.

Constructor & Destructor Documentation

BigPtrArray::BigPtrArray ( )

Definition at line 48 of file bparr.cxx.

References m_nBlock, m_nCur, m_nMaxBlock, m_nSize, m_ppInf, and nBlockGrowSize.

BigPtrArray::~BigPtrArray ( )

Definition at line 56 of file bparr.cxx.

References m_nBlock, m_ppInf, and n.

Member Function Documentation

void BigPtrArray::BlockDel ( sal_uInt16  nDel)
protected

some blocks were deleted

Definition at line 187 of file bparr.cxx.

References m_nBlock, m_nMaxBlock, m_ppInf, and nBlockGrowSize.

Referenced by Compress(), and Remove().

sal_uInt16 BigPtrArray::Compress ( )
protected

Compress the array.

Definition at line 401 of file bparr.cxx.

References BlockDel(), CHECKIDX, COMPRESSLVL, m_nBlock, m_nCur, m_nSize, m_ppInf, MAXENTRY, BlockInfo::mvData, n, nCount, BlockInfo::nElem, BlockInfo::nEnd, p, UpdIndex(), and USHRT_MAX.

Referenced by Insert(), and Remove().

sal_uLong BigPtrArray::Count ( ) const
inline

Definition at line 87 of file bparr.hxx.

Referenced by SwNodes::Count(), and SwNodes::ForEach().

sal_uInt16 BigPtrArray::Index2Block ( sal_uLong  pos) const
protected

block search

Search a block at a given position.

Definition at line 91 of file bparr.cxx.

References m_nBlock, m_nCur, m_ppInf, n, BlockInfo::nEnd, BlockInfo::nStart, and p.

Referenced by SwNodes::ForEach(), Insert(), Move(), operator[](), Remove(), and Replace().

BlockInfo * BigPtrArray::InsBlock ( sal_uInt16  pos)
protected

insert block

Create and insert new block.

Existing blocks will be moved rearward.

Parameters
posPosition at which the new block should be created.

Definition at line 157 of file bparr.cxx.

References m_nBlock, m_nMaxBlock, m_ppInf, nBlockGrowSize, BlockInfo::nElem, BlockInfo::nEnd, BlockInfo::nStart, p, and BlockInfo::pBigArr.

Referenced by Insert().

void BigPtrArray::Insert ( BigPtrEntry p,
sal_uLong  pos 
)
void BigPtrArray::Move ( sal_uLong  from,
sal_uLong  to 
)

Definition at line 70 of file bparr.cxx.

References Index2Block(), Insert(), m_ppInf, BlockInfo::mvData, BlockInfo::nStart, p, and Remove().

Referenced by SwNodes::ChgNode(), and SwNodes::MoveNodes().

BigPtrEntry * BigPtrArray::operator[] ( sal_uLong  idx) const

Definition at line 82 of file bparr.cxx.

References Index2Block(), m_nCur, m_nSize, m_ppInf, BlockInfo::mvData, BlockInfo::nStart, and p.

Referenced by SwNodes::operator[](), and SwNodes::RemoveNode().

void BigPtrArray::Remove ( sal_uLong  pos,
sal_uLong  n = 1 
)
void BigPtrArray::Replace ( sal_uLong  pos,
BigPtrEntry p 
)
void BigPtrArray::UpdIndex ( sal_uInt16  pos)
protected

recalculate indices

Update all index areas.

Parameters
poslast correct block (starting point)

Definition at line 138 of file bparr.cxx.

References m_nBlock, m_ppInf, BlockInfo::nElem, BlockInfo::nEnd, BlockInfo::nStart, and p.

Referenced by Compress(), Insert(), and Remove().

Member Data Documentation

sal_uInt16 BigPtrArray::m_nBlock
protected

number of blocks

Definition at line 71 of file bparr.hxx.

Referenced by BigPtrArray(), BlockDel(), Compress(), Index2Block(), InsBlock(), Insert(), Remove(), UpdIndex(), and ~BigPtrArray().

sal_uInt16 BigPtrArray::m_nCur
mutableprotected

last used block

Definition at line 73 of file bparr.hxx.

Referenced by BigPtrArray(), Compress(), Index2Block(), Insert(), operator[](), Remove(), and Replace().

sal_uInt16 BigPtrArray::m_nMaxBlock
protected

current max. number of blocks

Definition at line 70 of file bparr.hxx.

Referenced by BigPtrArray(), BlockDel(), and InsBlock().

sal_uLong BigPtrArray::m_nSize
protected

number of elements

Definition at line 69 of file bparr.hxx.

Referenced by BigPtrArray(), Compress(), SwNodes::ForEach(), Insert(), operator[](), Remove(), and Replace().

std::unique_ptr<BlockInfo*[]> BigPtrArray::m_ppInf
protected

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