40 static const string DEBUG_CHANNEL(
"agg_util");
49 const libdap::Array& proto,
51 std::auto_ptr<ArrayGetterInterface>& arrayGetter,
57 BESDEBUG(DEBUG_CHANNEL,
"ArrayAggregateOnOuterDimension: ctor called!" << endl);
61 "ArrayAggregateOnOuterDimension: adding new outer dimension: "
64 prepend_dim(_newDim.
size, _newDim.
name);
74 "ArrayAggregateOnOuterDimension() copy ctor called!" <<
81 BESDEBUG(DEBUG_CHANNEL,
"~ArrayAggregateOnOuterDimension() dtor called!" << endl);
109 _newDim = rhs._newDim;
113 ArrayAggregateOnOuterDimension::cleanup() throw()
137 const Array::dimension& outerDim = *(dim_begin());
139 "Aggregating datasets array with outer dimension constraints: "
140 <<
" start=" << outerDim.start
141 <<
" stride=" << outerDim.stride
142 <<
" stop=" << outerDim.stop
146 if (static_cast<unsigned int>(outerDim.size) !=
getDatasetList().size())
150 "The new outer dimension of the joinNew aggregation doesn't "
151 " have the same size as the number of datasets in the aggregation!");
155 reserve_value_capacity();
159 int nextElementIndex = 0;
162 for (
int i = outerDim.start;
163 i <= outerDim.stop && i < outerDim.size;
164 i += outerDim.stride)
182 std::ostringstream oss;
183 oss <<
"Got AggregationException while streaming dataset index="
185 <<
" data for location=\""
187 <<
"\" The error msg was: "
188 << std::string(ex.what());
199 "ArrayAggregateOnOuterDimension::read(): "
200 "At end of aggregating, expected the nextElementIndex to be the length of the "
201 "aggregated array, but it wasn't!");
ArrayAggregationBase & operator=(const ArrayAggregationBase &rhs)
Abstract helper superclass for allowing lazy access to the DataDDS for an aggregation.
virtual ~ArrayAggregateOnOuterDimension()
Destroy any local memory.
libdap::Array & getGranuleTemplateArray()
Accessor for subclasses Note this is protected, so not const! Subclasses may mutate the return hence ...
class ArrayAggregateOnOuterDimension
virtual ArrayAggregateOnOuterDimension * ptr_duplicate()
Virtual Constructor: Make a deep copy (clone) of the object and return it.
Helper class for temporarily hijacking an existing dhi to load a DDX response for one particular file...
#define NCML_ASSERT_MSG(cond, msg)
const std::string & getLocation() const
The location to which the AggMemberDataset refers Note: this could be "" for some subclasses if they ...
Base class for subclasses of libdap::Array which perform aggregation on a list of AggMemberDatasets w...
#define THROW_NCML_PARSE_ERROR(parseLine, msg)
Struct for holding information about a dimension of data, minimally a name and a cardinality (size)...
const ArrayGetterInterface & getArrayGetterInterface() const
Accessor for subclasses Note this is protected, so not const! Subclasses may mutate the return hence ...
static void addDatasetArrayDataToAggregationOutputArray(libdap::Array &oOutputArray, unsigned int atIndex, const libdap::Array &constrainedTemplateArray, const string &varName, AggMemberDataset &dataset, const ArrayGetterInterface &arrayGetter, const string &debugChannel)
Load the given dataset's DataDDS.
virtual void transferOutputConstraintsIntoGranuleTemplateHook()
Subclass hook for read() to copy granule constraints properly (inner dim ones).
std::vector< RCPtr< AggMemberDataset > > AMDList
ArrayAggregateOnOuterDimension & operator=(const ArrayAggregateOnOuterDimension &rhs)
Assign this from rhs object.
const AMDList & getDatasetList() const
Get the list of AggMemberDataset's that comprise this aggregation.
ArrayAggregateOnOuterDimension(const libdap::Array &proto, const AMDList &memberDatasets, std::auto_ptr< ArrayGetterInterface > &arrayGetter, const Dimension &newDim)
Construct a joinNew Array aggregation given the parameters.
static void transferArrayConstraints(libdap::Array *pToArray, const libdap::Array &fromArray, bool skipFirstFromDim, bool skipFirstToDim, bool printDebug=false, const std::string &debugChannel="agg_util")
Copy the constraints from the from Array into the pToArray in Dim_iter order.
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Exception class used by AggregationUtil and other agg_util classes to pass generic exceptions upward ...
virtual void readConstrainedGranuleArraysAndAggregateDataHook()
Actually go through the constraints and stream the correctly constrained data into the superclass's o...