46#include "D4Attributes.h"
47#include "D4Dimensions.h"
49#include "D4EnumDefs.h"
56#include "InternalErr.h"
65Array::dimension::dimension(
D4Dimension *d) : dim(d), use_sdim_for_slice(true) {
75void Array::_duplicate(
const Array &a) {
80 d_maps =
new D4Maps(*a.d_maps,
this);
100 for (
Dim_citer i = _shape.begin(); i != _shape.end(); i++) {
107void Array::update_length_ll(
unsigned long long) {
108 unsigned long long length = 1;
109 for (
const auto &i : _shape) {
113 set_length_ll(length);
134 :
Vector(n, nullptr, dods_array_c, is_dap4) {
137 BaseType::set_is_dap4(v->is_dap4());
153 :
Vector(n, d, nullptr, dods_array_c, is_dap4) {
156 BaseType::set_is_dap4(v->is_dap4());
167Array &Array::operator=(
const Array &rhs) {
170 Vector::operator=(rhs);
180 container->add_var_nocopy(dest);
188 D4Dimensions *root_dims = root->dims();
189 for (
Array::Dim_iter dap2_dim = dest->dim_begin(), e = dest->dim_end(); dap2_dim != e; ++dap2_dim) {
190 if (!(*dap2_dim).name.empty()) {
193 D4Dimension *d4_dim = root_dims->find_dim((*dap2_dim).name);
195 d4_dim =
new D4Dimension((*dap2_dim).name, (*dap2_dim).size);
196 root_dims->add_dim_nocopy(d4_dim);
198 DBG(cerr << __func__ <<
"() -" <<
" Using Existing D4Dimension '" << d4_dim->name() <<
"' ("
199 << (
void *)d4_dim <<
")" << endl);
202 if (d4_dim->size() != (
unsigned long)(*dap2_dim).size) {
214 d4_dim =
new D4Dimension((*dap2_dim).name +
"_" + name(), (*dap2_dim).size);
215 DBG(cerr << __func__ <<
"() -" <<
" Utilizing Name/Size Conflict Naming Artifice. name'"
216 << d4_dim->name() <<
"' (" << (
void *)d4_dim <<
")" << endl);
218 root_dims->add_dim_nocopy(d4_dim);
223 (*dap2_dim).dim = d4_dim;
228 dest->attributes()->transform_to_dap4(get_attr_table());
229 dest->set_is_dap4(
true);
230 container->add_var_nocopy(dest);
233bool Array::is_dap2_grid() {
234 bool is_grid =
false;
235 if (this->is_dap4()) {
236 DBG(cerr << __func__ <<
"() - Array '" << name() <<
"' is DAP4 object!" << endl);
237 auto root =
dynamic_cast<D4Group *
>(this->get_ancestor());
239 throw InternalErr(__FILE__, __LINE__,
string(
"Could not get the root group for ").append(this->name()));
240 D4Maps *d4_maps = this->maps();
241 is_grid = d4_maps->size();
248 DBG(cerr << __func__ <<
"() - Array '" << name() <<
"' has D4Maps." << endl);
250 D4Maps::D4MapsIter i = d4_maps->map_begin();
251 D4Maps::D4MapsIter e = d4_maps->map_end();
254 DBG(cerr << __func__ <<
"() - Map '" << (*i)->array()->name() <<
" has " << (*i)->array()->_shape.size()
255 <<
" dimension(s)." << endl);
256 if ((*i)->array(root)->_shape.size() > 1) {
264 DBG(cerr << __func__ <<
"() - Array '" << name() <<
"' has no D4Maps." << endl);
268 DBG(cerr << __func__ <<
"() - is_grid: " << (is_grid ?
"true" :
"false") << endl);
288 DBG(cerr << __func__ <<
"() - BEGIN Array '" << name() <<
"'" << endl);
298 if (is_dap2_grid()) {
300 DBG(cerr << __func__ <<
"() - Array '" << name() <<
"' is dap2 Grid!" << endl);
302 Grid *g =
new Grid(name());
305 grid_array->set_is_dap4(
false);
306 g->set_array(grid_array);
309 attributes()->transform_attrs_to_dap2(&grid_array->get_attr_table());
312 auto root =
dynamic_cast<D4Group *
>(this->get_ancestor());
314 throw InternalErr(__FILE__, __LINE__,
string(
"Could not get the root group for ").append(this->name()));
315 D4Maps *d4_maps = this->maps();
316 vector<BaseType *> dropped_maps;
317 D4Maps::D4MapsIter miter = d4_maps->map_begin();
318 D4Maps::D4MapsIter end = d4_maps->map_end();
319 for (; miter != end; miter++) {
320 D4Map *d4_map = (*miter);
322 vector<BaseType *> *d2_result = d4_map_array->
transform_to_dap2(&(g->get_attr_table()));
324 if (d2_result->size() > 1)
325 throw Error(internal_error,
"D4Map Array conversion resulted in multiple DAP2 objects.");
328 Array *d2_map_array =
dynamic_cast<Array *
>((*d2_result)[0]);
331 throw Error(internal_error,
332 "DAP2 array from D4Map Array conversion has more than 1 dimension.");
334 d2_map_array->set_is_dap4(
false);
335 g->add_map(d2_map_array,
false);
336 AttrTable at = d2_map_array->get_attr_table();
337 DBG(cerr << __func__ <<
"() - " <<
"DAS For Grid Map '" << d2_map_array->name() <<
"':" << endl;
340 throw Error(internal_error,
"Unable to interpret returned DAP2 content.");
344 dropped_maps.push_back(d4_map_array);
349 if (!dropped_maps.empty()) {
351 AttrTable *dv_table = Constructor::make_dropped_vars_attr_table(&dropped_maps);
352 dest->get_attr_table().append_container(dv_table, dv_table->
get_name());
355 DBG(cerr << __func__ <<
"() - Array '" << name() <<
"' is not a Grid!" << endl);
358 switch (proto->type()) {
382 if (dest->get_attr_table().get_size() == 0) {
383 attributes()->transform_attrs_to_dap2(&dest->get_attr_table());
384 dest->get_attr_table().set_name(name());
387 dest->set_is_dap4(
false);
393 vector<BaseType *> *result;
395 result =
new vector<BaseType *>();
396 result->push_back(dest);
401 DBG(cerr << __func__ <<
"() - END Array '" << name() <<
"'" << endl);
418 std::vector<dimension>::iterator i = _shape.begin(), e = _shape.end();
421 while (old_i != old_e) {
422 if ((*i).dim == *old_i) {
423 (*i).dim = new_dims->find_dim((*old_i)->name());
460 if (v && v->type() == dods_array_c) {
462 Vector::add_var(a->var());
479 if (v && v->type() == dods_array_c) {
481 Vector::add_var_nocopy(a.var());
489 Vector::add_var_nocopy(v);
511void Array::append_dim_ll(int64_t size,
const string &name) {
514 dimension d(size,
www2id(name));
518 _shape.emplace_back(size,
www2id(name));
537 _shape.insert(_shape.begin(), d);
545 _shape.insert(_shape.begin(), d);
561 std::vector<dimension>::iterator i = _shape.begin(), e = _shape.end();
564 if (d.
name == oldName) {
565 DBG(cerr <<
"Old name = " << d.
name <<
" newName = " << newName << endl);
581 for (
Dim_iter i = _shape.begin(); i != _shape.end(); i++) {
583 (*i).stop = (*i).size - 1;
585 (*i).c_size = (*i).size;
604static const char *array_sss =
"Invalid constraint parameters: At least one of the start, stride or stop \n\
605specified do not match the array variable.";
630 DBG(cerr <<
"add_constraint: d_size = " << d.
size << endl);
631 DBG(cerr <<
"add_constraint: start = " << start << endl);
632 DBG(cerr <<
"add_constraint: stop = " << stop << endl);
633 DBG(cerr <<
"add_constraint: stride = " << stride << endl);
639 if (d.
size > DODS_INT_MAX) {
641 throw Error(malformed_expr,
"The dimension size is too large. use add_constraint_ll()");
650 if (start >= d.
size || stop >= d.
size || stride > d.
size || stride <= 0)
651 throw Error(malformed_expr, array_sss);
653 if (((stop - start) / stride + 1) > d.
size)
654 throw Error(malformed_expr, array_sss);
660 d.
c_size = (stop - start) / stride + 1;
662 DBG(cerr <<
"add_constraint: c_size = " << d.
c_size << endl);
669void Array::add_constraint_ll(Dim_iter i, int64_t start, int64_t stride, int64_t stop) {
671 DBG(cerr <<
"add_constraint_ll: d_size = " << d.size << endl);
672 DBG(cerr <<
"add_constraint_ll: start = " << start << endl);
673 DBG(cerr <<
"add_constraint_ll: stop = " << stop << endl);
674 DBG(cerr <<
"add_constraint_ll: stride = " << stride << endl);
685 if (start >= d.size || stop >= d.size || stride > d.size || stride <= 0)
686 throw Error(malformed_expr, array_sss);
688 if (((stop - start) / stride + 1) > d.size)
689 throw Error(malformed_expr, array_sss);
695 d.c_size = (stop - start) / stride + 1;
697 DBG(cerr <<
"add_constraint: c_size = " << d.c_size << endl);
701 d.use_sdim_for_slice =
false;
705 DBG(cerr <<
"add_constraint d4dimension: stride = " << dim->c_stride() << endl);
707 if (dim->constrained())
708 add_constraint_ll(i, dim->c_start(), dim->c_stride(), dim->c_stop());
710 dim->set_used_by_projected_var(
true);
714 d.use_sdim_for_slice =
true;
755 if (!_shape.empty()) {
757 if ((*i).c_size > DODS_INT_MAX) {
758 throw Error(malformed_expr,
"The dimension size is too large. Use dimension_size_ll()");
762 if ((*i).size > DODS_INT_MAX) {
763 throw Error(malformed_expr,
"The dimension size is too large. Use dimension_size_ll()");
791 if ((*i).start > DODS_INT_MAX) {
792 throw Error(malformed_expr,
"The dimension start value is too large. Use dimension_start_ll()");
794 return (!_shape.empty()) ? (*i).start : 0;
816 if ((*i).stop > DODS_INT_MAX) {
817 throw Error(malformed_expr,
"The dimension stop value is too large. Use dimension_stop_ll()");
819 return (!_shape.empty()) ? (*i).stop : 0;
842 if ((*i).stride > DODS_INT_MAX) {
843 throw Error(malformed_expr,
"The dimension stride value is too large. Use dimension_stride_ll()");
845 return (!_shape.empty()) ? (*i).stride : 0;
848int64_t Array::dimension_size_ll(Dim_iter i,
bool constrained) {
851 if (!_shape.empty()) {
860int64_t Array::dimension_start_ll(Dim_iter i,
bool ) {
return (!_shape.empty()) ? (*i).start : 0; }
862int64_t Array::dimension_stop_ll(Dim_iter i,
bool ) {
return (!_shape.empty()) ? (*i).stop : 0; }
864int64_t Array::dimension_stride_ll(Dim_iter i,
bool ) {
return (!_shape.empty()) ? (*i).stride : 0; }
883 throw InternalErr(__FILE__, __LINE__,
"*This* array has no dimensions.");
887D4Dimension *Array::dimension_D4dim(Dim_iter i) {
return (!_shape.empty()) ? (*i).dim : 0; }
889D4Maps *Array::maps() {
891 d_maps =
new D4Maps(
this);
902unsigned int Array::width(
bool constrained)
const
909 return length() *
var()->width(constrained);
913 for (
Dim_iter i = _shape.begin(); i != _shape.end(); i++) {
921class PrintD4ArrayDimXMLWriter :
public unary_function<Array::dimension &, void> {
928 PrintD4ArrayDimXMLWriter(XMLWriter &xml,
bool c) : xml(xml), d_constrained(c) {}
930 void operator()(Array::dimension &d) {
935 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar *)
"Dim") < 0)
936 throw InternalErr(__FILE__, __LINE__,
"Could not write Dim element");
938 string name = (d.dim) ? d.dim->fully_qualified_name() : d.name;
941 if (!d_constrained && !name.empty()) {
942 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"name", (
const xmlChar *)name.c_str()) <
944 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
945 }
else if (d.use_sdim_for_slice) {
946 assert(!name.empty());
947 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"name", (
const xmlChar *)name.c_str()) <
949 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
952 size << (d_constrained ? d.c_size : d.size);
953 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"size",
954 (
const xmlChar *)size.str().c_str()) < 0)
955 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
958 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
959 throw InternalErr(__FILE__, __LINE__,
"Could not end Dim element");
963class PrintD4ConstructorVarXMLWriter :
public unary_function<BaseType *, void> {
968 PrintD4ConstructorVarXMLWriter(XMLWriter &xml,
bool c) : xml(xml), d_constrained(c) {}
970 void operator()(BaseType *btp) { btp->print_dap4(xml, d_constrained); }
973class PrintD4MapXMLWriter :
public unary_function<D4Map *, void> {
977 PrintD4MapXMLWriter(XMLWriter &xml) : xml(xml) {}
979 void operator()(D4Map *m) { m->print_dap4(xml); }
988 if (constrained && !
send_p())
991 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar *)
var()->
type_name().c_str()) < 0)
995 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"name", (
const xmlChar *)name().c_str()) < 0)
996 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
999 if (
var()->type() == dods_enum_c) {
1001 string path = e->enumeration()->name();
1002 if (e->enumeration()->parent()) {
1004 path =
static_cast<D4Group *
>(e->enumeration()->parent()->parent())->FQN() + path;
1006 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"enum", (
const xmlChar *)path.c_str()) < 0)
1007 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for enum");
1012 for_each(c.
var_begin(), c.
var_end(), PrintD4ConstructorVarXMLWriter(xml, constrained));
1017 for_each(
dim_begin(),
dim_end(), PrintD4ArrayDimXMLWriter(xml, constrained));
1019 attributes()->print_dap4(xml);
1021 for_each(maps()->map_begin(), maps()->map_end(), PrintD4MapXMLWriter(xml));
1023 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1044void Array::print_decl(FILE *out,
string space,
bool print_semi,
bool constraint_info,
bool constrained) {
1046 print_decl(oss, space, print_semi, constraint_info, constrained);
1047 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
1067void Array::print_decl(ostream &out,
string space,
bool print_semi,
bool constraint_info,
bool constrained) {
1068 if (constrained && !
send_p())
1072 var()->print_decl(out, space,
false, constraint_info, constrained);
1074 for (
Dim_citer i = _shape.begin(); i != _shape.end(); i++) {
1076 if ((*i).name !=
"") {
1077 out <<
id2www((*i).name) <<
" = ";
1080 out << (*i).c_size <<
"]";
1082 out << (*i).size <<
"]";
1096 print_xml_writer_core(xml, constrained,
"Array");
1097 fwrite(xml.get_doc(),
sizeof(
char), xml.get_doc_size(), out);
1105 print_xml_writer_core(xml, constrained,
"Array");
1106 out << xml.get_doc();
1114 print_xml_writer_core(xml, constrained,
"Map");
1115 fwrite(xml.get_doc(),
sizeof(
char), xml.get_doc_size(), out);
1123 print_xml_writer_core(xml, constrained,
"Map");
1124 out << xml.get_doc();
1132 print_xml_writer_core(xml, constrained, tag);
1133 fwrite(xml.get_doc(),
sizeof(
char), xml.get_doc_size(), out);
1141 print_xml_writer_core(xml, constrained, tag);
1142 out << xml.get_doc();
1145void Array::print_xml_writer(
XMLWriter &xml,
bool constrained) { print_xml_writer_core(xml, constrained,
"Array"); }
1147void Array::print_as_map_xml_writer(XMLWriter &xml,
bool constrained) {
1148 print_xml_writer_core(xml, constrained,
"Map");
1151class PrintArrayDimXMLWriter :
public unary_function<Array::dimension &, void> {
1156 PrintArrayDimXMLWriter(XMLWriter &xml,
bool c) : xml(xml), d_constrained(c) {}
1158 void operator()(Array::dimension &d) {
1159 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar *)
"dimension") < 0)
1160 throw InternalErr(__FILE__, __LINE__,
"Could not write dimension element");
1162 if (!d.name.empty())
1163 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"name",
1164 (
const xmlChar *)d.name.c_str()) < 0)
1165 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1168 size << (d_constrained ? d.c_size : d.size);
1169 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"size",
1170 (
const xmlChar *)size.str().c_str()) < 0)
1171 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1173 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1174 throw InternalErr(__FILE__, __LINE__,
"Could not end dimension element");
1178void Array::print_xml_writer_core(
XMLWriter &xml,
bool constrained,
string tag) {
1179 if (constrained && !
send_p())
1182 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar *)tag.c_str()) < 0)
1183 throw InternalErr(__FILE__, __LINE__,
"Could not write " + tag +
" element");
1185 if (!name().empty())
1186 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar *)
"name", (
const xmlChar *)name().c_str()) < 0)
1187 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1191 BaseType *btp =
var();
1192 string tmp_name = btp->name();
1194 btp->print_xml_writer(xml, constrained);
1195 btp->set_name(tmp_name);
1197 for_each(
dim_begin(),
dim_end(), PrintArrayDimXMLWriter(xml, constrained));
1199 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1200 throw InternalErr(__FILE__, __LINE__,
"Could not end " + tag +
" element");
1216 uint64_t i =
print_array(oss, index, dims, shape);
1217 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
1238 if (shape[0] >= 1) {
1239 for (uint64_t i = 0; i < shape[0] - 1; ++i) {
1240 var_ll(index++)->print_val(out,
"",
false);
1243 var_ll(index++)->print_val(out,
"",
false);
1263 for (uint64_t i = 0; i < shape[0] - 1; ++i) {
1264 index =
print_array(out, index, dims - 1, shape + 1);
1268 index =
print_array(out, index, dims - 1, shape + 1);
1277void Array::print_val(FILE *out,
string space,
bool print_decl_p) {
1280 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
1283void Array::print_val(ostream &out,
string space,
bool print_decl_p) {
1291 print_decl(out, space,
false,
false,
false);
1296 unsigned int index = 0;
1297 for (
Dim_iter i = _shape.begin(); i != _shape.end() && index <
dimensions(
true); ++i)
1298 shape[index++] = dimension_size_ll(i,
true);
1320 bool sem = BaseType::check_semantics(msg) && !_shape.empty();
1323 msg =
"An array variable must have dimensions";
1335 stringstream sqr_brkty_stuff;
1337 sqr_brkty_stuff <<
"[";
1339 if (!dim_name.empty()) {
1340 sqr_brkty_stuff << dim_name <<
"=";
1342 sqr_brkty_stuff << a.dimension_size_ll(itr,
true) <<
"]";
1344 return sqr_brkty_stuff.str();
1354 bool has_projected_dap4 =
false;
1357 has_projected_dap4 =
1358 prototype()->is_dap4_projected(inventory) || attributes()->has_dap4_types(FQN(), inventory);
1360 Type type = prototype()->type();
1361 has_projected_dap4 = (type == libdap::dods_int8_c) || (type == dods_uint64_c) || (type == dods_int64_c);
1362 if (has_projected_dap4) {
1365 has_projected_dap4 |= attributes()->has_dap4_types(FQN(), inventory);
1368 return has_projected_dap4;
1380 strm << DapIndent::LMarg <<
"Array::dump - (" << (
void *)
this <<
")" << endl;
1381 DapIndent::Indent();
1383 strm << DapIndent::LMarg <<
"shape:" << endl;
1384 DapIndent::Indent();
1387 unsigned int dim_num = 0;
1388 for (; i != ie; i++) {
1389 strm << DapIndent::LMarg <<
"dimension " << dim_num++ <<
":" << endl;
1390 DapIndent::Indent();
1391 strm << DapIndent::LMarg <<
"name: " << (*i).name << endl;
1392 strm << DapIndent::LMarg <<
"size: " << (*i).size << endl;
1393 strm << DapIndent::LMarg <<
"start: " << (*i).start << endl;
1394 strm << DapIndent::LMarg <<
"stop: " << (*i).stop << endl;
1395 strm << DapIndent::LMarg <<
"stride: " << (*i).stride << endl;
1396 strm << DapIndent::LMarg <<
"constrained size: " << (*i).c_size << endl;
1397 DapIndent::UnIndent();
1399 DapIndent::UnIndent();
1400 DapIndent::UnIndent();
1411 vs_info.filter = my_vs_info.filter;
1413 for (
const auto &def_lev : my_vs_info.deflate_levels)
1414 vs_info.deflate_levels.push_back(def_lev);
1416 for (
const auto &chunk_dim : my_vs_info.chunk_dims)
1417 vs_info.chunk_dims.push_back(chunk_dim);
1419 for (
const auto &vci : my_vs_info.var_chunk_info) {
1421 vci_t.filter_mask = vci.filter_mask;
1422 vci_t.chunk_direct_io_offset = vci.chunk_direct_io_offset;
1423 vci_t.chunk_buffer_size = vci.chunk_buffer_size;
1424 for (
const auto &chunk_coord : vci.chunk_coords)
1425 vci_t.chunk_coords.push_back(chunk_coord);
1426 vs_info.var_chunk_info.push_back(vci_t);
A multidimensional array of identical data types.
void print_dap4(XMLWriter &xml, bool constrained=false) override
Print the DAP4 representation of an array.
virtual int dimension_start(Dim_iter i, bool constrained=false)
Return the start index of a dimension.
virtual void clear_constraint()
Clears the projection; add each projected dimension explicitly using add_constraint.
virtual int dimension_stop(Dim_iter i, bool constrained=false)
Return the stop index of the constraint.
void dump(ostream &strm) const override
dumps information about this object
virtual void update_length(int size=0)
bool is_dap4_projected(std::vector< std::string > &projected_dap4_inventory) override
virtual void add_constraint(Dim_iter i, int start, int stride, int stop)
Adds a constraint to an Array dimension.
virtual string dimension_name(Dim_iter i)
Returns the name of the specified dimension.
void print_xml(ostream &out, string space=" ", bool constrained=false) override
void append_dim(int size, const string &name="")
Add a dimension of a given size.
std::vector< dimension >::iterator Dim_iter
void rename_dim(const string &oldName="", const string &newName="")
Renames dimension.
std::vector< BaseType * > * transform_to_dap2(AttrTable *parent_attr_table) override
Transforms this instance of a D4Array into the corresponding DAP2 object.
virtual int dimension_size(Dim_iter i, bool constrained=false)
Returns the size of the dimension.
std::vector< dimension >::const_iterator Dim_citer
void add_var(BaseType *v, Part p=nil) override
Add the BaseType pointer to this constructor type instance.
uint64_t print_array(FILE *out, uint64_t index, unsigned int dims, uint64_t shape[])
Print the value given the current constraint.
virtual void print_as_map_xml(ostream &out, string space=" ", bool constrained=false)
virtual void reset_constraint()
Reset constraint to select entire array.
void set_var_storage_info(const var_storage_info &my_vs_info)
Set the variable storage information for direct IO optimization.
virtual ~Array()
The Array destructor.
virtual void print_xml_core(FILE *out, string space, bool constrained, string tag)
void prepend_dim(int size, const string &name="")
Array(const string &n, BaseType *v, bool is_dap4=false)
Array constructor.
bool check_semantics(string &msg, bool all=false) override
Check semantic features of the Array.
virtual unsigned int dimensions(bool constrained=false)
Return the total number of dimensions in the array.
virtual int dimension_stride(Dim_iter i, bool constrained=false)
Returns the stride value of the constraint.
Contains the attributes for a dataset.
virtual string get_name() const
Get the name of this attribute table.
void print_xml_writer(XMLWriter &xml)
virtual void print(FILE *out, string pad=" ", bool dereference=false)
Prints the attribute table.
vector< D4Dimension * >::iterator D4DimensionsIter
Iterator used for D4Dimensions.
D4DimensionsIter dim_end()
Get an iterator to the end of the dimensions.
D4DimensionsIter dim_begin()
Get an iterator to the start of the dimensions.
Holds a DAP4 enumeration.
Array * array(D4Group *root)
This will always return the correct pointer for a valid data set.
A class for error processing.
A class for software fault reporting.
top level DAP object to house generic methods
virtual void set_length(int64_t)
Set the number of elements for this variable. use -1 to indicate nothing set.
virtual BaseType * ptr_duplicate()=0
Type
Identifies the data type.
string get_dims_decl(Array &a)
virtual string type_name() const
Returns the type of the class instance as a string.
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=nullptr)
Returns a pointer to a member of a constructor class.
string www2id(const string &in, const string &escape, const string &except)
virtual int length() const
How many elements are in this variable? Uses -1 in places.
virtual bool send_p()
Should this variable be sent?
virtual void set_length_ll(int64_t)
Set the number of elements in this variable This version of the function deprecates set_length() whic...
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
virtual bool is_constructor_type() const
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Part
Names the parts of multi-section constructor data types.
string id2www(string in, const string &allowable)
int64_t start
The constraint start index.
int64_t stride
The constraint stride.
string name
The name of this dimension.
int64_t size
The unconstrained dimension size.
int64_t stop
The constraint end index.
bool use_sdim_for_slice
Used to control printing the DMR in data responses.
int64_t c_size
Size of dimension once constrained.