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 (const OUString &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 48 of file dpcache.hxx.

Member Typedef Documentation

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

Definition at line 52 of file dpcache.hxx.

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

Definition at line 120 of file dpcache.hxx.

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

Definition at line 121 of file dpcache.hxx.

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

Definition at line 55 of file dpcache.hxx.

Definition at line 53 of file dpcache.hxx.

Definition at line 54 of file dpcache.hxx.

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

Definition at line 51 of file dpcache.hxx.

Constructor & Destructor Documentation

ScDPCache::ScDPCache ( const ScDPCache )
delete
ScDPCache::ScDPCache ( ScDocument rDoc)

Definition at line 71 of file dpcache.cxx.

ScDPCache::~ScDPCache ( )

Member Function Documentation

void ScDPCache::AddReference ( ScDPObject pObj) const
tools::Long ScDPCache::AppendGroupField ( )

Definition at line 1269 of file dpcache.cxx.

References maFields, and maGroupFields.

Referenced by ScDPSaveGroupDimension::AddToCache().

void ScDPCache::Clear ( )
private
void ScDPCache::ClearAllFields ( )

Definition at line 1367 of file dpcache.cxx.

References ClearGroupFields(), and maFields.

Referenced by ScDPCollection::ReloadGroupsInCache().

void ScDPCache::ClearGroupFields ( )

Definition at line 1362 of file dpcache.cxx.

References maGroupFields.

Referenced by ClearAllFields().

void ScDPCache::Dump ( ) const
const ScDPCache::ScDPObjectSet & ScDPCache::GetAllReferences ( ) const
tools::Long ScDPCache::GetColumnCount ( ) const
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 1038 of file dpcache.cxx.

References GetRowCount(), and mnDataSize.

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

SCCOL ScDPCache::GetDimensionIndex ( const OUString &  sName) const
OUString ScDPCache::GetDimensionName ( std::vector< OUString >::size_type  nDim) const
tools::Long ScDPCache::GetDimMemberCount ( tools::Long  nDim) const

Definition at line 1081 of file dpcache.cxx.

References maFields, and mnColumnCount.

Referenced by ScDPFilteredCache::fillTable().

const ScDPCache::ScDPItemDataVec & ScDPCache::GetDimMemberValues ( SCCOL  nDim) const
ScDocument & ScDPCache::GetDoc ( ) const
size_t ScDPCache::GetFieldCount ( ) const
const ScDPCache::IndexArrayType * ScDPCache::GetFieldIndexArray ( size_t  nDim) const

Definition at line 1044 of file dpcache.cxx.

References maFields.

OUString ScDPCache::GetFormattedString ( tools::Long  nDim,
const ScDPItemData rItem,
bool  bLocaleIndependent 
) const
void ScDPCache::GetGroupDimMemberIds ( tools::Long  nDim,
std::vector< SCROW > &  rIds 
) const
size_t ScDPCache::GetGroupFieldCount ( ) const
const ScDPCache::GroupItems * ScDPCache::GetGroupItems ( tools::Long  nDim) const
private

Definition at line 902 of file dpcache.cxx.

References maFields, and maGroupFields.

Referenced by GetFormattedString().

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 1394 of file dpcache.cxx.

References maFields, and maGroupFields.

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

SCROW ScDPCache::GetIdByItemData ( tools::Long  nDim,
const ScDPItemData rItem 
) const
const ScDPItemData * ScDPCache::GetItemDataById ( tools::Long  nDim,
SCROW  nId 
) const
SCROW ScDPCache::GetItemDataId ( sal_uInt16  nDim,
SCROW  nRow,
bool  bRepeatIfEmpty 
) const
sal_uInt32 ScDPCache::GetLocaleIndependentFormat ( SvNumberFormatter rFormatter,
sal_uInt32  nNumFormat 
)
static
OUString ScDPCache::GetLocaleIndependentFormattedNumberString ( double  fValue)
static

Definition at line 1191 of file dpcache.cxx.

Referenced by GetFormattedString(), and GetLocaleIndependentFormattedString().

OUString ScDPCache::GetLocaleIndependentFormattedString ( double  fValue,
SvNumberFormatter rFormatter,
sal_uInt32  nNumFormat 
)
static
sal_uInt32 ScDPCache::GetNumberFormat ( tools::Long  nDim) const

Definition at line 1058 of file dpcache.cxx.

References maFields, and mnColumnCount.

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

SvNumberFormatter * ScDPCache::GetNumberFormatter ( ) const

Definition at line 1264 of file dpcache.cxx.

References ScDocument::GetFormatTable(), and mrDoc.

const ScDPNumGroupInfo * ScDPCache::GetNumGroupInfo ( tools::Long  nDim) const
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 1033 of file dpcache.cxx.

References mnRowCount.

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

bool ScDPCache::InitFromDataBase ( DBConnector rDB)
void ScDPCache::InitFromDoc ( ScDocument rDoc,
const ScRange rRange 
)
rtl_uString * ScDPCache::InternString ( size_t  nDim,
const OUString &  rStr 
)

Definition at line 1097 of file dpcache.cxx.

References assert(), and maStringPools.

bool ScDPCache::IsDateDimension ( tools::Long  nDim) const
bool ScDPCache::IsRowEmpty ( SCROW  nRow) const

Definition at line 895 of file dpcache.cxx.

References maEmptyRows.

const ScDPCache& ScDPCache::operator= ( const ScDPCache )
delete
void ScDPCache::PostInit ( )
private

Definition at line 931 of file dpcache.cxx.

References maEmptyRows, maFields, and mnDataSize.

Referenced by InitFromDataBase(), and InitFromDoc().

void ScDPCache::RemoveReference ( ScDPObject pObj) const
void ScDPCache::ResetGroupItems ( tools::Long  nDim,
const ScDPNumGroupInfo rNumInfo,
sal_Int32  nGroupType 
)
SCROW ScDPCache::SetGroupItem ( tools::Long  nDim,
const ScDPItemData rData 
)
bool ScDPCache::ValidQuery ( SCROW  nRow,
const ScQueryParam rQueryParam 
) const

Member Data Documentation

EmptyRowsType ScDPCache::maEmptyRows
private

Definition at line 128 of file dpcache.hxx.

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

FieldsType ScDPCache::maFields
private
GroupFieldsType ScDPCache::maGroupFields
private
std::vector<OUString> ScDPCache::maLabelNames
private
ScDPObjectSet ScDPCache::maRefObjects
mutableprivate

All pivot table objects that references this cache.

Definition at line 118 of file dpcache.hxx.

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

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

Definition at line 125 of file dpcache.hxx.

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

bool ScDPCache::mbDisposing
private

Definition at line 132 of file dpcache.hxx.

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

SCCOL ScDPCache::mnColumnCount
private
SCROW ScDPCache::mnDataSize
private

Definition at line 129 of file dpcache.hxx.

Referenced by GetDataSize(), and PostInit().

SCROW ScDPCache::mnRowCount
private

Definition at line 130 of file dpcache.hxx.

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

ScDocument& ScDPCache::mrDoc
private

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