29 #include "VariableAggElement.h" 30 #include "AggregationElement.h" 31 #include "NCMLDebug.h" 32 #include "NCMLParser.h" 36 const string VariableAggElement::_sTypeName =
"variableAgg";
37 const vector<string> VariableAggElement::_sValidAttributes = getValidAttributes();
39 VariableAggElement::VariableAggElement() :
40 RCObjectInterface(), NCMLElement(0), _name(
"")
44 VariableAggElement::VariableAggElement(
const VariableAggElement& proto) :
45 RCObjectInterface(), NCMLElement(proto), _name(proto._name)
49 VariableAggElement::~VariableAggElement()
79 "Cannot have variableAgg@name empty! Scope=" + _parser->getScopeString());
83 if (!_parser->isScopeAggregation()) {
85 "Got a variableAgg element not as a direct child of an aggregation! elt=" +
toString() +
" at scope=" 86 + _parser->getScopeString());
106 AggregationElement* pAgg = dynamic_cast<AggregationElement*>(_parser->getCurrentElement());
107 NCML_ASSERT_MSG(pAgg,
"VariableAggElement::getParentAggregation(): " 108 "Expected current top of stack was AggregationElement*, but it wasn't! Logic error!");
114 vector<string> VariableAggElement::getValidAttributes()
116 vector<string> validAttrs;
117 validAttrs.reserve(1);
118 validAttrs.push_back(
"name");
virtual void setAttributes(const XMLAttributeMap &attrs)
virtual bool validateAttributes(const XMLAttributeMap &attrs, const vector< string > &validAttrs, vector< string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
const string getValueForLocalNameOrDefault(const string &localname, const string &defVal="") const
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...
virtual const string & getTypeName() const
void setVariableAggElement()
virtual void handleBegin()
virtual string toString() const
virtual VariableAggElement * clone() const
static std::string printAttributeIfNotEmpty(const std::string &attrName, const std::string &attrValue)
AggregationElement & getParentAggregation() const
int getParseLineNumber() const
void addAggregationVariable(const string &name)
Element for the <variableAgg> element child of an <aggregation>.