bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
ncml_module::VariableElement Class Reference

Concrete class for NcML <variable> element. More...

#include <VariableElement.h>

Inheritance diagram for ncml_module::VariableElement:
Inheritance graph
Collaboration diagram for ncml_module::VariableElement:
Collaboration graph

Public Member Functions

void addPreDeleteCB (UseCountHitZeroCB *pCB)
 
bool checkGotValues () const
 
virtual VariableElementclone () const
 
virtual int getRefCount () const
 
virtual const stringgetTypeName () const
 
virtual void handleBegin ()
 
virtual void handleContent (const std::string &content)
 
virtual void handleContent (const string &content)
 
virtual void handleEnd ()
 
bool isNewVariable () const
 
int line () const
 
const std::string name () const
 
const std::string orgName () const
 
virtual int ref () const
 
virtual void removeFromPool () const
 
void removePreDeleteCB (UseCountHitZeroCB *pCB)
 
virtual void setAttributes (const XMLAttributeMap &attrs)
 
void setGotValues ()
 
void setParser (NCMLParser *p)
 
const std::string shape () const
 
virtual string toString () const
 
const std::string type () const
 
virtual int unref () const
 
virtual bool validateAttributes (const XMLAttributeMap &attrs, const std::vector< std::string > &validAttrs, std::vector< std::string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
 
 VariableElement (const VariableElement &proto)
 

Static Public Member Functions

static bool areAllAttributesValid (const XMLAttributeMap &attrMap, const std::vector< std::string > &validAttrs, std::vector< std::string > *pInvalidAttributes=0)
 
static bool isValidAttribute (const std::vector< std::string > &validAttrs, const std::string &attr)
 
static std::string printAttributeIfNotEmpty (const std::string &attrName, const std::string &attrValue)
 

Static Public Attributes

static const string _sTypeName
 
static const vector< string_sValidAttributes
 

Protected Attributes

NCMLParser_parser
 

Detailed Description

Concrete class for NcML <variable> element.

This class handles the processing of <variable> elements in the NcML.

The class handles all processing of variables, including setting lexical scope in the parser to the variable's attribute table, renaming variables, and creating new variables.

_isNewVariable specifies if the variable was created new in this NcML parse, or was just a lexical scope. _gotValues specifies if the variable had a contained <values> element processed on it yet.

On handleEnd(), if _isNewVariable && !_gotValues, a parse error is thrown.

It is also an error to specify a second <values> element if _gotValues.

Definition at line 58 of file VariableElement.h.

Member Function Documentation

◆ addPreDeleteCB()

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

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

◆ areAllAttributesValid()

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

◆ checkGotValues()

bool ncml_module::VariableElement::checkGotValues ( ) const
Returns
whether we got a values element set to us yet, used to make sure new variables get values once and only once.

◆ clone()

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

Make and return a copy of this. Used by the factory from a prototype.

Implements ncml_module::NCMLElement.

◆ getRefCount()

virtual int agg_util::RCObject::getRefCount ( ) const
virtualinherited

Get the current reference count

Implements agg_util::RCObjectInterface.

◆ getTypeName()

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

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

Implements ncml_module::NCMLElement.

◆ handleBegin()

virtual void ncml_module::VariableElement::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.

◆ handleContent()

virtual void ncml_module::NCMLElement::handleContent ( const std::string & content)
virtualinherited

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 in ncml_module::DimensionElement, ncml_module::ExplicitElement, ncml_module::NetcdfElement, ncml_module::ReadMetadataElement, ncml_module::RemoveElement, ncml_module::ScanElement, and ncml_module::ValuesElement.

◆ handleEnd()

virtual void ncml_module::VariableElement::handleEnd ( )
virtual

Handle the closing of this element.

Implements ncml_module::NCMLElement.

◆ isNewVariable()

bool ncml_module::VariableElement::isNewVariable ( ) const
Returns
whether this variable was created and added as a new variable in this parse

◆ isValidAttribute()

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

◆ line()

int ncml_module::NCMLElement::line ( ) const
inherited

Return the current parse line number. Shorthand

◆ name()

const std::string ncml_module::VariableElement::name ( ) const
inline

Definition at line 77 of file VariableElement.h.

◆ orgName()

const std::string ncml_module::VariableElement::orgName ( ) const
inline

Definition at line 92 of file VariableElement.h.

◆ printAttributeIfNotEmpty()

static 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.

◆ ref()

virtual 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.

◆ removeFromPool()

virtual 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.

◆ removePreDeleteCB()

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

Remove it exists. If not, this unchanged.

◆ setAttributes()

virtual void ncml_module::VariableElement::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.

◆ setGotValues()

void ncml_module::VariableElement::setGotValues ( )

Called once we set the values from ValuesElement so we are aware.

◆ shape()

const std::string ncml_module::VariableElement::shape ( ) const
inline

Definition at line 87 of file VariableElement.h.

◆ toString()

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

Return a string describing the element

Implements ncml_module::NCMLElement.

◆ type()

const std::string ncml_module::VariableElement::type ( ) const
inline

Definition at line 82 of file VariableElement.h.

◆ unref()

virtual int agg_util::RCObject::unref ( ) const
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.

◆ validateAttributes()

virtual bool ncml_module::NCMLElement::validateAttributes ( const XMLAttributeMap & attrs,
const std::vector< std::string > & validAttrs,
std::vector< std::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

Member Data Documentation

◆ _parser

NCMLParser* ncml_module::NCMLElement::_parser
protectedinherited

Definition at line 187 of file NCMLElement.h.

◆ _sTypeName

const string ncml_module::VariableElement::_sTypeName
static

Definition at line 63 of file VariableElement.h.

◆ _sValidAttributes

const vector<string> ncml_module::VariableElement::_sValidAttributes
static

Definition at line 64 of file VariableElement.h.


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