bes Updated for version 3.20.13
ncml_module::ScanElement Class Reference

#include <ScanElement.h>

Collaboration diagram for ncml_module::ScanElement:
Collaboration graph

Public Member Functions

void addPreDeleteCB (UseCountHitZeroCB *pCB)
 
virtual ScanElementclone () const
 
void getDatasetList (std::vector< NetcdfElement * > &datasets) const
 
long getOlderThanAsSeconds () const
 
AggregationElementgetParent () const
 
virtual int getRefCount () const
 
virtual const std::string & getTypeName () const
 
virtual void handleBegin ()
 
virtual void handleContent (const std::string &content)
 
virtual void handleEnd ()
 
int line () const
 
const std::string & ncoords () const
 
virtual int ref () const
 
virtual void removeFromPool () const
 
void removePreDeleteCB (UseCountHitZeroCB *pCB)
 
 ScanElement (const ScanElement &proto)
 
virtual void setAttributes (const XMLAttributeMap &attrs)
 
void setParent (AggregationElement *pParent)
 
void setParser (NCMLParser *p)
 
bool shouldScanSubdirs () const
 
virtual std::string toString () 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)
 

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 std::string _sTypeName = "scan"
 
static const std::vector< std::string > _sValidAttrs = getValidAttributes()
 

Protected Attributes

NCMLParser_parser
 

Detailed Description

Implementation of the <scan> element used to scan directories to create the set of files for an aggregation.

Definition at line 48 of file ScanElement.h.

Constructor & Destructor Documentation

◆ ScanElement() [1/2]

ncml_module::ScanElement::ScanElement ( )

Definition at line 95 of file ScanElement.cc.

◆ ScanElement() [2/2]

ncml_module::ScanElement::ScanElement ( const ScanElement proto)

Definition at line 101 of file ScanElement.cc.

◆ ~ScanElement()

ncml_module::ScanElement::~ScanElement ( )
virtual

Definition at line 112 of file ScanElement.cc.

Member Function Documentation

◆ addPreDeleteCB()

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

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

Definition at line 129 of file RCObject.cc.

◆ areAllAttributesValid()

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.

Definition at line 229 of file NCMLElement.cc.

◆ clone()

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

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

Implements ncml_module::NCMLElement.

Definition at line 136 of file ScanElement.cc.

◆ getDatasetList()

void ncml_module::ScanElement::getDatasetList ( std::vector< NetcdfElement * > &  datasets) const

Actually perform the filesystem scan based on the specified attributes (suffix, subdirs, etc).

Fill in the vector with matching datasets, sorted by the filename.

NOTE: The members added to this vector will be ref()'d so the caller needs to make sure to deref them!

Parameters
datasetsThe vector to add the datasets to.

Definition at line 229 of file ScanElement.cc.

◆ getOlderThanAsSeconds()

long ncml_module::ScanElement::getOlderThanAsSeconds ( ) const

Get the olderThan attribute in seconds. Returns 0 for the empty attribute and -1 if there's an error parsing the attribute.

Returns

Definition at line 211 of file ScanElement.cc.

◆ getParent()

AggregationElement * ncml_module::ScanElement::getParent ( ) const

Get the aggregation of which I am a child

Definition at line 119 of file ScanElement.cc.

◆ getRefCount()

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

Get the current reference count

Implements agg_util::RCObjectInterface.

Definition at line 101 of file RCObject.cc.

◆ getTypeName()

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

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

Implements ncml_module::NCMLElement.

Definition at line 130 of file ScanElement.cc.

◆ handleBegin()

void ncml_module::ScanElement::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 164 of file ScanElement.cc.

◆ handleContent()

void ncml_module::ScanElement::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 from ncml_module::NCMLElement.

Definition at line 172 of file ScanElement.cc.

◆ handleEnd()

void ncml_module::ScanElement::handleEnd ( )
virtual

Handle the closing of this element.

Implements ncml_module::NCMLElement.

Definition at line 178 of file ScanElement.cc.

◆ isValidAttribute()

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

Definition at line 217 of file NCMLElement.cc.

◆ line()

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

Return the current parse line number. Shorthand

Definition at line 160 of file NCMLElement.cc.

◆ ncoords()

const string & ncml_module::ScanElement::ncoords ( ) const

Definition at line 201 of file ScanElement.cc.

◆ printAttributeIfNotEmpty()

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 212 of file NCMLElement.cc.

◆ ref()

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 71 of file RCObject.cc.

◆ removeFromPool()

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 106 of file RCObject.cc.

◆ removePreDeleteCB()

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

Remove it exists. If not, this unchanged.

Definition at line 142 of file RCObject.cc.

◆ setAttributes()

void ncml_module::ScanElement::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 141 of file ScanElement.cc.

◆ setParent()

void ncml_module::ScanElement::setParent ( AggregationElement pParent)

Set the parent of this element. This should ONLY be called by the AggregationElement when this is added to it.

Parameters
pParentthe weak ref to the parent.

Definition at line 124 of file ScanElement.cc.

◆ setParser()

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

Definition at line 153 of file NCMLElement.cc.

◆ shouldScanSubdirs()

bool ncml_module::ScanElement::shouldScanSubdirs ( ) const

is the subdirs attribute true?

Definition at line 206 of file ScanElement.cc.

◆ toString()

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

Return a string describing the element

Implements ncml_module::NCMLElement.

Definition at line 190 of file ScanElement.cc.

◆ unref()

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.

Definition at line 78 of file RCObject.cc.

◆ validateAttributes()

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

Definition at line 174 of file NCMLElement.cc.

Member Data Documentation

◆ _parser

NCMLParser* ncml_module::NCMLElement::_parser
protectedinherited

Definition at line 187 of file NCMLElement.h.

◆ _sTypeName

const string ncml_module::ScanElement::_sTypeName = "scan"
static

Definition at line 52 of file ScanElement.h.

◆ _sValidAttrs

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

Definition at line 55 of file ScanElement.h.


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