NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
netcdf::NcType Class Reference

Base class for all netCDF data types. More...

#include <NetCDF/cpp4/src/NcType.h>

+ Inheritance diagram for netcdf::NcType:

Detailed Description

Copyright:
Original C++ API developed by Lynton Appel.
Portions of this software were developed by the Unidata Program at the
University Corporation for Atmospheric Research.
Modifications: Copyright 2013 Colorado State University. All rights reserved.
Organization:
Natural Resource Ecology Laboratory
Colorado State University, Fort Collins, CO 80523 USA
www.nrel.colostate.edu
Project:
IRC <www.nrel.colostate.edu/projects/irc/>
Author
Tom Hilinski tom.h.nosp@m.ilin.nosp@m.ski@c.nosp@m.olos.nosp@m.tate..nosp@m.edu
Date
2013Jan

Public Types

enum  ncType {
  nc_NAT = NC_NAT, nc_BYTE = NC_BYTE, nc_CHAR = NC_CHAR, nc_SHORT = NC_SHORT,
  nc_INT = NC_INT, nc_FLOAT = NC_FLOAT, nc_DOUBLE = NC_DOUBLE, nc_UBYTE = NC_UBYTE,
  nc_USHORT = NC_USHORT, nc_UINT = NC_UINT, nc_INT64 = NC_INT64, nc_UINT64 = NC_UINT64,
  nc_STRING = NC_STRING, nc_VLEN = NC_VLEN, nc_OPAQUE = NC_OPAQUE, nc_ENUM = NC_ENUM,
  nc_COMPOUND = NC_COMPOUND, nc_Unknown
}
 

Public Member Functions

 NcType ()
 
 NcType (std::string const myClassName, ncType const id)
 enumerated type value More...
 
 NcType (NcType const &rhs)
 
virtual ~NcType ()
 
NcTypeoperator= (NcType const &rhs)
 
bool operator== (NcType const &rhs) const
 
bool operator!= (NcType const &rhs) const
 
bool operator< (NcType const &rhs) const
 
ncType GetID () const
 
virtual std::string GetName () const
 
virtual size_t Size () const
 
virtual ncType getTypeClass () const
 
virtual ncType GetTypeClass () const
 
std::string const & getTypeClassName () const
 
std::string const & GetTypeClassName () const
 
bool IsNull () const
 

Protected Member Functions

void ErrorDimsAreZero (std::string const &className)
 
void ErrorArrayNcSizeMismatch (std::string const &className)
 

Protected Attributes

bool nullObject
 
std::string myName
 enumerated type name More...
 
ncType myID
 enumerated type value More...
 

Static Protected Attributes

static ncType const nullID = nc_NAT
 

Member Enumeration Documentation

List of netCDF types that can be represented. The enumeration list contains the complete set of netCDF variable types.

Enumerator
nc_NAT 

invalid type

nc_BYTE 

signed 1 byte integer

nc_CHAR 

ISO/ASCII character.

nc_SHORT 

signed 2 byte integer

nc_INT 

signed 4 byte integer

nc_FLOAT 

single precision floating point number

nc_DOUBLE 

double precision floating point number

nc_UBYTE 

unsigned 1 byte int

nc_USHORT 

unsigned 2-byte int

nc_UINT 

unsigned 4-byte int

nc_INT64 

signed 8-byte int

nc_UINT64 

unsigned 8-byte int

nc_STRING 

string

nc_VLEN 

"NcVlen type"

nc_OPAQUE 

"NcOpaque type"

nc_ENUM 

"NcEnum type"

nc_COMPOUND 

"NcCompound type"

nc_Unknown 

Constructor & Destructor Documentation

netcdf::NcType::NcType ( )

Constructor generates a null object.

netcdf::NcType::NcType ( std::string const  myClassName,
ncType const  id 
)

Constructor for a non-global type. This object describes the "essential" information for all netCDF types required by NcVar, NcAtt objects. New netCDF types can be added using the appropriate "add" method in the NcGroup object.

Parameters
grpParent NcGroup object.
idtype id
Parameters
myClassNameenumerated type name
netcdf::NcType::NcType ( NcType const &  rhs)
virtual netcdf::NcType::~NcType ( )
inlinevirtual

Member Function Documentation

void netcdf::NcType::ErrorArrayNcSizeMismatch ( std::string const &  className)
protected
void netcdf::NcType::ErrorDimsAreZero ( std::string const &  className)
protected
ncType netcdf::NcType::GetID ( ) const
inline
std::string netcdf::NcType::GetName ( ) const
virtual

The name of this type. For atomic types, the CDL type names are returned. Override for non-atomic types. Obtains the string from the netcdf file.

  • NcByte String returned is "byte".
  • NcUbyte String returned is "ubyte".
  • NcChar String returned is "char".
  • NcShort String returned is "short".
  • NcUshort String returned is "ushort".
  • NcInt String returned is "int".
  • NcUint String returned is "uint".
  • NcInt64 String returned is "int64".
  • NcUint64 String returned is "uint64".
  • NcFloat String returned is "float".
  • NcDouble String returned is "double".
  • NcString String returned is "string".

Reimplemented in netcdf::NcTypeUserDef.

NcType::ncType netcdf::NcType::getTypeClass ( ) const
virtual

The type class returned as enumeration type. Valid for all types, whether atomic or user-defined. User-defined types are returned as one of the following enumeration types: nc_VLEN, nc_OPAQUE, nc_ENUM, or nc_COMPOUND. Override for non-atomic types.

Deprecated:

Reimplemented in netcdf::NcTypeUserDef.

NcType::ncType netcdf::NcType::GetTypeClass ( ) const
virtual
std::string const& netcdf::NcType::getTypeClassName ( ) const
inline

Return a string containing the name of the enumerated type ncType: "nc_BYTE", "nc_CHAR", "nc_SHORT", "nc_INT", "nc_FLOAT", "nc_DOUBLE", "nc_UBYTE", "nc_USHORT", "nc_UINT", "nc_INT64", "nc_UINT64", "nc_STRING", "nc_VLEN", "nc_OPAQUE", "nc_ENUM", "nc_COMPOUND"

Deprecated:
std::string const& netcdf::NcType::GetTypeClassName ( ) const
inline
bool netcdf::NcType::IsNull ( ) const
inline
bool netcdf::NcType::operator!= ( NcType const &  rhs) const
inline
bool netcdf::NcType::operator< ( NcType const &  rhs) const
NcType & netcdf::NcType::operator= ( NcType const &  rhs)
bool netcdf::NcType::operator== ( NcType const &  rhs) const
size_t netcdf::NcType::Size ( ) const
virtual

The size in bytes. This function will work on any type, including atomic and any user defined type, whether compound, opaque, enumeration, or variable length array. Override for non-atomic types.

Reimplemented in netcdf::NcTypeUserDef.

Member Data Documentation

ncType netcdf::NcType::myID
protected
std::string netcdf::NcType::myName
protected
ncType const netcdf::NcType::nullID = nc_NAT
staticprotected
bool netcdf::NcType::nullObject
protected

The documentation for this class was generated from the following files: