33#include <BESInternalError.h>
35#include <libdap/UInt64.h>
37#include "FONcUInt64.h"
39#include "FONcAttributes.h"
50 : FONcBaseType(), _bt( b )
52 UInt64 *u64 =
dynamic_cast<UInt64 *
>(b) ;
55 string s = (
string)
"File out netcdf, FONcUInt was passed a "
56 +
"variable that is not a DAP UInt64" ;
89 D4Attributes *d4_attrs = _bt->attributes();
90 updateD4AttrType(d4_attrs,NC_UINT64);
93 AttrTable &attrs = _bt->get_attr_table();
94 updateAttrType(attrs,NC_UINT64);
100 d_varname, d_orig_varname ) ;
116 BESDEBUG(
"fonc",
"FONcUInt64::write for var " << d_varname << endl ) ;
117 size_t var_index[] = {0} ;
119 unsigned long long *data =
new unsigned long long ;
124 _bt->intern_data(*get_eval(), *get_dds());
126 _bt->buf2val( (
void**)&data ) ;
127 int stax = nc_put_var1_ulonglong(ncid, d_varid, var_index, data ) ;
128 if( stax != NC_NOERR )
130 string err = (
string)
"fileout.netcdf4 - "
131 +
"Failed to write unsigned long long data for "
136 BESDEBUG(
"fonc",
"FONcUInt64::done write for var " << d_varname << endl ) ;
168 strm << BESIndent::LMarg <<
"FONcUInt64::dump - ("
169 << (
void *)
this <<
")" << endl ;
170 BESIndent::Indent() ;
171 strm << BESIndent::LMarg <<
"name = " << _bt->name() << endl ;
172 BESIndent::UnIndent() ;
exception thrown if internal error encountered
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_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.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual string name()
returns the name of the DAP UInt64
virtual nc_type type()
returns the netcdf type of the DAP object
virtual void write(int ncid)
Write the unsigned int out to the netcdf file.
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
FONcUInt64(libdap::BaseType *b)
Constructor for FOncUInt64 that takes a DAP UInt64.
virtual void define(int ncid)
define the DAP UInt64 in the netcdf file
virtual ~FONcUInt64()
Destructor that cleans up the instance.
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors