OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
agg_util::AggMemberDataset Class Referenceabstract

Abstract helper superclass for allowing lazy access to the DataDDS for an aggregation. More...

#include <AggMemberDataset.h>

Inheritance diagram for agg_util::AggMemberDataset:
Inheritance graph
Collaboration diagram for agg_util::AggMemberDataset:
Collaboration graph

Public Member Functions

void addPreDeleteCB (UseCountHitZeroCB *pCB)
 Add uniquely. More...
 
 AggMemberDataset (const std::string &location)
 
 AggMemberDataset (const AggMemberDataset &proto)
 
virtual void fillDimensionCacheByUsingDataDDS ()=0
 Uses the getDataDDS() call in order to find all named dimensions within it and to seed them into the dimension cache table for faster later lookups. More...
 
virtual void flushDimensionCache ()=0
 Flush out any cache for the Dimensions so that it will have to be loaded. More...
 
virtual unsigned int getCachedDimensionSize (const std::string &dimName) const =0
 Get the size of the given dimension named dimName cached within the dataset. More...
 
virtual const libdap::DataDDS * getDataDDS ()=0
 Return the DataDDS for the location, loading it in if it hasn't yet been loaded. More...
 
const std::string & getLocation () const
 The location to which the AggMemberDataset refers Note: this could be "" for some subclasses if they are virtual or nested. More...
 
virtual int getRefCount () const
 Get the current reference count. More...
 
virtual bool isDimensionCached (const std::string &dimName) const =0
 Return whether the dimension is already cached, or would have to be loaded to be found. More...
 
virtual void loadDimensionCache (std::istream &istr)=0
 Load the values in the dimension cache from the input stream. More...
 
AggMemberDatasetoperator= (const AggMemberDataset &rhs)
 
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...
 
virtual void saveDimensionCache (std::ostream &ostr)=0
 Append the values in the dimension cache to the output stream. More...
 
virtual void setDimensionCacheFor (const Dimension &dim, bool throwIfFound)=0
 Seed the dimension cache using the given dimension, so that later calls to getDimensionSize for dim.name will return the dim.size immediately without checking or loading the actual DDS. More...
 
virtual std::string toString () const
 Just prints the count and address. More...
 
virtual int unref () const throw ()
 Decrease the reference count by one. More...
 
virtual ~AggMemberDataset ()
 

Detailed Description

Abstract helper superclass for allowing lazy access to the DataDDS for an aggregation.

This is used during a read() if the dataset is needed in an aggregation.

Note: This inherits from RCObject so is a ref-counted object to avoid making excessive copies of it and especially of any contained DDS.

Currently, there are two concrete subclasses:

o AggMemberDatasetUsingLocationRef: to load an external location into a DataDDS as needed (laxy eval so not loaded unless in the output of read() )

o AggMemberDatasetDDSWrapper: to hold a pre-loaded DataDDS for the case of virtual or pre-loaded datasets (data declared in NcML file, nested aggregations, e.g.) In this case, getLocation() is presumed empty().

Definition at line 67 of file AggMemberDataset.h.

Constructor & Destructor Documentation

agg_util::AggMemberDataset::AggMemberDataset ( const std::string &  location)

Definition at line 41 of file AggMemberDataset.cc.

agg_util::AggMemberDataset::~AggMemberDataset ( )
virtual

Definition at line 56 of file AggMemberDataset.cc.

agg_util::AggMemberDataset::AggMemberDataset ( const AggMemberDataset proto)

Definition at line 48 of file AggMemberDataset.cc.

Member Function Documentation

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.

virtual void agg_util::AggMemberDataset::fillDimensionCacheByUsingDataDDS ( )
pure virtual

Uses the getDataDDS() call in order to find all named dimensions within it and to seed them into the dimension cache table for faster later lookups.

Potentially slow!

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

virtual void agg_util::AggMemberDataset::flushDimensionCache ( )
pure virtual

Flush out any cache for the Dimensions so that it will have to be loaded.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

virtual unsigned int agg_util::AggMemberDataset::getCachedDimensionSize ( const std::string &  dimName) const
pure virtual

Get the size of the given dimension named dimName cached within the dataset.

If not found in cache, throws.

If a cached value exists from a prior load of the DataDDS using loadDimensionCacheFromDataDDS() or from a call to setDimensionCacheFor(), return that.

Otherwise, this must load the DataDDS to get the values.

Implementation is left up to subclasses for efficiency.

Returns
the size of the dimension if found
Exceptions
agg_util::DimensionNotFoundExceptionif not located via any means.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

Referenced by agg_util::ArrayJoinExistingAggregation::readConstrainedGranuleArraysAndAggregateDataHook().

virtual const libdap::DataDDS* agg_util::AggMemberDataset::getDataDDS ( )
pure virtual

Return the DataDDS for the location, loading it in if it hasn't yet been loaded.

Can return NULL if there's a problem. (Not const due to lazy eval)

Returns
the DataDDS ptr containing the loaded dataset or NULL.

Implemented in agg_util::AggMemberDatasetUsingLocationRef, agg_util::AggMemberDatasetSharedDDSWrapper, and agg_util::AggMemberDatasetDDSWrapper.

Referenced by agg_util::AggregationUtil::addDatasetArrayDataToAggregationOutputArray(), and agg_util::AggMemberDatasetWithDimensionCacheBase::fillDimensionCacheByUsingDataDDS().

const std::string & agg_util::AggMemberDataset::getLocation ( ) const

The location to which the AggMemberDataset refers Note: this could be "" for some subclasses if they are virtual or nested.

Definition at line 62 of file AggMemberDataset.cc.

Referenced by agg_util::AggregationUtil::addDatasetArrayDataToAggregationOutputArray(), and agg_util::ArrayAggregateOnOuterDimension::readConstrainedGranuleArraysAndAggregateDataHook().

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

Get the current reference count.

Implements agg_util::RCObjectInterface.

Definition at line 110 of file RCObject.cc.

virtual bool agg_util::AggMemberDataset::isDimensionCached ( const std::string &  dimName) const
pure virtual

Return whether the dimension is already cached, or would have to be loaded to be found.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

virtual void agg_util::AggMemberDataset::loadDimensionCache ( std::istream &  istr)
pure virtual

Load the values in the dimension cache from the input stream.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

AggMemberDataset & agg_util::AggMemberDataset::operator= ( const AggMemberDataset rhs)
int agg_util::RCObject::ref ( ) const
virtualinherited
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.

virtual void agg_util::AggMemberDataset::saveDimensionCache ( std::ostream &  ostr)
pure virtual

Append the values in the dimension cache to the output stream.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

virtual void agg_util::AggMemberDataset::setDimensionCacheFor ( const Dimension dim,
bool  throwIfFound 
)
pure virtual

Seed the dimension cache using the given dimension, so that later calls to getDimensionSize for dim.name will return the dim.size immediately without checking or loading the actual DDS.

If it already exists and throwIfFound then will throw an AggregationException.

If it exists and !throwIfFound, will replace the old one.

Parameters
dimthe dimension to seed
iftrue, throw if name take. Else replace original.

Implemented in agg_util::AggMemberDatasetWithDimensionCacheBase.

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=(), ncml_module::AggregationElement::~AggregationElement(), and ncml_module::NetcdfElement::VariableValueValidator::~VariableValueValidator().

Here is the call graph for this function:


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