bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
FONcUtils.h
1// FONcUtils.h
2
3// This file is part of BES Netcdf File Out Module
4
5// Copyright (c) 2004,2005 University Corporation for Atmospheric Research
6// Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Lesser General Public
10// License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Lesser General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// You can contact University Corporation for Atmospheric Research at
23// 3080 Center Green Drive, Boulder, CO 80301
24
25// (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
26// Please read the full copyright statement in the file COPYRIGHT_UCAR.
27//
28// Authors:
29// pwest Patrick West <pwest@ucar.edu>
30// jgarcia Jose Garcia <jgarcia@ucar.edu>
31
32#ifndef FONcUtils_h_
33#define FONcUtils_h_ 1
34
35#include <netcdf.h>
36
37#include <string>
38
39#include <libdap/BaseType.h>
40#include <map>
41
42namespace libdap{
43 class BaseType;
44}
45
46class FONcBaseType;
47
48#define FONC_EMBEDDED_SEPARATOR "."
49#define FONC_ATTRIBUTE_SEPARATOR "."
50#define FONC_ORIGINAL_NAME "fonc_original_name"
51
58class FONcUtils {
59public:
60 static string name_prefix;
61 static void reset();
62 static string id2netcdf(string in);
63 static nc_type get_nc_type(libdap::BaseType *element,bool isNC4_ENHANCED);
64 static string gen_name(const vector<string> &embed, const string &name, string &original);
65 static FONcBaseType * convert(libdap::BaseType *v,const string & version, const bool classic_model);
66 static FONcBaseType * convert(libdap::BaseType *v,const string & version, const bool classic_model, map<string,int>&,vector<int>&);
67 static void handle_error(int stax, const string &err, const string &file, int line);
68};
69
70#endif // FONcUtils
71
A DAP BaseType with file out netcdf information included.
Utilities used to help in the return of an OPeNDAP DataDDS object as a netcdf file.
Definition FONcUtils.h:58
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors
Definition FONcUtils.cc:429
static string name_prefix
If a variable name, dimension name, or attribute name begins with a character that is not supported b...
Definition FONcUtils.h:60
static void reset()
Resets the FONc transformation for a new input and out file.
Definition FONcUtils.cc:70
static nc_type get_nc_type(libdap::BaseType *element, bool isNC4_ENHANCED)
translate the OPeNDAP data type to a netcdf data type
Definition FONcUtils.cc:115
static string id2netcdf(string in)
convert the provided string to a netcdf allowed identifier.
Definition FONcUtils.cc:87
static string gen_name(const vector< string > &embed, const string &name, string &original)
generate a new name for the embedded variable
Definition FONcUtils.cc:182
STL class.
STL class.