32 #include <BESInternalError.h>
35 #include "FONcStructure.h"
36 #include "FONcUtils.h"
37 #include "FONcAttributes.h"
50 _s =
dynamic_cast<Structure *
>(b);
52 string s = (string)
"File out netcdf, write_structure was passed a " +
"variable that is not a structure";
66 vector<FONcBaseType *>::iterator i = _vars.begin();
67 vector<FONcBaseType *>::iterator e = _vars.end();
100 FONcBaseType::convert(embed,is_dap4_group);
101 embed.push_back(
name());
102 Constructor::Vars_iter vi = _s->var_begin();
103 Constructor::Vars_iter ve = _s->var_end();
104 for (; vi != ve; vi++) {
107 BESDEBUG(
"fonc",
"FONcStructure::convert - converting " << bt->name() << endl);
108 bool is_classic_model =
true;
109 if(
true == isNetCDF4_ENHANCED())
110 is_classic_model =
false;
115 _vars.push_back(fbt);
116 fbt->convert(embed,is_dap4_group);
139 BESDEBUG(
"fonc",
"FONcStructure::define - defining " << _varname << endl);
140 vector<FONcBaseType *>::const_iterator i = _vars.begin();
141 vector<FONcBaseType *>::const_iterator e = _vars.end();
142 for (; i != e; i++) {
144 BESDEBUG(
"fonc",
"defining " << fbt->name() << endl);
150 BESDEBUG(
"fonc",
"FONcStructure::define - done defining " << _varname << endl);
163 BESDEBUG(
"fonc",
"FONcStructure::write - writing " << _varname << endl);
164 vector<FONcBaseType *>::const_iterator i = _vars.begin();
165 vector<FONcBaseType *>::const_iterator e = _vars.end();
166 for (; i != e; i++) {
170 BESDEBUG(
"fonc",
"FONcStructure::define - done writing " << _varname << endl);
192 strm << BESIndent::LMarg <<
"FONcStructure::dump - (" << (
void *)
this <<
")" << endl;
194 strm << BESIndent::LMarg <<
"name = " << _s->name() <<
" {" << endl;
196 vector<FONcBaseType *>::const_iterator i = _vars.begin();
197 vector<FONcBaseType *>::const_iterator e = _vars.end();
198 for (; i != e; i++) {
202 BESIndent::UnIndent();
203 strm << BESIndent::LMarg <<
"}" << endl;
204 BESIndent::UnIndent();
exception thrown if internal error encountered
A DAP BaseType with file out netcdf information included.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual void dump(std::ostream &strm) const =0
dump the contents of this object to the specified ostream
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual void define(int ncid)
Define the members of the structure in the netcdf file.
virtual void write(int ncid)
write the member variables of the structure to the netcdf file
virtual void convert(vector< string > embed, bool is_dap4_group=false)
Creates the FONc objects for each variable of the DAP structure.
FONcStructure(BaseType *b)
Constructor for FONcStructure that takes a DAP Structure.
virtual string name()
Returns the name of the structure.
virtual ~FONcStructure()
Destructor that cleans up the structure.
static FONcBaseType * convert(BaseType *v, const string &version, const bool classic_model)
Creates a FONc object for the given DAP object.