LibreOffice Module sc (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TokenPool Class Reference

#include <tokstack.hxx>

Collaboration diagram for TokenPool:
[legend]

Classes

struct  ExtAreaRef
 for storage of external area references More...
 
struct  ExtCellRef
 for storage of external cell references More...
 
struct  EXTCONT
 
struct  ExtName
 for storage of external names More...
 
struct  RangeName
 for storage of named ranges More...
 

Public Member Functions

 TokenPool (svl::SharedStringPool &rSPool)
 
 ~TokenPool ()
 
TokenPooloperator<< (const TokenId &rId)
 
TokenPooloperator<< (const DefTokenId eId)
 
TokenPooloperator<< (TokenStack &rStack)
 
void operator>> (TokenId &rId)
 
void operator>> (TokenStack &rStack)
 
TokenId Store ()
 
TokenId Store (const double &rDouble)
 
TokenId Store (const sal_uInt16 nIndex)
 
TokenId Store (const OUString &rString)
 
TokenId Store (const ScSingleRefData &rTr)
 
TokenId Store (const ScComplexRefData &rTr)
 
TokenId Store (const DefTokenId eId, const OUString &rName)
 
TokenId StoreNlf (const ScSingleRefData &rTr)
 
TokenId StoreMatrix ()
 
TokenId StoreName (sal_uInt16 nIndex, sal_Int16 nSheet)
 
TokenId StoreExtName (sal_uInt16 nFileId, const OUString &rName)
 
TokenId StoreExtRef (sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
 
TokenId StoreExtRef (sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &rRef)
 
std::unique_ptr< ScTokenArrayGetTokenArray (const ScDocument &rDoc, const TokenId &rId)
 
void Reset ()
 
bool IsSingleOp (const TokenId &rId, const DefTokenId eId) const
 
const OUString * GetExternal (const TokenId &rId) const
 
ScMatrixGetMatrix (unsigned int n) const
 

Private Member Functions

bool GrowTripel (sal_uInt16 nByMin)
 
bool GrowId ()
 
bool GrowElement ()
 
bool GrowMatrix ()
 
bool CheckElementOrGrow ()
 
bool GetElement (const sal_uInt16 nId, ScTokenArray *pScToken)
 
bool GetElementRek (const sal_uInt16 nId, ScTokenArray *pScToken)
 
void ClearMatrix ()
 

Private Attributes

svl::SharedStringPoolmrStringPool
 
TokenPoolPool< std::unique_ptr< OUString >, 4 > ppP_Str
 
TokenPoolPool< double, 8 > pP_Dbl
 
TokenPoolPool< sal_uInt16, 8 > pP_Err
 
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 32 > ppP_RefTr
 
std::unique_ptr< sal_uInt16[]> pP_Id
 
sal_uInt16 nP_Id
 
sal_uInt16 nP_IdCurrent
 
sal_uInt16 nP_IdLast
 
TokenPoolPool< std::unique_ptr< EXTCONT >, 32 > ppP_Ext
 
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 16 > ppP_Nlf
 
std::unique_ptr< ScMatrix *[]> ppP_Matrix
 
sal_uInt16 nP_Matrix
 
sal_uInt16 nP_MatrixCurrent
 
::std::vector< RangeNamemaRangeNames
 
::std::vector< ExtNamemaExtNames
 
::std::vector< ExtCellRefmaExtCellRefs
 
::std::vector< ExtAreaRefmaExtAreaRefs
 
std::unique_ptr< sal_uInt16[]> pElement
 
std::unique_ptr< E_TYPE[]> pType
 
std::unique_ptr< sal_uInt16[]> pSize
 
sal_uInt16 nElement
 
sal_uInt16 nElementCurrent
 
sal_uInt16 m_nRek
 

Static Private Attributes

static const sal_uInt16 nScTokenOff = 8192
 

Detailed Description

Definition at line 129 of file tokstack.hxx.

Constructor & Destructor Documentation

◆ TokenPool()

TokenPool::TokenPool ( svl::SharedStringPool rSPool)

Definition at line 46 of file tokstack.cxx.

References nElement, nP_Id, nP_IdLast, nP_Matrix, pElement, pP_Id, ppP_Matrix, pSize, pType, and Reset().

◆ ~TokenPool()

TokenPool::~TokenPool ( )

Definition at line 67 of file tokstack.cxx.

References ClearMatrix().

Member Function Documentation

◆ CheckElementOrGrow()

bool TokenPool::CheckElementOrGrow ( )
private
Returns
false means nElementCurrent range below nScTokenOff would overflow or further allocation is not possible, no new ID available other than nElementCurrent+1.

Definition at line 107 of file tokstack.cxx.

References GrowElement(), nElement, nElementCurrent, nScTokenOff, and SAL_WARN.

Referenced by operator>>(), Store(), StoreExtName(), StoreExtRef(), StoreMatrix(), StoreName(), and StoreNlf().

◆ ClearMatrix()

void TokenPool::ClearMatrix ( )
private

Definition at line 740 of file tokstack.cxx.

References n, nP_Matrix, and ppP_Matrix.

Referenced by Reset(), and ~TokenPool().

◆ GetElement()

bool TokenPool::GetElement ( const sal_uInt16  nId,
ScTokenArray pScToken 
)
private

◆ GetElementRek()

bool TokenPool::GetElementRek ( const sal_uInt16  nId,
ScTokenArray pScToken 
)
private

◆ GetExternal()

const OUString * TokenPool::GetExternal ( const TokenId rId) const

Definition at line 713 of file tokstack.cxx.

References n, nElementCurrent, p, pElement, ppP_Ext, pType, and T_Ext.

Referenced by ExcelToSc::DoMulArgs().

◆ GetMatrix()

ScMatrix * TokenPool::GetMatrix ( unsigned int  n) const

Definition at line 731 of file tokstack.cxx.

References n, nP_MatrixCurrent, ppP_Matrix, and SAL_WARN.

Referenced by ExcelToSc::ReadExtensionArray().

◆ GetTokenArray()

std::unique_ptr< ScTokenArray > TokenPool::GetTokenArray ( const ScDocument rDoc,
const TokenId rId 
)
inline

◆ GrowElement()

bool TokenPool::GrowElement ( )
private

Definition at line 122 of file tokstack.cxx.

References lcl_canGrow(), nElement, pElement, pSize, and pType.

Referenced by CheckElementOrGrow().

◆ GrowId()

bool TokenPool::GrowId ( )
private

Definition at line 88 of file tokstack.cxx.

References lcl_canGrow(), nP_Id, and pP_Id.

Referenced by operator<<().

◆ GrowMatrix()

bool TokenPool::GrowMatrix ( )
private

Definition at line 151 of file tokstack.cxx.

References lcl_canGrow(), nP_Matrix, and ppP_Matrix.

Referenced by StoreMatrix().

◆ GrowTripel()

bool TokenPool::GrowTripel ( sal_uInt16  nByMin)
private

◆ IsSingleOp()

bool TokenPool::IsSingleOp ( const TokenId rId,
const DefTokenId  eId 
) const

Definition at line 687 of file tokstack.cxx.

References nElementCurrent, nId, nP_Id, nScTokenOff, pElement, pP_Id, pSize, pType, and T_Id.

Referenced by ExcelToSc::DoMulArgs().

◆ operator<<() [1/3]

TokenPool & TokenPool::operator<< ( const DefTokenId  eId)
inline

Definition at line 364 of file tokstack.hxx.

References GrowId(), nP_Id, nP_IdCurrent, nScTokenOff, pP_Id, and SAL_WARN.

◆ operator<<() [2/3]

TokenPool & TokenPool::operator<< ( const TokenId rId)
inline

Definition at line 333 of file tokstack.hxx.

References GrowId(), nId, nP_Id, nP_IdCurrent, nScTokenOff, ocErrNull, pP_Id, and SAL_WARN.

◆ operator<<() [3/3]

TokenPool & TokenPool::operator<< ( TokenStack rStack)
inline

Definition at line 380 of file tokstack.hxx.

References TokenStack::Get(), GrowId(), nId, nP_Id, nP_IdCurrent, nScTokenOff, ocErrNull, and pP_Id.

◆ operator>>() [1/2]

void TokenPool::operator>> ( TokenId rId)

Definition at line 403 of file tokstack.cxx.

References CheckElementOrGrow(), nElementCurrent, nP_IdCurrent, nP_IdLast, pElement, pSize, pType, and T_Id.

◆ operator>>() [2/2]

void TokenPool::operator>> ( TokenStack rStack)
inline

Definition at line 397 of file tokstack.hxx.

References nId.

◆ Reset()

void TokenPool::Reset ( void  )

◆ Store() [1/7]

TokenId TokenPool::Store ( )
inline

◆ Store() [2/7]

TokenId TokenPool::Store ( const DefTokenId  eId,
const OUString &  rName 
)

Definition at line 528 of file tokstack.cxx.

References CheckElementOrGrow(), nElementCurrent, pElement, ppP_Ext, pType, and T_Ext.

◆ Store() [3/7]

TokenId TokenPool::Store ( const double &  rDouble)

◆ Store() [4/7]

TokenId TokenPool::Store ( const OUString &  rString)

◆ Store() [5/7]

TokenId TokenPool::Store ( const sal_uInt16  nIndex)

Definition at line 441 of file tokstack.cxx.

References nIndex, and StoreName().

◆ Store() [6/7]

TokenId TokenPool::Store ( const ScComplexRefData rTr)

◆ Store() [7/7]

TokenId TokenPool::Store ( const ScSingleRefData rTr)

◆ StoreExtName()

TokenId TokenPool::StoreExtName ( sal_uInt16  nFileId,
const OUString &  rName 
)

◆ StoreExtRef() [1/2]

TokenId TokenPool::StoreExtRef ( sal_uInt16  nFileId,
const OUString &  rTabName,
const ScComplexRefData rRef 
)

◆ StoreExtRef() [2/2]

TokenId TokenPool::StoreExtRef ( sal_uInt16  nFileId,
const OUString &  rTabName,
const ScSingleRefData rRef 
)

◆ StoreMatrix()

TokenId TokenPool::StoreMatrix ( )

◆ StoreName()

TokenId TokenPool::StoreName ( sal_uInt16  nIndex,
sal_Int16  nSheet 
)

◆ StoreNlf()

TokenId TokenPool::StoreNlf ( const ScSingleRefData rTr)

Member Data Documentation

◆ m_nRek

sal_uInt16 TokenPool::m_nRek
private

Definition at line 210 of file tokstack.hxx.

Referenced by GetElementRek(), and GetTokenArray().

◆ maExtAreaRefs

::std::vector<ExtAreaRef> TokenPool::maExtAreaRefs
private

Definition at line 200 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and StoreExtRef().

◆ maExtCellRefs

::std::vector<ExtCellRef> TokenPool::maExtCellRefs
private

Definition at line 191 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and StoreExtRef().

◆ maExtNames

::std::vector<ExtName> TokenPool::maExtNames
private

Definition at line 182 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and StoreExtName().

◆ maRangeNames

::std::vector<RangeName> TokenPool::maRangeNames
private

Definition at line 174 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and StoreName().

◆ mrStringPool

svl::SharedStringPool& TokenPool::mrStringPool
private

Definition at line 134 of file tokstack.hxx.

Referenced by GetElement().

◆ nElement

sal_uInt16 TokenPool::nElement
private

Definition at line 205 of file tokstack.hxx.

Referenced by CheckElementOrGrow(), GrowElement(), and TokenPool().

◆ nElementCurrent

sal_uInt16 TokenPool::nElementCurrent
private

◆ nP_Id

sal_uInt16 TokenPool::nP_Id
private

Definition at line 147 of file tokstack.hxx.

Referenced by GetElementRek(), GrowId(), IsSingleOp(), operator<<(), and TokenPool().

◆ nP_IdCurrent

sal_uInt16 TokenPool::nP_IdCurrent
private

Definition at line 148 of file tokstack.hxx.

Referenced by operator<<(), operator>>(), and Reset().

◆ nP_IdLast

sal_uInt16 TokenPool::nP_IdLast
private

Definition at line 149 of file tokstack.hxx.

Referenced by operator>>(), Reset(), and TokenPool().

◆ nP_Matrix

sal_uInt16 TokenPool::nP_Matrix
private

Definition at line 165 of file tokstack.hxx.

Referenced by ClearMatrix(), GetElement(), GrowMatrix(), StoreMatrix(), and TokenPool().

◆ nP_MatrixCurrent

sal_uInt16 TokenPool::nP_MatrixCurrent
private

Definition at line 166 of file tokstack.hxx.

Referenced by GetMatrix(), Reset(), and StoreMatrix().

◆ nScTokenOff

const sal_uInt16 TokenPool::nScTokenOff = 8192
staticprivate

Definition at line 208 of file tokstack.hxx.

Referenced by CheckElementOrGrow(), GetElementRek(), IsSingleOp(), and operator<<().

◆ pElement

std::unique_ptr<sal_uInt16[]> TokenPool::pElement
private

◆ pP_Dbl

TokenPoolPool<double, 8> TokenPool::pP_Dbl
private

Definition at line 139 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and Store().

◆ pP_Err

TokenPoolPool<sal_uInt16, 8> TokenPool::pP_Err
private

Definition at line 142 of file tokstack.hxx.

Referenced by GetElement(), and Reset().

◆ pP_Id

std::unique_ptr<sal_uInt16[]> TokenPool::pP_Id
private

Definition at line 146 of file tokstack.hxx.

Referenced by GetElementRek(), GrowId(), IsSingleOp(), operator<<(), and TokenPool().

◆ ppP_Ext

TokenPoolPool<std::unique_ptr<EXTCONT>, 32> TokenPool::ppP_Ext
private

Definition at line 159 of file tokstack.hxx.

Referenced by GetElement(), GetExternal(), Reset(), and Store().

◆ ppP_Matrix

std::unique_ptr<ScMatrix*[]> TokenPool::ppP_Matrix
private

Definition at line 164 of file tokstack.hxx.

Referenced by ClearMatrix(), GetElement(), GetMatrix(), GrowMatrix(), StoreMatrix(), and TokenPool().

◆ ppP_Nlf

TokenPoolPool<std::unique_ptr<ScSingleRefData>, 16> TokenPool::ppP_Nlf
private

Definition at line 162 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and StoreNlf().

◆ ppP_RefTr

TokenPoolPool<std::unique_ptr<ScSingleRefData>, 32> TokenPool::ppP_RefTr
private

Definition at line 145 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and Store().

◆ ppP_Str

TokenPoolPool<std::unique_ptr<OUString>, 4> TokenPool::ppP_Str
private

Definition at line 137 of file tokstack.hxx.

Referenced by GetElement(), Reset(), and Store().

◆ pSize

std::unique_ptr<sal_uInt16[]> TokenPool::pSize
private

Definition at line 204 of file tokstack.hxx.

Referenced by GetElementRek(), GrowElement(), IsSingleOp(), operator>>(), Store(), and TokenPool().

◆ pType

std::unique_ptr<E_TYPE[]> TokenPool::pType
private

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