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_Int32 Count () const
 
void Insert (BigPtrEntry *p, sal_Int32 pos)
 
void Remove (sal_Int32 pos, sal_Int32 n=1)
 
void Move (sal_Int32 from, sal_Int32 to)
 
void Replace (sal_Int32 pos, BigPtrEntry *p)
 
BigPtrEntryoperator[] (sal_Int32) const
 

Protected Member Functions

sal_uInt16 Index2Block (sal_Int32) 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_Int32 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::BigPtrArray ( )

Definition at line 48 of file bparr.cxx.

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

◆ ~BigPtrArray()

BigPtrArray::~BigPtrArray ( )

Definition at line 56 of file bparr.cxx.

References m_nBlock, m_ppInf, and n.

Member Function Documentation

◆ BlockDel()

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().

◆ Compress()

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, p, and UpdIndex().

Referenced by Insert(), and Remove().

◆ Count()

sal_Int32 BigPtrArray::Count ( ) const
inline

Definition at line 87 of file bparr.hxx.

References m_nSize.

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

◆ Index2Block()

sal_uInt16 BigPtrArray::Index2Block ( sal_Int32  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, p, and pos.

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

◆ InsBlock()

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, p, and pos.

Referenced by Insert().

◆ Insert()

void BigPtrArray::Insert ( BigPtrEntry p,
sal_Int32  pos 
)

◆ Move()

void BigPtrArray::Move ( sal_Int32  from,
sal_Int32  to 
)

Definition at line 70 of file bparr.cxx.

References from, Index2Block(), Insert(), m_ppInf, p, Remove(), and to.

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

◆ operator[]()

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

Definition at line 82 of file bparr.cxx.

References idx, Index2Block(), m_nCur, m_nSize, m_ppInf, and p.

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

◆ Remove()

void BigPtrArray::Remove ( sal_Int32  pos,
sal_Int32  n = 1 
)

Definition at line 306 of file bparr.cxx.

References BlockDel(), CHECKIDX, Compress(), i, Index2Block(), m_nBlock, m_nCur, m_nSize, m_ppInf, MAXENTRY, n, nCount, p, pos, and UpdIndex().

Referenced by Move(), and SwNodes::RemoveNode().

◆ Replace()

void BigPtrArray::Replace ( sal_Int32  pos,
BigPtrEntry p 
)

Definition at line 390 of file bparr.cxx.

References idx, Index2Block(), m_nCur, BigPtrEntry::m_nOffset, m_nSize, BigPtrEntry::m_pBlock, m_ppInf, and p.

Referenced by SwNodes::RemoveNode().

◆ UpdIndex()

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 idx, m_nBlock, m_ppInf, p, and pos.

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

Member Data Documentation

◆ m_nBlock

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().

◆ m_nCur

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().

◆ m_nMaxBlock

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().

◆ m_nSize

sal_Int32 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().

◆ m_ppInf

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

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