bes  Updated for version 3.20.6
roi_util.h
1 // -*- mode: c++; c-basic-offset:4 -*-
2 
3 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
4 // Access Protocol.
5 
6 // Copyright (c) 2015 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 #ifndef ROI_UTILS_H_
26 #define ROI_UTILS_H_
27 
28 namespace libdap {
29 class BaseType;
30 class Array;
31 class Structure;
32 }
33 
34 namespace functions {
35 
36 // Defined here because prior to C++ 11, defining a container using a local
37 // type was not allowed.
38 struct slice {
39  int start, stop;
40  string name;
41 };
42 
43 void roi_bbox_valid_slice(libdap::BaseType *btp);
44 unsigned int roi_valid_bbox(libdap::BaseType *btp);
45 
46 void roi_bbox_get_slice_data(libdap::Array *bbox, unsigned int i, int &start, int &stop, string &name);
47 
48 libdap::Structure *roi_bbox_build_slice(unsigned int start_value, unsigned int stop_value, const string &dim_name);
49 
50 unique_ptr<libdap::Array> roi_bbox_build_empty_bbox(unsigned int num_dim, const string &bbox_name = "bbox");
51 
52 }
53 
54 #endif /* ROI_UTILS_H_ */
functions::slice
Definition: roi_util.h:38
libdap
Definition: BESDapFunctionResponseCache.h:35