DumpableNcFile Class Reference

Inheritance diagram for DumpableNcFile:

Inheritance graph
[legend]
Collaboration diagram for DumpableNcFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DumpableNcFile (const char *path, NcFile::FileMode mode=ReadOnly)
void dumpdims (void)
void dumpvars (void)
void dumpgatts (void)
void dumpdata (void)

Detailed Description

Definition at line 124 of file nctst.cpp.


Constructor & Destructor Documentation

DumpableNcFile::DumpableNcFile const char *  path,
NcFile::FileMode  mode = ReadOnly
[inline]
 

Definition at line 127 of file nctst.cpp.

00128         : NcFile(path, mode) {} ;


Member Function Documentation

void DumpableNcFile::dumpdata void   ) 
 

Definition at line 200 of file nctst.cpp.

References NcFile::get_var(), NcVar::name(), and NcVar::values().

Referenced by dump().

00201 {
00202     NcVar* vp;
00203     for (int n = 0; vp = get_var(n); n++) {
00204         cout << " " << vp->name() << " = ";
00205         NcValues* vals = vp->values();
00206         cout << *vals << " ;" << endl ;
00207         delete vals;
00208     }
00209 }

void DumpableNcFile::dumpdims void   ) 
 

Definition at line 135 of file nctst.cpp.

References NcFile::get_dim(), NcDim::is_unlimited(), NcDim::name(), NcFile::num_dims(), and NcDim::size().

Referenced by dump().

00136 {
00137 
00138     for (int n=0; n < num_dims(); n++) {
00139         NcDim* dim = get_dim(n);
00140         cout << "\t" << dim->name() << " = " ;
00141         if (dim->is_unlimited())
00142           cout << "UNLIMITED" << " ;\t " << "// " << dim->size() <<
00143             " currently\n";
00144         else
00145           cout << dim->size() << " ;\n";
00146     }
00147 }

void DumpableNcFile::dumpgatts void   ) 
 

Definition at line 188 of file nctst.cpp.

References NcFile::get_att(), NcAtt::name(), and NcAtt::values().

Referenced by dump().

00189 {
00190     NcAtt* ap;
00191     for(int n = 0; ap = get_att(n); n++) {
00192         cout << "\t\t" << ":" << ap->name() << " = " ;
00193         NcValues* vals = ap->values();
00194         cout << *vals << " ;" << endl ;
00195         delete vals;
00196         delete ap;
00197     }
00198 }

void DumpableNcFile::dumpvars void   ) 
 

Definition at line 162 of file nctst.cpp.

References dumpatts(), NcVar::get_dim(), NcFile::get_var(), NcDim::name(), NcVar::name(), NcFile::num_dims(), NcVar::num_dims(), and NcVar::type().

Referenced by dump().

00163 {
00164     int n;
00165     static const char* types[] =
00166       {"","byte","char","short","long","float","double"};
00167     NcVar* vp;
00168 
00169     for(n = 0; vp = get_var(n); n++) {
00170         cout << "\t" << types[vp->type()] << " " << vp->name() ;
00171 
00172         if (vp->num_dims() > 0) {
00173             cout << "(";
00174             for (int d = 0; d < vp->num_dims(); d++) {
00175                 NcDim* dim = vp->get_dim(d);
00176                 cout << dim->name();
00177                 if (d < vp->num_dims()-1)
00178                   cout << ", ";           
00179             }
00180             cout << ")";
00181         }
00182         cout << " ;\n";
00183         // now dump each of this variable's attributes
00184         dumpatts(*vp);
00185     }
00186 }


The documentation for this class was generated from the following file:
Generated on Thu Mar 16 18:17:29 2006 for nco by  doxygen 1.4.4