OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
ncml_module::AggregationElement Class Reference

#include <AggregationElement.h>

Inheritance diagram for ncml_module::AggregationElement:
Inheritance graph
Collaboration diagram for ncml_module::AggregationElement:
Collaboration graph

Public Types

typedef vector< string >::const_iterator AggVarIter
 

Public Member Functions

void addAggregationVariable (const string &name)
 Set the variable with name as an aggregation variable for this aggregation. More...
 
void addChildDataset (NetcdfElement *pDataset)
 Add a new dataset to the aggregation for the parse. More...
 
void addPreDeleteCB (UseCountHitZeroCB *pCB)
 Add uniquely. More...
 
void addScanElement (ScanElement *pScanner)
 Add a child ScanElement to the Aggregation to be used to to add to the list of child datasets. More...
 
 AggregationElement ()
 
 AggregationElement (const AggregationElement &proto)
 
AggVarIter beginAggVarIter () const
 
virtual AggregationElementclone () const
 Make and return a copy of this. More...
 
const string & dimName () const
 
AggVarIter endAggVarIter () const
 
const std::string & getAggregationVariableCoordinateAxisType () const
 Return the value set by setAggregationVariableCoordinateAxisType() or "" if none was set. More...
 
NetcdfElementgetParentDataset () const
 
virtual int getRefCount () const
 Get the current reference count. More...
 
virtual const string & getTypeName () const
 Return the type of the element, which should be: the same as ConcreteClassName::getTypeName() More...
 
bool gotVariableAggElement () const
 whether this aggregation contained a variableAgg element to select aggregation variables. More...
 
virtual void handleBegin ()
 Handle a begin on this element. More...
 
virtual void handleContent (const string &content)
 Handle the characters content for the element. More...
 
virtual void handleEnd ()
 Handle the closing of this element. More...
 
bool isAggregationVariable (const string &name) const
 
bool isJoinExistingAggregation () const
 
bool isJoinNewAggregation () const
 
bool isUnionAggregation () const
 
int line () const
 Return the current parse line number. More...
 
string printAggregationVariables () const
 
void processParentDatasetComplete ()
 Called when the enclosing dataset is closing for the aggregation to handle any post processing that it needs to, in particular adding any map vectors to Grid's. More...
 
const string & recheckEvery () const
 
virtual int ref () const
 Increase the reference count by one. More...
 
virtual void removeFromPool () const
 If the object is in an auto-delete pool, remove it from the pool and force it to only delete when it's ref count goes to 0. More...
 
void removePreDeleteCB (UseCountHitZeroCB *pCB)
 Remove it exists. More...
 
void setAggregationVariableCoordinateAxisType (const std::string &cat)
 If a child scan contains a dateFormatMark, then we want to add a "_CoordinateAxisType" of "Time" By setting this to a non empty() string, a new attribute _CoordinateAxisType will be added to aggregation variable in a joinNew or joinExisting aggregation. More...
 
virtual void setAttributes (const XMLAttributeMap &attrs)
 Set the attributes of this from the map. More...
 
NetcdfElementsetParentDataset (NetcdfElement *parent)
 Set the parent and return the old one, which could be null. More...
 
void setParser (NCMLParser *p)
 
void setVariableAggElement ()
 Should only be used by the VariableAggElement class to let us know it added the vars. More...
 
virtual string toString () const
 Return a string describing the element. More...
 
const string & type () const
 
virtual int unref () const throw ()
 Decrease the reference count by one. More...
 
