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

Base class for NcML element concrete classes. More...

#include <NCMLElement.h>

Inheritance diagram for ncml_module::NCMLElement:
Inheritance graph
Collaboration diagram for ncml_module::NCMLElement:
Collaboration graph

Classes

class  Factory
 

Public Member Functions

void addPreDeleteCB (UseCountHitZeroCB *pCB)
 
virtual NCMLElementclone () const =0
 
virtual int getRefCount () const
 
virtual const std::string & getTypeName () const =0
 
virtual void handleBegin ()=0
 
virtual void handleContent (const std::string &content)
 
virtual void handleEnd ()=0
 
int line () const
 
virtual int ref () const
 
virtual void removeFromPool () const
 
void removePreDeleteCB (UseCountHitZeroCB *pCB)
 
virtual void setAttributes (const XMLAttributeMap &attrs)=0
 
void setParser (NCMLParser *p)
 
virtual std::string toString () const =0
 
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)
 

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)
 

Protected Member Functions

 NCMLElement (const NCMLElement &proto)
 
 NCMLElement (NCMLParser *p)
 

Protected Attributes

NCMLParser_parser
 

Detailed Description

Base class for NcML element concrete classes.

Base class to define an NcML element for polymorphic dispatch in the NCMLParser. These concrete elements classes will be made friends of the NCMLParser in order to split the monolithic parser into chunks with specific functionality.

New concrete subclasses MUST be entered in the factory or they cannot be created.

We subclass RCObject since we sometimes need to keep elements around longer than just the SAX parser stack and need to keep track of whether other objects need to hang onto strong references to them.

Definition at line 61 of file NCMLElement.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 )
static
Returns
whether all the attributes in attrMap are in validAttrs. If pInvalidAttributes, fill it in with all the illegal attributes.

◆ clone()

◆ getRefCount()

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

Get the current reference count

Implements agg_util::RCObjectInterface.

◆ getTypeName()

virtual const std::string & ncml_module::NCMLElement::getTypeName ( ) const
pure virtual

◆ handleBegin()

virtual void ncml_module::NCMLElement::handleBegin ( )
pure virtual

◆ handleContent()

virtual void ncml_module::NCMLElement::handleContent ( const std::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 in ncml_module::DimensionElement, ncml_module::ExplicitElement, ncml_module::NetcdfElement, ncml_module::ReadMetadataElement, ncml_module::RemoveElement, ncml_module::ScanElement, and ncml_module::ValuesElement.

◆ handleEnd()

◆ isValidAttribute()

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

◆ line()

int ncml_module::NCMLElement::line ( ) const

Return the current parse line number. Shorthand

◆ printAttributeIfNotEmpty()

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

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::NCMLElement::setAttributes ( const XMLAttributeMap & attrs)
pure virtual

◆ toString()

◆ 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 )
virtual

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
protected

Definition at line 187 of file NCMLElement.h.


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