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

This class represents the cached data part of the datapilot cache table implementation. More...

#include <dpcache.hxx>

Collaboration diagram for ScDPCache:
[legend]

Classes

class  DBConnector
 Interface for connecting to database source. More...
 
struct  Field
 
struct  GroupItems
 

Public Types

typedef std::unordered_set< OUString > StringSetType
 
typedef mdds::flat_segment_tree< SCROW, bool > EmptyRowsType
 
typedef std::vector< ScDPItemDataScDPItemDataVec
 
typedef o3tl::sorted_vector< ScDPObject * > ScDPObjectSet
 
typedef std::vector< SCROWIndexArrayType
 

Public Member Functions

rtl_uString * InternString (size_t nDim, const OUString &rStr)
 
void AddReference (ScDPObject *pObj) const
 
void RemoveReference (ScDPObject *pObj) const
 
const ScDPObjectSetGetAllReferences () const
 
SCROW GetIdByItemData (tools::Long nDim, const ScDPItemData &rItem) const
 
OUString GetFormattedString (tools::Long nDim, const ScDPItemData &rItem, bool bLocaleIndependent) const
 
SvNumberFormatterGetNumberFormatter () const
 
tools::Long AppendGroupField ()
 
void ResetGroupItems (tools::Long nDim, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nGroupType)
 
SCROW SetGroupItem (tools::Long nDim, const ScDPItemData &rData)
 
void GetGroupDimMemberIds (tools::Long nDim, std::vector< SCROW > &rIds) const
 
void ClearGroupFields ()
 
void ClearAllFields ()
 
const ScDPNumGroupInfoGetNumGroupInfo (tools::Long nDim) const
 
sal_Int32 GetGroupType (tools::Long nDim) const
 Return a group type identifier. More...
 
SCCOL GetDimensionIndex (std::u16string_view sName) const
 
sal_uInt32 GetNumberFormat (tools::Long nDim) const
 
bool IsDateDimension (tools::Long nDim) const
 
tools::Long GetDimMemberCount (tools::Long nDim) const
 
const IndexArrayTypeGetFieldIndexArray (size_t nDim) const
 
const ScDPItemDataVecGetDimMemberValues (SCCOL nDim) const
 
void InitFromDoc (ScDocument &rDoc, const ScRange &rRange)
 
bool InitFromDataBase (DBConnector &rDB)
 
SCROW GetRowCount () const
 Row count is the number of records plus any trailing empty rows in case the source data is sheet and contains trailing empty rows. More...
 
SCROW GetDataSize () const
 Data size is the number of records without any trailing empty rows for sheet source data. More...
 
