29 #include <BESInternalError.h>
32 #include "FONcUByte.h"
33 #include "FONcUtils.h"
34 #include "FONcAttributes.h"
47 _b =
dynamic_cast<Byte *
>(b) ;
50 string s = (string)
"File out netcdf, FONcUByte was passed a "
51 +
"variable that is not a DAP Byte" ;
84 _varname, _orig_varname ) ;
102 BESDEBUG(
"fonc",
"FOncUByte::write for var " << _varname << endl ) ;
103 size_t var_index[] = {0} ;
104 unsigned char *data =
new unsigned char ;
105 _b->buf2val( (
void**)&data ) ;
106 int stax = nc_put_var1_uchar(ncid, _varid, var_index, data ) ;
107 if( stax != NC_NOERR )
109 string err = (string)
"fileout.netcdf - "
110 +
"Failed to write byte data for "
146 strm << BESIndent::LMarg <<
"FONcUByte::dump - ("
147 << (
void *)
this <<
")" << endl ;
148 BESIndent::Indent() ;
149 strm << BESIndent::LMarg <<
"name = " << _b->name() << endl ;
150 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.
A DAP BaseType with file out netcdf information included.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual void define(int ncid)
define the DAP Byte in the netcdf file
virtual ~FONcUByte()
Destructor that cleans up the byte.
virtual nc_type type()
returns the netcdf type of the DAP Byte
virtual string name()
returns the name of the DAP Byte
FONcUByte(BaseType *b)
Constructor for FONcUByte that takes a DAP Byte.
virtual void write(int ncid)
Write the byte out to the netcdf file.
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors