OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
agg_util::GridAggregateOnOuterDimension Class Reference

class GridAggregateOnOuterDimension : public GridAggregationBase More...

#include <GridAggregateOnOuterDimension.h>

Inheritance diagram for agg_util::GridAggregateOnOuterDimension:
Inheritance graph
Collaboration diagram for agg_util::GridAggregateOnOuterDimension:
Collaboration graph

Public Member Functions

virtual const AMDListgetDatasetList () const
 Accessor for the dataset description list that describes this aggregation. More...
 
 GridAggregateOnOuterDimension (const Grid &proto, const Dimension &newDim, const AMDList &memberDatasets, const DDSLoader &loaderProto)
 Create the new Grid from the template proto... More...
 
 GridAggregateOnOuterDimension (const GridAggregateOnOuterDimension &proto)
 
GridAggregateOnOuterDimensionoperator= (const GridAggregateOnOuterDimension &rhs)
 
virtual GridAggregateOnOuterDimensionptr_duplicate ()
 
virtual bool read ()
 Read in only those datasets that are in the constrained output making sure to apply the internal dimension constraints to the member datasets properly before reading them! Stream the data into the output buffer correctly. More...
 
void setShapeFrom (const libdap::Grid &protoSubGrid, bool addMaps)
 Use the data array and maps from protoSubGrid as the initial point for the shape of the Grid. More...
 
BaseType * transform_to_dap4 (libdap::D4Group *root, libdap::Constructor *container)
 
virtual ~GridAggregateOnOuterDimension ()
 

Protected Member Functions

void copyProtoMapsIntoThisGrid (const Dimension &aggDim)
 Copy the template's read in subgrid maps into this. More...
 
virtual const DimensiongetAggregationDimension () const
 Get the contained aggregation dimension info. More...
 
Grid * getSubGridTemplate ()
 Reveals the raw ptr, but only to subclasses. More...
 
void printConstraints (const libdap::Array &fromArray)
 
virtual void readAndAggregateConstrainedMapsHook ()
 Called from read()! Invokes the user hooks eventually. More...
 
void readProtoSubGrid ()
 Transfer constraints properly from this object's maps and read in the proto subgrid entirely (respecting constraints) More...
 
virtual void transferConstraintsToSubGridHook (Grid *pSubGrid)
 For the data array and all maps, transfer the constraints from the super grid (ie this) to all the grids in the given prototype subgrid. More...
 

Detailed Description

class GridAggregateOnOuterDimension : public GridAggregationBase

Grid that performs a joinNew aggregation by taking an ordered list of datatsets which contain Grid's with matching signatures (ie array name, dimensions, maps) and creating a new outer dimension with cardinality the number of datasets in the aggregation.

The resulting aggregated grid will be one plus the rank of the array's of the member dataset Grids.

We assume we have created the proper shape of this Grid so that the map vectors in the Grid superclass are correct (as loaded from the first dataset!)

The data itself will be loaded as needed during serialize based on the response.

TODO OPTIMIZE One major issue is we create one of these objects per aggregation variable, even if these vars are in the same dataset. So when we read, we load the dataset for each variable! Does the BES cache them or something? Maybe we can avoid doing this with some smarts? Not sure... I get the feeling the other handlers do the same sort of thing, but can be smarter about seeking, etc.

Definition at line 84 of file GridAggregateOnOuterDimension.h.

Constructor & Destructor Documentation

agg_util::GridAggregateOnOuterDimension::GridAggregateOnOuterDimension ( const Grid &  proto,
const Dimension newDim,
const AMDList memberDatasets,
const DDSLoader loaderProto 
)

Create the new Grid from the template proto...

we'll have the same name, dimension and attributes.

Parameters
prototemplate to use, will be the aggVar from the FIRST member dataset!
memberDatasetsdescriptors for the dataset members of the aggregation. ASSUMED that the contained DDS will have a Grid var with name proto.name() that matches rank and maps, etc!!
loaderProtoloaded template to use (borrow dhi from) to load the datasets

Definition at line 67 of file GridAggregateOnOuterDimension.cc.

References BESDEBUG.

Referenced by ptr_duplicate().

agg_util::GridAggregateOnOuterDimension::GridAggregateOnOuterDimension ( const GridAggregateOnOuterDimension proto)

Definition at line 81 of file GridAggregateOnOuterDimension.cc.

References BESDEBUG.

agg_util::GridAggregateOnOuterDimension::~GridAggregateOnOuterDimension ( )
virtual

Definition at line 107 of file GridAggregateOnOuterDimension.cc.

References BESDEBUG.

Member Function Documentation

void agg_util::GridAggregationBase::copyProtoMapsIntoThisGrid ( const Dimension aggDim)
protectedinherited

Copy the template's read in subgrid maps into this.

Skip any map found in the subgrid named aggDim.name since we handle the aggregation dimension map specially.

Parameters
aggDima map with aggDim.name is NOT copied.

Definition at line 305 of file GridAggregationBase.cc.