SCROW GetItemDataId (sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const
 
OUString GetDimensionName (std::vector< OUString >::size_type nDim) const
 
bool IsRowEmpty (SCROW nRow) const
 
bool ValidQuery (SCROW nRow, const ScQueryParam &rQueryParam) const
 
ScDocumentGetDoc () const
 
tools::Long GetColumnCount () const
 
const ScDPItemDataGetItemDataById (tools::Long nDim, SCROW nId) const
 
size_t GetFieldCount () const
 
size_t GetGroupFieldCount () const
 
 ScDPCache (const ScDPCache &)=delete
 
const ScDPCacheoperator= (const ScDPCache &)=delete
 
 ScDPCache (ScDocument &rDoc)
 
 ~ScDPCache ()
 
void Dump () const
 

Static Public Member Functions

static sal_uInt32 GetLocaleIndependentFormat (SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat)
 
static OUString GetLocaleIndependentFormattedNumberString (double fValue)
 
static OUString GetLocaleIndependentFormattedString (double fValue, SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat)
 

Private Types

typedef std::vector< std::unique_ptr< Field > > FieldsType
 
typedef std::vector< std::unique_ptr< GroupItems > > GroupFieldsType
 

Private Member Functions

void PostInit ()
 
void Clear ()
 
const GroupItemsGetGroupItems (tools::Long nDim) const
 

Private Attributes

ScDocumentmrDoc
 
SCCOL mnColumnCount
 
ScDPObjectSet maRefObjects
 All pivot table objects that references this cache. More...
 
FieldsType maFields
 
GroupFieldsType maGroupFields
 
std::vector< StringSetTypemaStringPools
 
std::vector< OUString > maLabelNames
 
EmptyRowsType maEmptyRows
 
SCROW mnDataSize
 
SCROW mnRowCount
 
bool mbDisposing
 

Detailed Description

This class represents the cached data part of the datapilot cache table implementation.

Definition at line 47 of file dpcache.hxx.

Member Typedef Documentation

◆ EmptyRowsType

typedef mdds::flat_segment_tree<SCROW, bool> ScDPCache::EmptyRowsType

Definition at line 51 of file dpcache.hxx.

◆ FieldsType

typedef std::vector< std::unique_ptr<Field> > ScDPCache::FieldsType
private

Definition at line 119 of file dpcache.hxx.

◆ GroupFieldsType

typedef std::vector< std::unique_ptr<GroupItems> > ScDPCache::GroupFieldsType
private

Definition at line 120 of file dpcache.hxx.

◆ IndexArrayType

typedef std::vector<SCROW> ScDPCache::IndexArrayType

Definition at line 54 of file dpcache.hxx.

◆ ScDPItemDataVec

Definition at line 52 of file dpcache.hxx.

◆ ScDPObjectSet

Definition at line 53 of file dpcache.hxx.

◆ StringSetType

typedef std::unordered_set<OUString> ScDPCache::StringSetType

Definition at line 50 of file dpcache.hxx.

Constructor & Destructor Documentation

◆ ScDPCache() [1/2]

ScDPCache::ScDPCache ( const ScDPCache )
delete

◆ ScDPCache() [2/2]

ScDPCache::ScDPCache ( ScDocument rDoc)

Definition at line 72 of file dpcache.cxx.

◆ ~ScDPCache()

ScDPCache::~ScDPCache ( )

Member Function Documentation

◆ AddReference()

void ScDPCache::AddReference ( ScDPObject pObj) const

◆ AppendGroupField()

tools::Long ScDPCache::AppendGroupField ( )

Definition at line 1264 of file dpcache.cxx.

References maFields, and maGroupFields.

Referenced by ScDPSaveGroupDimension::AddToCache().

◆ Clear()

void ScDPCache::Clear ( )
private

◆ ClearAllFields()

void ScDPCache::ClearAllFields ( )

Definition at line 1362 of file dpcache.cxx.

References ClearGroupFields(), and maFields.

Referenced by ScDPCollection::ReloadGroupsInCache().

◆ ClearGroupFields()

void ScDPCache::ClearGroupFields ( )

Definition at line 1357 of file dpcache.cxx.

References maGroupFields.

Referenced by ClearAllFields().

◆ Dump()

void ScDPCache::Dump ( ) const

References Clear().

◆ GetAllReferences()

const ScDPCache::ScDPObjectSet & ScDPCache::GetAllReferences ( ) const

◆ GetColumnCount()

tools::Long ScDPCache::GetColumnCount ( ) const

◆ GetDataSize()

SCROW ScDPCache::GetDataSize ( ) const

Data size is the number of records without any trailing empty rows for sheet source data.

For any other source type, this should equal the row count.

Definition at line 1036 of file dpcache.cxx.

References GetRowCount(), and mnDataSize.

Referenced by ScDPFilteredCache::fillTable(), ScDPFilteredCache::filterByPageDimension(), and XclExpXmlPivotCaches::SavePivotCacheXml().

◆ GetDimensionIndex()

SCCOL ScDPCache::GetDimensionIndex ( std::u16string_view  sName) const

◆ GetDimensionName()

OUString ScDPCache::GetDimensionName ( std::vector< OUString >::size_type  nDim) const

◆ GetDimMemberCount()

tools::Long ScDPCache::GetDimMemberCount ( tools::Long  nDim) const

Definition at line 1079 of file dpcache.cxx.

References maFields, and mnColumnCount.

Referenced by ScDPFilteredCache::fillTable().

◆ GetDimMemberValues()

const ScDPCache::ScDPItemDataVec & ScDPCache::GetDimMemberValues ( SCCOL  nDim) const

◆ GetDoc()

ScDocument & ScDPCache::GetDoc ( ) const

◆ GetFieldCount()

size_t ScDPCache::GetFieldCount ( ) const

◆ GetFieldIndexArray()

const ScDPCache::IndexArrayType * ScDPCache::GetFieldIndexArray ( size_t  nDim) const

Definition at line 1042 of file dpcache.cxx.

References maFields.

◆ GetFormattedString()

OUString ScDPCache::GetFormattedString ( tools::Long  nDim,
const ScDPItemData rItem,
bool  bLocaleIndependent 
) const

◆ GetGroupDimMemberIds()

void ScDPCache::GetGroupDimMemberIds ( tools::Long  nDim,
std::vector< SCROW > &  rIds 
) const

Definition at line 1317 of file dpcache.cxx.

References i, maFields, maGroupFields, and n.

Referenced by ScDPGroupDimension::GetColumnEntries(), and ScDPNumGroupDimension::GetNumEntries().

◆ GetGroupFieldCount()

size_t ScDPCache::GetGroupFieldCount ( ) const

◆ GetGroupItems()

const ScDPCache::GroupItems * ScDPCache::GetGroupItems ( tools::Long  nDim) const
private

Definition at line 900 of file dpcache.cxx.

References get(), maFields, and maGroupFields.

Referenced by GetFormattedString().

◆ GetGroupType()

sal_Int32 ScDPCache::GetGroupType ( tools::Long  nDim) const

Return a group type identifier.

The values correspond with css::sheet::DataPilotFieldGroupBy constant values.

Parameters
nDim0-based dimension index.
Returns
group type identifier, or 0 on failure.

Definition at line 1389 of file dpcache.cxx.

References maFields, and maGroupFields.

Referenced by ScDPGroupTableData::FillGroupValues(), XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().

◆ GetIdByItemData()

SCROW ScDPCache::GetIdByItemData ( tools::Long  nDim,
const ScDPItemData rItem 
) const

◆ GetItemDataById()

const ScDPItemData * ScDPCache::GetItemDataById ( tools::Long  nDim,
SCROW  nId 
) const

◆ GetItemDataId()

SCROW ScDPCache::GetItemDataId ( sal_uInt16  nDim,
SCROW  nRow,
bool  bRepeatIfEmpty 
) const

◆ GetLocaleIndependentFormat()

sal_uInt32 ScDPCache::GetLocaleIndependentFormat ( SvNumberFormatter rFormatter,
sal_uInt32  nNumFormat 
)
static

◆ GetLocaleIndependentFormattedNumberString()

OUString ScDPCache::GetLocaleIndependentFormattedNumberString ( double  fValue)
static

Definition at line 1186 of file dpcache.cxx.

Referenced by GetFormattedString(), and GetLocaleIndependentFormattedString().

◆ GetLocaleIndependentFormattedString()

OUString ScDPCache::GetLocaleIndependentFormattedString ( double  fValue,
SvNumberFormatter rFormatter,
sal_uInt32  nNumFormat 
)
static

◆ GetNumberFormat()

sal_uInt32 ScDPCache::GetNumberFormat ( tools::Long  nDim) const

Definition at line 1056 of file dpcache.cxx.

References maFields, and mnColumnCount.

Referenced by GetFormattedString(), and ScSheetDPData::GetNumberFormat().

◆ GetNumberFormatter()

SvNumberFormatter * ScDPCache::GetNumberFormatter ( ) const

Definition at line 1259 of file dpcache.cxx.

References ScDocument::GetFormatTable(), and mrDoc.

◆ GetNumGroupInfo()

const ScDPNumGroupInfo * ScDPCache::GetNumGroupInfo ( tools::Long  nDim) const

◆ GetRowCount()

SCROW ScDPCache::GetRowCount ( ) const

Row count is the number of records plus any trailing empty rows in case the source data is sheet and contains trailing empty rows.

Definition at line 1031 of file dpcache.cxx.

References mnRowCount.

Referenced by GetDataSize(), and ScDPFilteredCache::getRowSize().

◆ InitFromDataBase()

bool ScDPCache::InitFromDataBase ( DBConnector rDB)

◆ InitFromDoc()

void ScDPCache::InitFromDoc ( ScDocument rDoc,
const ScRange rRange 
)

◆ InternString()

rtl_uString * ScDPCache::InternString ( size_t  nDim,
const OUString &  rStr 
)

Definition at line 1095 of file dpcache.cxx.

References maStringPools.

◆ IsDateDimension()

bool ScDPCache::IsDateDimension ( tools::Long  nDim) const

◆ IsRowEmpty()

bool ScDPCache::IsRowEmpty ( SCROW  nRow) const

Definition at line 893 of file dpcache.cxx.

References maEmptyRows.

◆ operator=()

const ScDPCache & ScDPCache::operator= ( const ScDPCache )
delete

◆ PostInit()

void ScDPCache::PostInit ( )
private

Definition at line 929 of file dpcache.cxx.

References maEmptyRows, maFields, and mnDataSize.

Referenced by InitFromDataBase(), and InitFromDoc().

◆ RemoveReference()

void ScDPCache::RemoveReference ( ScDPObject pObj) const

◆ ResetGroupItems()

void ScDPCache::ResetGroupItems ( tools::Long  nDim,
const ScDPNumGroupInfo rNumInfo,
sal_Int32  nGroupType 
)

◆ SetGroupItem()

SCROW ScDPCache::SetGroupItem ( tools::Long  nDim,
const ScDPItemData rData 
)

◆ ValidQuery()

bool ScDPCache::ValidQuery ( SCROW  nRow,
const ScQueryParam rQueryParam 
) const

Member Data Documentation

◆ maEmptyRows

EmptyRowsType ScDPCache::maEmptyRows
private

Definition at line 127 of file dpcache.hxx.

Referenced by Clear(), InitFromDataBase(), InitFromDoc(), IsRowEmpty(), and PostInit().

◆ maFields

FieldsType ScDPCache::maFields
private

◆ maGroupFields

GroupFieldsType ScDPCache::maGroupFields
private

◆ maLabelNames

std::vector<OUString> ScDPCache::maLabelNames
private

◆ maRefObjects

ScDPObjectSet ScDPCache::maRefObjects
mutableprivate

All pivot table objects that references this cache.

Definition at line 117 of file dpcache.hxx.

Referenced by AddReference(), GetAllReferences(), RemoveReference(), and ~ScDPCache().

◆ maStringPools

std::vector<StringSetType> ScDPCache::maStringPools
private

Definition at line 124 of file dpcache.hxx.

Referenced by Clear(), InitFromDataBase(), InitFromDoc(), and InternString().

◆ mbDisposing

bool ScDPCache::mbDisposing
private

Definition at line 131 of file dpcache.hxx.

Referenced by RemoveReference(), and ~ScDPCache().

◆ mnColumnCount

SCCOL ScDPCache::mnColumnCount
private

◆ mnDataSize

SCROW ScDPCache::mnDataSize
private

Definition at line 128 of file dpcache.hxx.

Referenced by GetDataSize(), and PostInit().

◆ mnRowCount

SCROW ScDPCache::mnRowCount
private

Definition at line 129 of file dpcache.hxx.

Referenced by Clear(), GetRowCount(), InitFromDataBase(), and InitFromDoc().

◆ mrDoc

ScDocument& ScDPCache::mrDoc
private

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