29 #ifndef __NCML_MODULE__AGGREGATION_ELEMENT_H__
30 #define __NCML_MODULE__AGGREGATION_ELEMENT_H__
54 using libdap::BaseType;
88 const string&
type()
const {
return _type; }
89 const string&
dimName()
const {
return _dimName; }
169 void processJoinNew();
170 void processJoinExisting();
178 void unionAddAllRequiredNonAggregatedVariablesFrom(
const DDS& templateDDS);
198 void fillDimensionCacheForJoinExistingDimension(
200 const std::string& aggDimName
204 bool doesDimensionCacheExist()
const;
212 bool doesFirstGranuleSpecifyNcoords()
const;
215 bool doAllGranulesSpecifyNcoords()
const;
247 void decideWhichVariablesToJoinExist(
const libdap::DDS& templateDDS);
262 void findVariablesWithOuterDimensionName(
263 vector<string>& oMatchingVars,
264 const DDS& templateDDS,
265 const string& outerDimName)
const;
271 : _pAggVarTemplate(0)
279 _pAggVarTemplate =
NULL;
281 _memberDatasets.clear();
282 _memberDatasets.resize(0);
285 libdap::BaseType* _pAggVarTemplate;
298 void getParamsForJoinAggOnVariable(
299 JoinAggParams* pOutParams,
300 const DDS& aggOutputDDS,
301 const std::string& varName,
302 const DDS& templateDDS);
312 void processJoinNewOnAggVar(
314 const std::string& varName,
315 const DDS& templateDDS);
325 void processJoinExistingOnAggVar(
327 const std::string& varName,
328 const DDS& templateDDS);
351 void processAggVarJoinNewForArray(
353 const Array& arrayTemplate,
382 void processAggVarJoinNewForGrid(
384 const Grid& gridTemplate,
388 void processAggVarJoinExistingForArray(
390 const libdap::Array& arrayTemplate,
394 void processAggVarJoinExistingForGrid(
396 const Grid& gridTemplate,
404 void collectDatasetsInOrder(vector<const DDS*>& ddsList)
const;
420 void processAnyScanElements();
433 void mergeDimensions(
bool checkDimensionMismatch=
true,
434 const std::string& dimToSkip=
"");
437 void processParentDatasetCompleteForJoinNew();
440 void processParentDatasetCompleteForJoinExisting();
451 void processPlaceholderCoordinateVariableForJoinExisting(
452 const libdap::BaseType& placeholderVar,
453 libdap::Array* pNewVar);
464 libdap::Array* ensureVariableIsProperNewCoordinateVariable(
465 libdap::BaseType* pBT,
467 bool throwIfInvalid)
const;
492 libdap::Array* findMatchingCoordinateVariable(
495 bool throwOnInvalidCV=
true)
const;
519 libdap::Array* processDeferredCoordinateVariable(libdap::BaseType* pBT,
const agg_util::Dimension& dim);
541 auto_ptr<libdap::Array> createCoordinateVariableForNewDimension(
const agg_util::Dimension& dim)
const;
556 libdap::Array* createAndAddCoordinateVariableForNewDimension(libdap::DDS& dds,
const agg_util::Dimension& dim);
573 auto_ptr<libdap::Array> createCoordinateVariableForNewDimensionUsingCoordValue(
const agg_util::Dimension& dim)
const;
574 auto_ptr<libdap::Array> createCoordinateVariableForNewDimensionUsingCoordValueAsDouble(
const agg_util::Dimension& dim)
const;
575 auto_ptr<libdap::Array> createCoordinateVariableForNewDimensionUsingCoordValueAsString(
const agg_util::Dimension& dim)
const;
585 auto_ptr<libdap::Array> createCoordinateVariableForNewDimensionUsingLocation(
const agg_util::Dimension& dim)
const;
588 static void addCoordinateAxisType(libdap::Array& rCV,
const std::string& cat);
591 static vector<string> getValidAttributes();
597 string _recheckEvery;
600 NetcdfElement* _parent;
604 vector<NetcdfElement*> _datasets;
607 vector<ScanElement*> _scanners;
611 vector<string> _aggVars;
614 bool _gotVariableAggElement;
618 bool _wasAggregatedMapAddedForJoinExistingGrid;
622 std::string _coordinateAxisType;
Abstract helper superclass for allowing lazy access to the DataDDS for an aggregation.
virtual const string & getTypeName() const
Return the type of the element, which should be: the same as ConcreteClassName::getTypeName() ...
bool isAggregationVariable(const string &name) const
AggVarIter endAggVarIter() const
virtual void handleContent(const string &content)
Handle the characters content for the element.
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
void setVariableAggElement()
Should only be used by the VariableAggElement class to let us know it added the vars.
bool isUnionAggregation() const
virtual ~AggregationElement()
Helper class for temporarily hijacking an existing dhi to load a DDX response for one particular file...
void addScanElement(ScanElement *pScanner)
Add a child ScanElement to the Aggregation to be used to to add to the list of child datasets...
Concrete class for NcML element.
Implementation of the element used to scan directories to create the set of files for an aggre...
virtual string toString() const
Return a string describing the element.
static class NCMLUtil overview
void setAggregationVariableCoordinateAxisType(const std::string &cat)
If a child scan contains a dateFormatMark, then we want to add a "_CoordinateAxisType" of "Time" By s...
bool isJoinExistingAggregation() const
virtual void handleEnd()
Handle the closing of this element.
NetcdfElement * getParentDataset() const
Struct for holding information about a dimension of data, minimally a name and a cardinality (size)...
AggVarIter beginAggVarIter() const
vector< string >::const_iterator AggVarIter
static const string _sTypeName
Base class for NcML element concrete classes.
bool gotVariableAggElement() const
whether this aggregation contained a variableAgg element to select aggregation variables.
void processParentDatasetComplete()
Called when the enclosing dataset is closing for the aggregation to handle any post processing that i...
void addChildDataset(NetcdfElement *pDataset)
Add a new dataset to the aggregation for the parse.
static const vector< string > _sValidAttrs
std::vector< RCPtr< AggMemberDataset > > AMDList
virtual void setAttributes(const XMLAttributeMap &attrs)
Set the attributes of this from the map.
const string & dimName() const
const string & type() const
virtual void handleBegin()
Handle a begin on this element.
void addAggregationVariable(const string &name)
Set the variable with name as an aggregation variable for this aggregation.
NetcdfElement * setParentDataset(NetcdfElement *parent)
Set the parent and return the old one, which could be null.
bool isJoinNewAggregation() const
const string & recheckEvery() const
string printAggregationVariables() const
const std::string & getAggregationVariableCoordinateAxisType() const
Return the value set by setAggregationVariableCoordinateAxisType() or "" if none was set...
virtual AggregationElement * clone() const
Make and return a copy of this.