= ScDPOutput =

An ScDPOutput instance represents a single data pilot table.  It holds data about the layout of the output table but it has little information about the underlying fields.  It relies on the DataPilotSource service instance to provide the result data matrix via XDataPilotResults::getResults() method.  Once obtained, it stores it as a data member (aData).

The ScDPOutput::Output() method generates the output to the sheet.

= ScDPResultMember / ScDPResultDimension / ScDPDataMember / ScDPDataDimension =

ScDPSource owns two instances of ScDPResultMember, one to point to the root of
column results, and the other to the root of row results.  Each ScDPResultMember instance holds exactly one instance of ScDPResultDimension as pChildDimension, and each ScDPResultDimension instance holds multiple instances of ScDPResultMember.

Each ScDPResultMember instance also has an instance of ScDPDataMember as pDataRoot.  ScDPDataMember also has a similar recursive structure as the ScDPResultMember counterpart in that it has one ScDPDataDimension instance which in turn holds multiple instances of ScDPDataMember, and that relationship continues recursively.  The SCDPDataMember tree is initialized when ScDPResultData's ProcessData() gets called for the first time, to build its tree.

All of ScDPResultMember, ScDPResultDimension, ScDPDataMember and ScDPDataDimension have a const pointer to ScDPResultData to query information on result calculation methods.  ScDPDataMember and ScDPDataDimension have a const pointer to corresponding ScDPResultMember and ScDPResultDimension instances, respectively.


= ScDPResultData =

ScDPSource holds an instance of ScDPResultData, and two instances of ScDPResultMember, one for column result (pColResRoot), and the other for row result (pRowResRoot).  These instances all get constructed within the CreateRes_Impl() method.  The instance of ScDPResultData gets passed around to other parts of the code, but it is the ScDPSource instance that manages its life time.

A new instance of ScDPResultData gets created every time a result is computed.  The old instance gets destroyed (via ScDPSource::disposeData() method) before the new instance gets created.

ScDPResultData stores result calculation method for each data field, such as function to use (sum, count, average etc.) and reference field and item if any.


= ScDPSource::CreateRes_Impl() =

This is THE method to trace in order to understand the overall flow of DataPilot's result calculation.  Everything begins and ends here.  The instance of ScDPResultData is used to trigger (re)-calculation; when the instance exists, then this function won't get executed twice.  When there is no ScDPResultData instance, it instantiates and stores the ScDPResultData instance, and performs result calculation.


= ScDPInitState =

