bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
HDFSPArray_RealField.h
1
2// This file is part of the hdf4 data handler for the OPeNDAP data server.
3// It retrieves the real field values for some special NASA HDF data.
4// Authors: Kent Yang <myang6@hdfgroup.org>
5// Copyright (c) The HDF Group
7
8#ifndef HDFSPARRAY_REALFIELD_H
9#define HDFSPARRAY_REALFIELD_H
10
11#include "mfhdf.h"
12#include "hdf.h"
13
14#include <libdap/Array.h>
15
16#include "HDFSPEnumType.h"
17#include "BESH4MCache.h"
18
19
20class HDFSPArray_RealField:public libdap::Array
21{
22 public:
23 HDFSPArray_RealField (int32 rank, const std::string& filename, const int sdfd, int32 fieldref, int32 dtype, const SPType & sptype, const std::string & fieldname, const std::vector<int32> & h4_dimsizes, const std::string & n = "", libdap::BaseType * v = nullptr):
24 Array (n, v),
25 rank (rank),
26 filename(filename),
27 sdfd (sdfd),
28 fieldref (fieldref),
29 dtype (dtype),
30 sptype (sptype),
31 fieldname (fieldname),
32 dimsizes(h4_dimsizes) {
33 }
34 ~ HDFSPArray_RealField () override = default;
35 int format_constraint (int *cor, int *step, int *edg);
36
37 libdap::BaseType *ptr_duplicate () override
38 {
39 return new HDFSPArray_RealField (*this);
40 }
41
42 bool read () override;
43
44 private:
45 int32 rank;
46 string filename;
47 int32 sdfd;
48 int32 fieldref;
49 int32 dtype;
50 SPType sptype;
51 std::string fieldname;
52 std::vector<int32>dimsizes;
53 void write_data_to_cache(int32,const std::string&,short,const std::vector<char>&, int);
54 bool obtain_cached_data(BESH4Cache*,const std::string&, int,std::vector<int>&, std::vector<int>&,size_t,short);
55 template<typename T> int subset(const T input[],int,std::vector<int32>&,std::vector<int>&,std::vector<int>&,std::vector<int>&,std::vector<T>*,std::vector<int32>&,int);
56};
57
58
59#endif