44#include "dods-limits.h"
61const int DODS_MAX_ARRAY = DODS_INT_MAX;
189 unsigned int filter_mask;
190 unsigned long long chunk_direct_io_offset;
191 unsigned long long chunk_buffer_size;
192 vector<unsigned long long> chunk_coords;
197 vector<unsigned int>deflate_levels;
198 vector<size_t> chunk_dims;
199 vector<var_chunk_info_t> var_chunk_info;
204 std::vector<dimension> _shape;
206 bool direct_io_flag =
false;
211 friend class ArrayTest;
215 void _duplicate(
const Array &a);
218 unsigned int dims, uint64_t shape[]);
221 unsigned int dims, uint64_t shape[]);
223 std::vector<dimension> &shape(){
233 typedef std::vector<dimension>::const_iterator
Dim_citer;
244 Array(
const string &n,
const string &d,
BaseType *v,
bool is_dap4 =
false);
256 void add_var_nocopy(
BaseType *v,
Part p = nil)
override;
259 void append_dim_ll(int64_t size,
const string &
name =
"");
264 void rename_dim(
const string &oldName =
"",
const string &newName =
"");
267 virtual void add_constraint_ll(
Dim_iter i, int64_t start, int64_t stride, int64_t stop);
274 virtual void update_length_ll(
unsigned long long size = 0);
284 virtual int64_t dimension_size_ll(
Dim_iter i,
bool constrained =
false);
285 virtual int64_t dimension_start_ll(
Dim_iter i,
bool constrained =
false);
286 virtual int64_t dimension_stop_ll(
Dim_iter i,
bool constrained =
false);
287 virtual int64_t dimension_stride_ll(
Dim_iter i,
bool constrained =
false);
292 virtual unsigned int dimensions(
bool constrained =
false);
300 void print_decl(ostream &out,
string space =
" ",
301 bool print_semi =
true,
302 bool constraint_info =
false,
303 bool constrained =
false)
override;
305 void print_xml(ostream &out,
string space =
" ",
306 bool constrained =
false)
override;
309 virtual void print_xml_writer_core(
XMLWriter &out,
bool constrained,
string tag);
310 virtual void print_as_map_xml_writer(
XMLWriter &xml,
bool constrained);
312 virtual void print_xml_core(FILE *out,
string space,
bool constrained,
string tag);
313 virtual void print_xml_core(ostream &out,
string space,
bool constrained,
string tag);
317 bool constrained =
false);
319 void print_val(ostream &out,
string space =
"",
320 bool print_decl_p =
true)
override;
322 void print_xml(FILE *out,
string space =
" ",
323 bool constrained =
false)
override;
325 bool constrained =
false);
326 void print_val(FILE *out,
string space =
"",
327 bool print_decl_p =
true)
override;
328 void print_decl(FILE *out,
string space =
" ",
329 bool print_semi =
true,
330 bool constraint_info =
false,
331 bool constrained =
false)
override;
336 bool is_dap4_projected(std::vector<std::string> &projected_dap4_inventory)
override;
338 void dump(ostream &strm)
const override;
341 bool get_dio_flag()
const {
return direct_io_flag; }
342 void set_dio_flag(
bool dio_flag_value =
true) { direct_io_flag = dio_flag_value; }
343 var_storage_info & get_var_storage_info() {
return vs_info;}
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_decl(ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false) override
Prints a DDS entry for the Array.
void print_xml(ostream &out, string space=" ", bool constrained=false) override
void print_val(ostream &out, string space="", bool print_decl_p=true) override
Prints the value of the variable.
BaseType * ptr_duplicate() 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)
void print_xml_writer(XMLWriter &xml, bool constrained=false) override
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="")
void transform_to_dap4(D4Group *root, Constructor *container) override
DAP2 to DAP4 transform.
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.
The basic data type for the DODS DAP types.
virtual string name() const
Returns the name of the class instance.
Holds a one-dimensional collection of DAP2 data types.
top level DAP object to house generic methods
Part
Names the parts of multi-section constructor data types.
int64_t start
The constraint start index.
int64_t stride
The constraint stride.
string name
The name of this dimension.
D4Dimension * dim
If not null, a weak pointer to the D4Dimension.
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.