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

This class maintains pivot table calculation result in a tree structure which represents the logical structure of pivot table result layout as presented in the sheet. More...

#include <dpresfilter.hxx>

Classes

struct  DimensionNode
 
struct  MemberNode
 
struct  NamePairHash
 

Public Types

typedef std::vector< double > ValuesType
 

Public Member Functions

 ScDPResultTree ()
 
 ScDPResultTree (const ScDPResultTree &)=delete
 
const ScDPResultTreeoperator= (const ScDPResultTree &)=delete
 
 ~ScDPResultTree ()
 
void add (const std::vector< ScDPResultFilter > &rFilter, double fVal)
 Add a single value filter path. More...
 
void swap (ScDPResultTree &rOther)
 
bool empty () const
 
void clear ()
 
const ValuesTypegetResults (const css::uno::Sequence< css::sheet::DataPilotFieldFilter > &rFilters) const
 
double getLeafResult (const css::sheet::DataPilotFieldFilter &rFilter) const
 

Private Types

typedef std::map< OUString, std::shared_ptr< MemberNode > > MembersType
 
typedef std::pair< OUString, OUString > NamePairType
 
typedef std::unordered_map< NamePairType, double, NamePairHashLeafValuesType
 

Private Attributes

LeafValuesType maLeafValues
 
OUString maPrimaryDimName
 
std::unique_ptr< MemberNodempRoot
 

Detailed Description

This class maintains pivot table calculation result in a tree structure which represents the logical structure of pivot table result layout as presented in the sheet.

The root node has two child nodes if the pivot table consists of both column and row dimensions. The first child stores the result tree that is first filtered by row dimensions then by column dimensions. The second child stores the result tree that is filtered by column dimensions only (for column grand totals).

If the pivot table layout only consists of either column or row dimensions, the root node only has one child node.

Definition at line 55 of file dpresfilter.hxx.

Member Typedef Documentation

◆ LeafValuesType

typedef std::unordered_map<NamePairType, double, NamePairHash> ScDPResultTree::LeafValuesType
private

Definition at line 95 of file dpresfilter.hxx.

◆ MembersType

typedef std::map<OUString, std::shared_ptr<MemberNode> > ScDPResultTree::MembersType
private

Definition at line 62 of file dpresfilter.hxx.

◆ NamePairType

typedef std::pair<OUString, OUString> ScDPResultTree::NamePairType
private

Definition at line 89 of file dpresfilter.hxx.

◆ ValuesType

typedef std::vector<double> ScDPResultTree::ValuesType

Definition at line 58 of file dpresfilter.hxx.

Constructor & Destructor Documentation

◆ ScDPResultTree() [1/2]

ScDPResultTree::ScDPResultTree ( )

Definition at line 78 of file dpresfilter.cxx.

◆ ScDPResultTree() [2/2]

ScDPResultTree::ScDPResultTree ( const ScDPResultTree )
delete

◆ ~ScDPResultTree()

ScDPResultTree::~ScDPResultTree ( )

Definition at line 79 of file dpresfilter.cxx.

Member Function Documentation

◆ add()

void ScDPResultTree::add ( const std::vector< ScDPResultFilter > &  rFilter,
double  fVal 
)

Add a single value filter path.

The filters are expected to be sorted by row dimension order then by column dimension order.

Parameters
rFilterset of filters.
fValresult value, as displayed in the table output.

Definition at line 83 of file dpresfilter.cxx.

References ScGlobal::getCharClass(), ScDPResultTree::MemberNode::maChildDimensions, ScDPResultTree::DimensionNode::maChildMembersValueNames, ScDPResultTree::DimensionNode::maChildMembersValues, maLeafValues, maPrimaryDimName, ScDPResultTree::MemberNode::maValues, mpRoot, SAL_WARN_IF, and CharClass::uppercase().

Referenced by ScDPDataMember::FillDataRow().

◆ clear()

void ScDPResultTree::clear ( )

Definition at line 188 of file dpresfilter.cxx.

References maPrimaryDimName, and mpRoot.

Referenced by ScDPSource::disposeData().

◆ empty()

bool ScDPResultTree::empty ( ) const

Definition at line 183 of file dpresfilter.cxx.

References mpRoot.

Referenced by ScDPSource::getFilteredResults().

◆ getLeafResult()

double ScDPResultTree::getLeafResult ( const css::sheet::DataPilotFieldFilter &  rFilter) const

◆ getResults()

const ScDPResultTree::ValuesType * ScDPResultTree::getResults ( const css::uno::Sequence< css::sheet::DataPilotFieldFilter > &  rFilters) const

◆ operator=()

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

References dump().

◆ swap()

void ScDPResultTree::swap ( ScDPResultTree rOther)

Definition at line 176 of file dpresfilter.cxx.

References maLeafValues, maPrimaryDimName, and mpRoot.

Referenced by ScDPSource::getResults().

Member Data Documentation

◆ maLeafValues

LeafValuesType ScDPResultTree::maLeafValues
private

Definition at line 96 of file dpresfilter.hxx.

Referenced by add(), getLeafResult(), and swap().

◆ maPrimaryDimName

OUString ScDPResultTree::maPrimaryDimName
private

Definition at line 98 of file dpresfilter.hxx.

Referenced by add(), clear(), and swap().

◆ mpRoot

std::unique_ptr<MemberNode> ScDPResultTree::mpRoot
private

Definition at line 99 of file dpresfilter.hxx.

Referenced by add(), clear(), empty(), getResults(), and swap().


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