bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
FONcAttributes.h
1// FONcAttributes.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 FONcAttributes_h_
33#define FONcAttributes_h_ 1
34
35#include <netcdf.h>
36
37#include <string>
38
39#include <libdap/BaseType.h>
40#include <libdap/D4Attributes.h>
41using namespace libdap ;
42
43class FONcBaseType ;
44
55{
56private:
57 static void add_variable_attributes_worker( int ncid, int varid, BaseType *b, string &emb_name,bool is_netCDF_enhanced ,bool is_dap4) ;
58 //static void add_variable_attributes_worker( int ncid, int varid, BaseType *b, string &emb_name,bool is_netCDF_enhanced,bool is_dap4 ) ;
59 static void add_attributes_worker( int ncid, int varid, const string &var_name, AttrTable &attrs, AttrTable::Attr_iter &attr, const string &prepend_attri,bool is_netCDF_enhanced ) ;
60 //static void add_dap4_attributes_worker( int ncid, int varid, const string &var_name, D4Attributes *d4_attrs, D4Attributes::D4AttributesIter &attr, const string &prepend_attri,bool is_netCDF_enhanced ) ;
61 static void add_dap4_attributes_worker( int ncid, int varid, const string &var_name, D4Attribute *attr, const string &prepend_attri,bool is_netCDF_enhanced ) ;
62public:
63 static void add_attributes( int ncid, int varid, AttrTable &attrs, const string &var_name, const string &prepend_attr , bool is_netCDF_enhanced) ;
64 static void add_dap4_attributes( int ncid, int varid, D4Attributes *d4_attrs, const string &var_name, const string &prepend_attr , bool is_netCDF_enhanced) ;
65 static void add_variable_attributes( int ncid, int varid, BaseType *b ,bool is_netCDF_enhanced,bool is_dap4) ;
66 //static void add_variable_attributes( int ncid, int varid, BaseType *b ,bool is_netCDF_enhanced,bool is_dap4) ;
67 static void add_original_name( int ncid, int varid, const string &var_name, const string &orig ) ;
68 static void write_attrs_for_nc4_types(int ncid,int varid, const string &var_name, const string&global_attr_name,const string & var_attr_name,AttrTable attrs, AttrTable::Attr_iter &attr,bool is_nc_enhanced);
69 //static void write_dap4_attrs_for_nc4_types(int ncid,int varid, const string &var_name, const string&global_attr_name,const string & var_attr_name,D4Attributes *d4_attrs, D4Attributes::D4AttributesIter &attr,bool is_nc_enhanced);
70 //static void write_dap4_attrs_for_nc4_types(int ncid,int varid, const string &var_name, const string&global_attr_name,const string & var_attr_name,D4Attributes *d4_attrs, D4Attribute* attr,bool is_nc_enhanced);
71 static void write_dap4_attrs_for_nc4_types(int ncid,int varid, const string &var_name, const string&global_attr_name,const string & var_attr_name, D4Attribute* attr,bool is_nc_enhanced);
72} ;
73
74#endif // FONcAttributes
75
A class that provides static methods to help write out attributes for a given variable.
static void add_dap4_attributes(int ncid, int varid, D4Attributes *d4_attrs, const string &var_name, const string &prepend_attr, bool is_netCDF_enhanced)
add_dap4_attributes
static void write_dap4_attrs_for_nc4_types(int ncid, int varid, const string &var_name, const string &global_attr_name, const string &var_attr_name, D4Attribute *attr, bool is_nc_enhanced)
writes out a single attribute that maps the dap4 datatype to netCDF-4
static void add_original_name(int ncid, int varid, const string &var_name, const string &orig)
Adds an attribute for the variable if the variable name had to be modified in any way.
static void add_attributes(int ncid, int varid, AttrTable &attrs, const string &var_name, const string &prepend_attr, bool is_netCDF_enhanced)
helper function for add_attributes
static void write_attrs_for_nc4_types(int ncid, int varid, const string &var_name, const string &global_attr_name, const string &var_attr_name, AttrTable attrs, AttrTable::Attr_iter &attr, bool is_nc_enhanced)
writes out a single attribute that maps the datatype to netCDF-4
static void add_variable_attributes(int ncid, int varid, BaseType *b, bool is_netCDF_enhanced, bool is_dap4)
Add the attributes for an OPeNDAP variable to the netcdf file.
A DAP BaseType with file out netcdf information included.