References BESDEBUG_FUNC, agg_util::AggregationUtil::findMapByName(), agg_util::GridAggregationBase::getSubGridTemplate(), agg_util::Dimension::name, NCML_ASSERT_MSG, agg_util::GridAggregationBase::printConstraints(), and VALID_PTR.

Referenced by agg_util::GridAggregationBase::readAndAggregateConstrainedMapsHook().

Here is the call graph for this function:

const Dimension & agg_util::GridAggregateOnOuterDimension::getAggregationDimension ( ) const
protectedvirtual

Get the contained aggregation dimension info.

Implements agg_util::GridAggregationBase.

Definition at line 168 of file GridAggregateOnOuterDimension.cc.

const AMDList & agg_util::GridAggregationBase::getDatasetList ( ) const
virtualinherited

Accessor for the dataset description list that describes this aggregation.

Returns
a reference to the AggMemberDataset list.

Definition at line 185 of file GridAggregationBase.cc.

Referenced by agg_util::GridJoinExistingAggregation::makeAggregatedOuterMapVector().

Grid * agg_util::GridAggregationBase::getSubGridTemplate ( )
protectedinherited

Reveals the raw ptr, but only to subclasses.

Don't delete it, but can be changed etc.

Definition at line 230 of file GridAggregationBase.cc.

Referenced by agg_util::GridAggregationBase::copyProtoMapsIntoThisGrid(), agg_util::GridJoinExistingAggregation::makeAggregatedOuterMapVector(), and agg_util::GridAggregationBase::readProtoSubGrid().

GridAggregateOnOuterDimension & agg_util::GridAggregateOnOuterDimension::operator= ( const GridAggregateOnOuterDimension rhs)

Definition at line 96 of file GridAggregateOnOuterDimension.cc.

References agg_util::GridAggregationBase::operator=().

Here is the call graph for this function:

void agg_util::GridAggregationBase::printConstraints ( const libdap::Array &  fromArray)
protectedinherited
GridAggregateOnOuterDimension * agg_util::GridAggregateOnOuterDimension::ptr_duplicate ( )
virtual

Definition at line 90 of file GridAggregateOnOuterDimension.cc.

References GridAggregateOnOuterDimension().

Here is the call graph for this function:

bool agg_util::GridAggregationBase::read ( )
virtualinherited

Read in only those datasets that are in the constrained output making sure to apply the internal dimension constraints to the member datasets properly before reading them! Stream the data into the output buffer correctly.

NOTE: Subclasses should implement the protected hooks if possible rather than overriding this function!

Returns
success.

Definition at line 192 of file GridAggregationBase.cc.

References BESDEBUG_FUNC, agg_util::GridAggregationBase::printConstraints(), agg_util::GridAggregationBase::readAndAggregateConstrainedMapsHook(), and VALID_PTR.

Here is the call graph for this function:

void agg_util::GridAggregationBase::readAndAggregateConstrainedMapsHook ( )
protectedvirtualinherited

Called from read()! Invokes the user hooks eventually.

Can be overridden, but default calls should suffice for now.

Definition at line 259 of file GridAggregationBase.cc.

References agg_util::GridAggregationBase::copyProtoMapsIntoThisGrid(), agg_util::GridAggregationBase::getAggregationDimension(), and agg_util::GridAggregationBase::readProtoSubGrid().

Referenced by agg_util::GridAggregationBase::read().

Here is the call graph for this function:

void agg_util::GridAggregationBase::readProtoSubGrid ( )
protectedinherited

Transfer constraints properly from this object's maps and read in the proto subgrid entirely (respecting constraints)

Definition at line 285 of file GridAggregationBase.cc.

References agg_util::GridAggregationBase::getSubGridTemplate(), agg_util::GridAggregationBase::transferConstraintsToSubGridHook(), and VALID_PTR.

Referenced by agg_util::GridAggregationBase::readAndAggregateConstrainedMapsHook().

Here is the call graph for this function:

void agg_util::GridAggregationBase::setShapeFrom ( const libdap::Grid &  protoSubGrid,
bool  addMaps 
)
inherited

Use the data array and maps from protoSubGrid as the initial point for the shape of the Grid.

It may still not be complete until the callers adds maps, etc.

Parameters
protoSubGriddescribes the data array and map templates to use for the granules (modulo any agg subclass changes).
addMapsif true, add's all the maps in protoSubGrid into this. if false, does not.

Definition at line 153 of file GridAggregationBase.cc.

References VALID_PTR.

void agg_util::GridAggregateOnOuterDimension::transferConstraintsToSubGridHook ( Grid *  pSubGrid)
protectedvirtual

For the data array and all maps, transfer the constraints from the super grid (ie this) to all the grids in the given prototype subgrid.

Note that this Grid has one more outer dimension than the subgrid, so the first one on this will clearly be skipped.

Parameters
pToGrid

Reimplemented from agg_util::GridAggregationBase.

Definition at line 159 of file GridAggregateOnOuterDimension.cc.

References VALID_PTR.

BaseType * agg_util::GridAggregationBase::transform_to_dap4 ( libdap::D4Group *  root,
libdap::Constructor *  container 
)
inherited

Definition at line 108 of file GridAggregationBase.cc.


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