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

Definition at line 67 of file tokstack.cxx.

References ClearMatrix().

Member Function Documentation

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

void TokenPool::ClearMatrix ( )
private

Definition at line 740 of file tokstack.cxx.

References n, nP_Matrix, and ppP_Matrix.

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

bool TokenPool::GetElement ( const sal_uInt16  nId,
ScTokenArray pScToken 
)
private
bool TokenPool::GetElementRek ( const sal_uInt16  nId,
ScTokenArray pScToken 
)
private
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().

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

Definition at line 731 of file tokstack.cxx.

References nP_MatrixCurrent, ppP_Matrix, and SAL_WARN.

Referenced by ExcelToSc::ReadExtensionArray().

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

Definition at line 122 of file tokstack.cxx.

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

Referenced by CheckElementOrGrow().

bool TokenPool::GrowId ( )
private

Definition at line 88 of file tokstack.cxx.

References lcl_canGrow(), nP_Id, and pP_Id.

Referenced by operator<<().

bool TokenPool::GrowMatrix ( )
private

Definition at line 151 of file tokstack.cxx.

References lcl_canGrow(), nP_Matrix, and ppP_Matrix.

Referenced by StoreMatrix().

bool TokenPool::GrowTripel ( sal_uInt16  nByMin)
private
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().

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.

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.

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.

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.

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

Definition at line 397 of file tokstack.hxx.

References nId.

void TokenPool::Reset ( void  )
TokenId TokenPool::Store ( )
inline
TokenId TokenPool::Store ( const double &  rDouble)
TokenId TokenPool::Store ( const sal_uInt16  nIndex)

Definition at line 441 of file tokstack.cxx.

References StoreName().

TokenId TokenPool::Store ( const OUString &  rString)
TokenId TokenPool::Store ( const ScSingleRefData rTr)
TokenId TokenPool::Store ( const ScComplexRefData rTr)
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.

TokenId TokenPool::StoreExtName ( sal_uInt16  nFileId,
const OUString &  rName 
)
TokenId TokenPool::StoreExtRef ( sal_uInt16  nFileId,
const OUString &  rTabName,
const ScSingleRefData rRef 
)
TokenId TokenPool::StoreExtRef ( sal_uInt16  nFileId,
const OUString &  rTabName,
const ScComplexRefData rRef 
)
TokenId TokenPool::StoreMatrix ( )
TokenId TokenPool::StoreName ( sal_uInt16  nIndex,
sal_Int16  nSheet 
)
TokenId TokenPool::StoreNlf ( const ScSingleRefData rTr)

Member Data Documentation

sal_uInt16 TokenPool::m_nRek
private

Definition at line 210 of file tokstack.hxx.

Referenced by GetElementRek(), and GetTokenArray().

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

Definition at line 200 of file tokstack.hxx.

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

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

Definition at line 191 of file tokstack.hxx.

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

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

Definition at line 182 of file tokstack.hxx.

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

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

Definition at line 174 of file tokstack.hxx.

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

svl::SharedStringPool& TokenPool::mrStringPool
private

Definition at line 134 of file tokstack.hxx.

Referenced by GetElement().

sal_uInt16 TokenPool::nElement
private

Definition at line 205 of file tokstack.hxx.

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

sal_uInt16 TokenPool::nElementCurrent
private
sal_uInt16 TokenPool::nP_Id
private

Definition at line 147 of file tokstack.hxx.

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

sal_uInt16 TokenPool::nP_IdCurrent
private

Definition at line 148 of file tokstack.hxx.

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

sal_uInt16 TokenPool::nP_IdLast
private

Definition at line 149 of file tokstack.hxx.

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

sal_uInt16 TokenPool::nP_Matrix
private

Definition at line 165 of file tokstack.hxx.

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

sal_uInt16 TokenPool::nP_MatrixCurrent
private

Definition at line 166 of file tokstack.hxx.

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

const sal_uInt16 TokenPool::nScTokenOff = 8192
staticprivate

Definition at line 208 of file tokstack.hxx.

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

std::unique_ptr<sal_uInt16[]> TokenPool::pElement
private
TokenPoolPool<double, 8> TokenPool::pP_Dbl
private

Definition at line 139 of file tokstack.hxx.

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

TokenPoolPool<sal_uInt16, 8> TokenPool::pP_Err
private

Definition at line 142 of file tokstack.hxx.

Referenced by GetElement(), and Reset().

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

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

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

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

Definition at line 162 of file tokstack.hxx.

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

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

Definition at line 145 of file tokstack.hxx.

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

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

Definition at line 137 of file tokstack.hxx.

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

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

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

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