115 libdap::Marshaller &m,
bool ce_eval)
118 BES_STOPWATCH_START(DEBUG_CHANNEL, prolog +
"Timing");
121 if (!(send_p() || is_in_selection())) {
122 BESDEBUG_FUNC(DEBUG_CHANNEL,
"Object not in output, skipping... name=" << name() << endl);
128 delete bes_timing::elapsedTimeToReadStart;
129 bes_timing::elapsedTimeToReadStart = 0;
135 const Array::dimension& outerDim = *(dim_begin());
136 BESDEBUG(DEBUG_CHANNEL,
137 "Aggregating datasets array with outer dimension constraints: " <<
" start=" << outerDim.start <<
" stride=" << outerDim.stride <<
" stop=" << outerDim.stop << endl);
140 if (
static_cast<unsigned int>(outerDim.size) !=
getDatasetList().size()) {
142 THROW_NCML_PARSE_ERROR(-1,
"The new outer dimension of the joinNew aggregation doesn't "
143 " have the same size as the number of datasets in the aggregation!");
148 m.put_vector_start(length());
150 reserve_value_capacity();
156 int nextElementIndex = 0;
159 for (
int i = outerDim.start; i <= outerDim.stop && i < outerDim.size; i += outerDim.stride) {
166 delete bes_timing::elapsedTimeToTransmitStart;
167 bes_timing::elapsedTimeToTransmitStart = 0;
171 this->set_value_slice_from_row_major_vector(*pDatasetArray, nextElementIndex);
174 pDatasetArray->clear_local_data();
177 std::ostringstream oss;
178 oss <<
"Got AggregationException while streaming dataset index=" << i <<
" data for location=\""
179 << dataset.
getLocation() <<
"\" The error msg was: " << std::string(ex.what());
180 THROW_NCML_PARSE_ERROR(-1, oss.str());
188 NCML_ASSERT_MSG(nextElementIndex == length(),
"Logic error:\n"
189 "ArrayAggregateOnOuterDimension::read(): "
190 "At end of aggregating, expected the nextElementIndex to be the length of the "
191 "aggregated array, but it wasn't!");
200 delete bes_timing::elapsedTimeToTransmitStart;
201 bes_timing::elapsedTimeToTransmitStart = 0;
202 status = libdap::Array::serialize(eval, dds, m, ce_eval);
206 status = libdap::Array::serialize(eval, dds, m, ce_eval);
245 BES_STOPWATCH_START(DEBUG_CHANNEL, prolog +
"Timing");
248 const Array::dimension& outerDim = *(dim_begin());
249 BESDEBUG(DEBUG_CHANNEL,
250 "Aggregating datasets array with outer dimension constraints: " <<
" start=" << outerDim.start <<
" stride=" << outerDim.stride <<
" stop=" << outerDim.stop << endl);
253 if (
static_cast<unsigned int>(outerDim.size) !=
getDatasetList().size()) {
255 THROW_NCML_PARSE_ERROR(-1,
"The new outer dimension of the joinNew aggregation doesn't "
256 " have the same size as the number of datasets in the aggregation!");
260 reserve_value_capacity();
264 int nextElementIndex = 0;
267 for (
int i = outerDim.start; i <= outerDim.stop && i < outerDim.size; i += outerDim.stride) {
279 std::ostringstream oss;
280 oss <<
"Got AggregationException while streaming dataset index=" << i <<
" data for location=\""
281 << dataset.
getLocation() <<
"\" The error msg was: " << std::string(ex.what());
282 THROW_NCML_PARSE_ERROR(-1, oss.str());
290 NCML_ASSERT_MSG(nextElementIndex == length(),
"Logic error:\n"
291 "ArrayAggregateOnOuterDimension::read(): "
292 "At end of aggregating, expected the nextElementIndex to be the length of the "
293 "aggregated array, but it wasn't!");
static void addDatasetArrayDataToAggregationOutputArray(libdap::Array &oOutputArray, unsigned int atIndex, const libdap::Array &constrainedTemplateArray, const string &varName, AggMemberDataset &dataset, const ArrayGetterInterface &arrayGetter, const string &debugChannel)
static void transferArrayConstraints(libdap::Array *pToArray, const libdap::Array &fromArray, bool skipFirstFromDim, bool skipFirstToDim, bool printDebug=false, const std::string &debugChannel="agg_util")