virtual bool validateAttributes (const XMLAttributeMap &attrs, const vector< string > &validAttrs, vector< string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
 Check that the given attributes are all in the valid set, otherwise fill in *pInvalidAttrs with the problematic ones if it's not null. More...
 
virtual ~AggregationElement ()
 

Static Public Member Functions

static bool areAllAttributesValid (const XMLAttributeMap &attrMap, const std::vector< string > &validAttrs, std::vector< string > *pInvalidAttributes=0)
 
static bool isValidAttribute (const std::vector< string > &validAttrs, const string &attr)
 
static std::string printAttributeIfNotEmpty (const std::string &attrName, const std::string &attrValue)
 Helper for subclasses implementing toString(). More...
 

Static Public Attributes

static const string _sTypeName = "aggregation"
 
static const vector< string > _sValidAttrs = getValidAttributes()
 

Protected Attributes

NCMLParser_parser
 

Detailed Description

Definition at line 65 of file AggregationElement.h.

Member Typedef Documentation

typedef vector<string>::const_iterator ncml_module::AggregationElement::AggVarIter

Definition at line 122 of file AggregationElement.h.

Constructor & Destructor Documentation

ncml_module::AggregationElement::AggregationElement ( )

Definition at line 71 of file AggregationElement.cc.

Referenced by clone().

ncml_module::AggregationElement::AggregationElement ( const AggregationElement proto)

Definition at line 86 of file AggregationElement.cc.

References addChildDataset(), addScanElement(), BESDEBUG, ncml_module::ScanElement::clone(), ncml_module::NetcdfElement::clone(), and NCML_ASSERT.

Here is the call graph for this function:

ncml_module::AggregationElement::~AggregationElement ( )
virtual

Definition at line 130 of file AggregationElement.cc.

References BESDEBUG, and agg_util::RCObject::unref().

Here is the call graph for this function:

Member Function Documentation

void ncml_module::AggregationElement::addAggregationVariable ( const string &  name)

Set the variable with name as an aggregation variable for this aggregation.

Definition at line 296 of file AggregationElement.cc.

References ncml_module::NCMLElement::_parser, BESDEBUG, ncml_module::NCMLParser::getParseLineNumber(), isAggregationVariable(), and THROW_NCML_PARSE_ERROR.

Referenced by ncml_module::VariableAggElement::handleBegin().

Here is the call graph for this function:

void ncml_module::AggregationElement::addChildDataset ( NetcdfElement pDataset)

Add a new dataset to the aggregation for the parse.

We now have a strong reference to it.

Definition at line 282 of file AggregationElement.cc.

References BESDEBUG, agg_util::RCObject::ref(), ncml_module::NetcdfElement::setParentAggregation(), ncml_module::NetcdfElement::toString(), and VALID_PTR.

Referenced by AggregationElement().

Here is the call graph for this function:

void agg_util::RCObject::addPreDeleteCB ( UseCountHitZeroCB pCB)
inherited

Add uniquely.

If it is added agan, the second time is ignored.

Definition at line 145 of file RCObject.cc.

References BESDEBUG.

void ncml_module::AggregationElement::addScanElement ( ScanElement pScanner)

Add a child ScanElement to the Aggregation to be used to to add to the list of child datasets.

This will be a strong (ref()'d) reference.

Parameters
pScannerthe element to which to maintain a strong ref and use in the processing.

Definition at line 368 of file AggregationElement.cc.

References agg_util::RCObject::ref(), ncml_module::ScanElement::setParent(), and VALID_PTR.

Referenced by AggregationElement(), and ncml_module::ScanElement::handleEnd().

Here is the call graph for this function:

bool ncml_module::NCMLElement::areAllAttributesValid ( const XMLAttributeMap attrMap,
const std::vector< string > &  validAttrs,
std::vector< string > *  pInvalidAttributes = 0 
)
staticinherited
Returns
whether all the attributes in attrMap are in validAttrs. If pInvalidAttributes, fill it in with all the illegal attributes.

Definition at line 261 of file NCMLElement.cc.

References ncml_module::XMLAttributeMap::begin(), ncml_module::XMLAttributeMap::end(), and ncml_module::NCMLElement::isValidAttribute().

Referenced by ncml_module::NCMLElement::validateAttributes().

Here is the call graph for this function:

AggregationElement::AggVarIter ncml_module::AggregationElement::beginAggVarIter ( ) const

Definition at line 344 of file AggregationElement.cc.

Referenced by isAggregationVariable(), and printAggregationVariables().

AggregationElement * ncml_module::AggregationElement::clone ( ) const
virtual

Make and return a copy of this.

Used by the factory from a prototype.

Implements ncml_module::NCMLElement.

Definition at line 163 of file AggregationElement.cc.

References AggregationElement().

Here is the call graph for this function:

const string& ncml_module::AggregationElement::dimName ( ) const
inline

Definition at line 89 of file AggregationElement.h.

AggregationElement::AggVarIter ncml_module::AggregationElement::endAggVarIter ( ) const

Definition at line 350 of file AggregationElement.cc.

Referenced by isAggregationVariable(), and printAggregationVariables().

const std::string & ncml_module::AggregationElement::getAggregationVariableCoordinateAxisType ( ) const

Return the value set by setAggregationVariableCoordinateAxisType() or "" if none was set.

Definition at line 1333 of file AggregationElement.cc.

NetcdfElement* ncml_module::AggregationElement::getParentDataset ( ) const
inline
int agg_util::RCObject::getRefCount ( ) const
virtualinherited

Get the current reference count.

Implements agg_util::RCObjectInterface.

Definition at line 110 of file RCObject.cc.

const string & ncml_module::AggregationElement::getTypeName ( ) const
virtual

Return the type of the element, which should be: the same as ConcreteClassName::getTypeName()

Implements ncml_module::NCMLElement.

Definition at line 157 of file AggregationElement.cc.

References _sTypeName.

bool ncml_module::AggregationElement::gotVariableAggElement ( ) const

whether this aggregation contained a variableAgg element to select aggregation variables.

Definition at line 356 of file AggregationElement.cc.

void ncml_module::AggregationElement::handleBegin ( )
virtual

Handle a begin on this element.

Called after creation and it is assumed the attributes and _parser are already set.

Implements ncml_module::NCMLElement.

Definition at line 180 of file AggregationElement.cc.

References ncml_module::NCMLElement::_parser, ncml_module::NetcdfElement::getChildAggregation(), getParentDataset(), ncml_module::NCMLParser::getParseLineNumber(), NCML_ASSERT, NCML_ASSERT_MSG, ncml_module::NetcdfElement::setChildAggregation(), THROW_NCML_PARSE_ERROR, ncml_module::NetcdfElement::toString(), and toString().

Here is the call graph for this function:

void ncml_module::AggregationElement::handleContent ( const string &  content)
virtual

Handle the characters content for the element.

Default impl throws if the content is not all whitespace. Subclasses that handle non-whitespace content should override.

Parameters
contentthe string of characters in the element content.

Reimplemented from ncml_module::NCMLElement.

Definition at line 208 of file AggregationElement.cc.

References ncml_module::NCMLElement::_parser, ncml_module::NCMLParser::getParseLineNumber(), ncml_module::NCMLUtil::isAllWhitespace(), THROW_NCML_PARSE_ERROR, and toString().

Here is the call graph for this function:

void ncml_module::AggregationElement::handleEnd ( )
virtual

Handle the closing of this element.

Implements ncml_module::NCMLElement.

Definition at line 220 of file AggregationElement.cc.

References ncml_module::NCMLElement::_parser, BESDEBUG, ncml_module::NCMLParser::getParseLineNumber(), isJoinExistingAggregation(), isJoinNewAggregation(), isUnionAggregation(), and THROW_NCML_PARSE_ERROR.

Here is the call graph for this function:

bool ncml_module::AggregationElement::isAggregationVariable ( const string &  name) const
Returns
whether the variable with name has been added as an aggregation variable

Definition at line 312 of file AggregationElement.cc.

References beginAggVarIter(), and endAggVarIter().

Referenced by addAggregationVariable().

Here is the call graph for this function:

bool ncml_module::AggregationElement::isJoinExistingAggregation ( ) const

Definition at line 276 of file AggregationElement.cc.

Referenced by handleEnd().

bool ncml_module::AggregationElement::isJoinNewAggregation ( ) const

Definition at line 264 of file AggregationElement.cc.

Referenced by handleEnd().

bool ncml_module::AggregationElement::isUnionAggregation ( ) const

Definition at line 270 of file AggregationElement.cc.

Referenced by handleEnd().

bool ncml_module::NCMLElement::isValidAttribute ( const std::vector< string > &  validAttrs,
const string &  attr 
)
staticinherited
Returns
whether the given attr is in the array validAttrs or not... Helper for subclasses

Definition at line 246 of file NCMLElement.cc.

Referenced by ncml_module::NCMLElement::areAllAttributesValid().

int ncml_module::NCMLElement::line ( ) const
inherited
string ncml_module::AggregationElement::printAggregationVariables ( ) const

Definition at line 329 of file AggregationElement.cc.

References beginAggVarIter(), and endAggVarIter().

Here is the call graph for this function:

std::string ncml_module::NCMLElement::printAttributeIfNotEmpty ( const std::string &  attrName,
const std::string &  attrValue 
)
staticinherited

Helper for subclasses implementing toString().

Returns
a string with attrName="attrValue" if !attrValue.empty(), otherwise return the empty string.

Definition at line 240 of file NCMLElement.cc.

Referenced by ncml_module::VariableAggElement::toString(), ncml_module::ScanElement::toString(), ncml_module::DimensionElement::toString(), ncml_module::NetcdfElement::toString(), and toString().

void ncml_module::AggregationElement::processParentDatasetComplete ( )

Called when the enclosing dataset is closing for the aggregation to handle any post processing that it needs to, in particular adding any map vectors to Grid's.

Definition at line 377 of file AggregationElement.cc.

References BESDEBUG.

const string& ncml_module::AggregationElement::recheckEvery ( ) const
inline

Definition at line 90 of file AggregationElement.h.

int agg_util::RCObject::ref ( ) const
virtualinherited

Increase the reference count by one.

const since we do not consider the ref count part of the semantic constness of the rep

Implements agg_util::RCObjectInterface.

Definition at line 74 of file RCObject.cc.

References BESDEBUG.

Referenced by addChildDataset(), ncml_module::NetcdfElement::addDimension(), addScanElement(), ncml_module::NetcdfElement::VariableValueValidator::addVariableToValidate(), and agg_util::RCPtr< ncml_module::AggregationElement >::refAndGet().

void agg_util::RCObject::removeFromPool ( ) const
virtualinherited

If the object is in an auto-delete pool, remove it from the pool and force it to only delete when it's ref count goes to 0.

Useful when we desire a particular object stay around outside of the pool's lifetime.

Implements agg_util::RCObjectInterface.

Definition at line 116 of file RCObject.cc.

References NCML_ASSERT, and agg_util::RCObjectPool::remove().

Here is the call graph for this function:

void agg_util::RCObject::removePreDeleteCB ( UseCountHitZeroCB pCB)
inherited

Remove it exists.

If not, this unchanged.

Definition at line 164 of file RCObject.cc.

References BESDEBUG.

void ncml_module::AggregationElement::setAggregationVariableCoordinateAxisType ( const std::string &  cat)

If a child scan contains a dateFormatMark, then we want to add a "_CoordinateAxisType" of "Time" By setting this to a non empty() string, a new attribute _CoordinateAxisType will be added to aggregation variable in a joinNew or joinExisting aggregation.

Parameters
catthe desired value for _CoordinateAxisType, or "" if no attribute addition is desired.

Definition at line 1327 of file AggregationElement.cc.

Referenced by ncml_module::ScanElement::getDatasetList().

void ncml_module::AggregationElement::setAttributes ( const XMLAttributeMap attrs)
virtual

Set the attributes of this from the map.

Parameters
attrsthe attribute map to set this class to.

Implements ncml_module::NCMLElement.

Definition at line 169 of file AggregationElement.cc.

References _sValidAttrs, ncml_module::XMLAttributeMap::getValueForLocalNameOrDefault(), and ncml_module::NCMLElement::validateAttributes().

Here is the call graph for this function:

NetcdfElement * ncml_module::AggregationElement::setParentDataset ( NetcdfElement parent)

Set the parent and return the old one, which could be null.

Private Impl.

Should only be called on a handleBegin() call here when we know we can find it in the NCMLParser at the current scope. We only retain a weak reference to parent.

Definition at line 395 of file AggregationElement.cc.

References getParentDataset().

Here is the call graph for this function:

void ncml_module::NCMLElement::setParser ( NCMLParser p)
inherited

Definition at line 166 of file NCMLElement.cc.

References ncml_module::NCMLElement::_parser, and NCML_ASSERT_MSG.

void ncml_module::AggregationElement::setVariableAggElement ( )

Should only be used by the VariableAggElement class to let us know it added the vars.

Definition at line 362 of file AggregationElement.cc.

Referenced by ncml_module::VariableAggElement::handleBegin().

string ncml_module::AggregationElement::toString ( ) const
virtual

Return a string describing the element.

Implements ncml_module::NCMLElement.

Definition at line 254 of file AggregationElement.cc.

References _sTypeName, and ncml_module::NCMLElement::printAttributeIfNotEmpty().

Referenced by handleBegin(), handleContent(), and ncml_module::NetcdfElement::setChildAggregation().

Here is the call graph for this function:

const string& ncml_module::AggregationElement::type ( ) const
inline

Definition at line 88 of file AggregationElement.h.

int agg_util::RCObject::unref ( ) const
throw (
)
virtualinherited

Decrease the reference count by one.

If it goes from 1 to 0, delete this and this is no longer valid.

Returns
the new ref count. If it is 0, the caller knows the object was deleted.

It is illegal to unref() an object with a count of 0. We don't throw to allow use in dtors, so the caller is assumed not to do it!

const since the reference count is not part of the semantic constness of the rep

Implements agg_util::RCObjectInterface.

Definition at line 82 of file RCObject.cc.

References BESDEBUG, agg_util::RCObjectPool::release(), and agg_util::RCObject::toString().

Referenced by ncml_module::NetcdfElement::clearDimensions(), agg_util::RCPtr< ncml_module::AggregationElement >::operator=(), ~AggregationElement(), and ncml_module::NetcdfElement::VariableValueValidator::~VariableValueValidator().

Here is the call graph for this function:

bool ncml_module::NCMLElement::validateAttributes ( const XMLAttributeMap attrs,
const vector< string > &  validAttrs,
vector< string > *  pInvalidAttrs = 0,
bool  printInvalid = true,
bool  throwOnError = true 
)
virtualinherited

Check that the given attributes are all in the valid set, otherwise fill in *pInvalidAttrs with the problematic ones if it's not null.

If pInvalidAttrs && printInvalid is set, we print the problematic attributes to BESDEBUG "ncml" channel If throwOnError is set, we throw a parse error instead of returning.

Returns
whether all attributes are in the valid set if not throw

Definition at line 191 of file NCMLElement.cc.

References ncml_module::NCMLElement::_parser, ncml_module::NCMLElement::areAllAttributesValid(), BESDEBUG, ncml_module::NCMLParser::getParseLineNumber(), ncml_module::NCMLElement::getTypeName(), THROW_NCML_PARSE_ERROR, and VALID_PTR.

Referenced by ncml_module::RemoveElement::setAttributes(), ncml_module::ExplicitElement::setAttributes(), ncml_module::ReadMetadataElement::setAttributes(), ncml_module::VariableAggElement::setAttributes(), ncml_module::ValuesElement::setAttributes(), ncml_module::AttributeElement::setAttributes(), ncml_module::ScanElement::setAttributes(), ncml_module::DimensionElement::setAttributes(), ncml_module::VariableElement::setAttributes(), ncml_module::NetcdfElement::setAttributes(), and setAttributes().

Here is the call graph for this function:

Member Data Documentation

NCMLParser* ncml_module::NCMLElement::_parser
protectedinherited

Definition at line 193 of file NCMLElement.h.

Referenced by addAggregationVariable(), ncml_module::NetcdfElement::createResponseObject(), ncml_module::NetcdfElement::getAggMemberDataset(), ncml_module::ScanElement::getDatasetList(), ncml_module::VariableAggElement::getParentAggregation(), ncml_module::RemoveElement::handleBegin(), ncml_module::ExplicitElement::handleBegin(), ncml_module::ReadMetadataElement::handleBegin(), ncml_module::VariableAggElement::handleBegin(), ncml_module::ValuesElement::handleBegin(), ncml_module::AttributeElement::handleBegin(), ncml_module::ScanElement::handleBegin(), ncml_module::DimensionElement::handleBegin(), ncml_module::VariableElement::handleBegin(), ncml_module::NetcdfElement::handleBegin(), handleBegin(), ncml_module::RemoveElement::handleContent(), ncml_module::ExplicitElement::handleContent(), ncml_module::ReadMetadataElement::handleContent(), ncml_module::ValuesElement::handleContent(), ncml_module::AttributeElement::handleContent(), ncml_module::DimensionElement::handleContent(), ncml_module::VariableElement::handleContent(), ncml_module::NetcdfElement::handleContent(), handleContent(), ncml_module::NCMLElement::handleContent(), ncml_module::ValuesElement::handleEnd(), ncml_module::AttributeElement::handleEnd(), ncml_module::ScanElement::handleEnd(), ncml_module::VariableElement::handleEnd(), ncml_module::NetcdfElement::handleEnd(), handleEnd(), ncml_module::NetcdfElement::isValid(), ncml_module::NCMLElement::line(), ncml_module::ValuesElement::setAttributes(), ncml_module::NCMLElement::setParser(), ncml_module::NCMLElement::validateAttributes(), and ncml_module::NCMLElement::~NCMLElement().

const string ncml_module::AggregationElement::_sTypeName = "aggregation"
static

Definition at line 72 of file AggregationElement.h.

Referenced by getTypeName(), and toString().

const vector< string > ncml_module::AggregationElement::_sValidAttrs = getValidAttributes()
static

Definition at line 75 of file AggregationElement.h.

Referenced by setAttributes().


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