44#include "dods-limits.h"
60const int DODS_MAX_ARRAY = DODS_INT_MAX;
186 unsigned int filter_mask;
187 unsigned long long chunk_direct_io_offset;
188 unsigned long long chunk_buffer_size;
189 vector<unsigned long long> chunk_coords;
194 vector<unsigned int> deflate_levels;
195 vector<size_t> chunk_dims;
196 vector<var_chunk_info_t> var_chunk_info;
202 std::vector<dimension> _shape;
204 bool direct_io_flag =
false;
209 friend class ArrayTest;
210 friend class D4Group;
213 void _duplicate(
const Array &a);
215 uint64_t
print_array(FILE *out, uint64_t index,
unsigned int dims, uint64_t shape[]);
217 uint64_t
print_array(ostream &out, uint64_t index,
unsigned int dims, uint64_t shape[]);
219 std::vector<dimension> &shape() {
return _shape; }
227 typedef std::vector<dimension>::const_iterator
Dim_citer;
238 Array(
const string &n,
const string &d,
BaseType *v,
bool is_dap4 =
false);
250 void add_var_nocopy(
BaseType *v,
Part p = nil)
override;
253 void append_dim_ll(int64_t size,
const string &
name =
"");
258 void rename_dim(
const string &oldName =
"",
const string &newName =
"");
261 virtual void add_constraint_ll(
Dim_iter i, int64_t start, int64_t stride, int64_t stop);
268 virtual void update_length_ll(
unsigned long long size = 0);
278 virtual int64_t dimension_size_ll(
Dim_iter i,
bool constrained =
false);
279 virtual int64_t dimension_start_ll(
Dim_iter i,
bool constrained =
false);
280 virtual int64_t dimension_stop_ll(
Dim_iter i,
bool constrained =
false);
281 virtual int64_t dimension_stride_ll(
Dim_iter i,
bool constrained =
false);
286 virtual unsigned int dimensions(
bool constrained =
false);
294 void print_decl(ostream &out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
295 bool constrained =
false)
override;
297 void print_xml(ostream &out,
string space =
" ",
bool constrained =
false)
override;
300 virtual void print_xml_writer_core(
XMLWriter &out,
bool constrained,
string tag);
301 virtual void print_as_map_xml_writer(
XMLWriter &xml,
bool constrained);
303 virtual void print_xml_core(FILE *out,
string space,
bool constrained,
string tag);
304 virtual void print_xml_core(ostream &out,
string space,
bool constrained,
string tag);
307 virtual void print_as_map_xml(ostream &out,
string space =
" ",
bool constrained =
false);
309 void print_val(ostream &out,
string space =
"",
bool print_decl_p =
true)
override;
311 void print_xml(FILE *out,
string space =
" ",
bool constrained =
false)
override;
312 virtual void print_as_map_xml(FILE *out,
string space =
" ",
bool constrained =
false);
313 void print_val(FILE *out,
string space =
"",
bool print_decl_p =
true)
override;
314 void print_decl(FILE *out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
315 bool constrained =
false)
override;
319 bool is_dap4_projected(std::vector<std::string> &projected_dap4_inventory)
override;
321 void dump(ostream &strm)
const override;
324 bool get_dio_flag()
const {
return direct_io_flag; }
325 void set_dio_flag(
bool dio_flag_value =
true) { direct_io_flag = dio_flag_value; }
326 var_storage_info &get_var_storage_info() {
return vs_info; }
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.
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.
The basic data type for the DODS DAP types.
virtual string name() const
Returns the name of the class instance.
Vector(const string &n, BaseType *v, const Type &t, bool is_dap4=false)
The Vector constructor.
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.