Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Next: , Previous: Auxiliary Classes, Up: Auxiliary Classes



Class NcValues

Class NcValues is an abstract base class for a block of typed values. The derived classes are NcValues_ncbyte, NcValues_char, NcValues_short, NcValues_int, NcValues_nclong (deprecated), and NcValues_long, NcValues_float, NcValues_double. These classes are used as the return type of the NcTypedComponent::values() member function, for typed-value arrays associated with variables and attributes.

Public Member Functions

NcValues( void )
Default constructor.


NcValues(NcType, long)
Constructor for a value block of the specified type and length.


~NcValues( void )
Destructor.


long num( void )
Returns the number of values in the value block.


ostream& print(ostream&) const
Used to print the comma-delimited sequence of values of the value block.


void* base( void ) const
Returns a bland pointer to the beginning of the value block.


int bytes_for_one( void ) const
Returns the number of bytes required for one value.


ncbyte as_ncbyte( int n ) const
char as_char( int n ) const
short as_short( int n ) const
int as_int( int n ) const
nclong as_nclong( int n ) const // deprecated
long as_long( int n ) const
float as_float( int n ) const
double as_double( int n ) const
char* as_string( int n ) const
Provide conversions for the nth value from the value type to a desired basic type. If the value is out of range, the default "fill-value" for the appropriate type is returned.

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690