29#include <BESInternalError.h>
34#include "FONcAttributes.h"
45 : FONcBaseType(), _b( 0 )
47 _b =
dynamic_cast<Int8 *
>(b) ;
50 string s = (
string)
"File out netcdf, FONcInt8 was passed a "
51 +
"variable that is not a DAP4 int8" ;
84 D4Attributes *d4_attrs = _b->attributes();
85 updateD4AttrType(d4_attrs,NC_BYTE);
88 AttrTable &attrs = _b->get_attr_table();
89 updateAttrType(attrs,NC_BYTE);
94 d_varname, d_orig_varname ) ;
112 BESDEBUG(
"fonc",
"FOncInt8::write for var " << d_varname << endl ) ;
113 size_t var_index[] = {0} ;
115 signed char data_value[1];
120 _b->intern_data(*get_eval(), *get_dds());
122 data_value[0] = _b->value();
125 int stax = nc_put_var1_schar(ncid, d_varid, var_index, data_value ) ;
126 if( stax != NC_NOERR )
128 string err = (
string)
"fileout.netcdf - "
129 +
"Failed to write byte data for "
165 strm << BESIndent::LMarg <<
"FONcInt8::dump - ("
166 << (
void *)
this <<
")" << endl ;
167 BESIndent::Indent() ;
168 strm << BESIndent::LMarg <<
"name = " << _b->name() << endl ;
169 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 void define(int ncid)
define the DAP4 int8 in the netcdf file
FONcInt8(libdap::BaseType *b)
Constructor for FONcInt8 that takes a DAP4 int8.
virtual void write(int ncid)
Write the DAP4 int8 out to the netcdf file.
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual string name()
returns the name of the DAP4 int8
virtual ~FONcInt8()
Destructor that cleans up the DAP4 int8.
virtual nc_type type()
returns the netcdf type of the DAP4 int8
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors