LibreOffice Module sc (master) 1
|
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 ScDPResultTree & | operator= (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 ValuesType * | getResults (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, NamePairHash > | LeafValuesType |
Private Attributes | |
LeafValuesType | maLeafValues |
OUString | maPrimaryDimName |
std::unique_ptr< MemberNode > | mpRoot |
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.
|
private |
Definition at line 95 of file dpresfilter.hxx.
|
private |
Definition at line 62 of file dpresfilter.hxx.
|
private |
Definition at line 89 of file dpresfilter.hxx.
typedef std::vector<double> ScDPResultTree::ValuesType |
Definition at line 58 of file dpresfilter.hxx.
ScDPResultTree::ScDPResultTree | ( | ) |
Definition at line 78 of file dpresfilter.cxx.
|
delete |
ScDPResultTree::~ScDPResultTree | ( | ) |
Definition at line 79 of file dpresfilter.cxx.
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.
rFilter | set of filters. |
fVal | result 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().
void ScDPResultTree::clear | ( | ) |
Definition at line 188 of file dpresfilter.cxx.
References maPrimaryDimName, and mpRoot.
Referenced by ScDPSource::disposeData().
bool ScDPResultTree::empty | ( | ) | const |
Definition at line 183 of file dpresfilter.cxx.
References mpRoot.
Referenced by ScDPSource::getFilteredResults().
double ScDPResultTree::getLeafResult | ( | const css::sheet::DataPilotFieldFilter & | rFilter | ) | const |
Definition at line 245 of file dpresfilter.cxx.
References ScGlobal::getCharClass(), maLeafValues, and CharClass::uppercase().
Referenced by ScDPSource::getFilteredResults().
const ScDPResultTree::ValuesType * ScDPResultTree::getResults | ( | const css::uno::Sequence< css::sheet::DataPilotFieldFilter > & | rFilters | ) | const |
Definition at line 194 of file dpresfilter.cxx.
References ScGlobal::getCharClass(), ScDPResultTree::MemberNode::maChildDimensions, ScDPResultTree::DimensionNode::maChildMembersValueNames, ScDPResultTree::DimensionNode::maChildMembersValues, ScDPResultTree::MemberNode::maValues, mpRoot, and CharClass::uppercase().
Referenced by ScDPSource::getFilteredResults().
|
delete |
References dump().
void ScDPResultTree::swap | ( | ScDPResultTree & | rOther | ) |
Definition at line 176 of file dpresfilter.cxx.
References maLeafValues, maPrimaryDimName, and mpRoot.
Referenced by ScDPSource::getResults().
|
private |
Definition at line 96 of file dpresfilter.hxx.
Referenced by add(), getLeafResult(), and swap().
|
private |
Definition at line 98 of file dpresfilter.hxx.
|
private |
Definition at line 99 of file dpresfilter.hxx.
Referenced by add(), clear(), empty(), getResults(), and swap().