netCDF::NcType Class Reference

`#include <ncType.h>`

Inheritance diagram for netCDF::NcType:
[legend]

## Public Types

enum | ncType { 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 }

## Public Member Functions

nc_type | getId () const
std::string | getName () const
netCDF::NcGroup | getParentGroup () const
size_t | getSize () const
ncType | getTypeClass () const
std::string | getTypeClassName () const
bool | isNull () const
| NcType ()
| NcType (const NcType &rhs)
| NcType (const netCDF::NcGroup &grp, const std::string &name)
| NcType (const netCDF::NcGroup &grp, nc_type id)
| NcType (nc_type id)
bool | operator!= (const NcType &) const
bool | operator== (const NcType &) const
virtual | ~NcType ()

## Protected Member Functions

NcType & | operator= (const NcType &rhs)

## Protected Attributes

int | g_fileId
int | groupId
nc_type | myId

## Friends

bool | operator< (const NcType &lhs, const NcType &rhs)
bool | operator> (const NcType &lhs, const NcType &rhs)

## Detailed Description

Base class inherited by NcOpaque, NcVlen, NcCompound and NcEnum classes.

## Member Enumeration Documentation

## ncType

enum netCDF::NcType::ncType

List of netCDF types that can be represented. The enumeration list contains the complete set of netCDF variable types. In addition, the type NC_TYPE is included. This enables the user to instantiate a netCDF type object without explcitly needing to know it precise type.

Enumerator
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"

## Constructor & Destructor Documentation

## NcType() [1/5]

NcType::NcType | ( |  | ) |

Constructor generates a null object.

## NcType() [2/5]

netCDF::NcType::NcType | ( | const netCDF::NcGroup & | grp,
|  | const std::string & | name )

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

  grp | Parent NcGroup object.
  name | Name of this type.

## NcType() [3/5]

NcType::NcType | ( | const netCDF::NcGroup & | grp,
|  | nc_type | 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

  grp | Parent NcGroup object.
  id | type id

## NcType() [4/5]

NcType::NcType | ( | nc_type | id | ) |

Constructor for a global type This object describes the "essential" information for a netCDF global type.

Parameters

  id | type id

## NcType() [5/5]

NcType::NcType | ( | const NcType & | rhs | ) |

The copy constructor.

## ~NcType()

virtual netCDF::NcType::~NcType | ( |  | ) |

inline virtual

destructor

## Member Function Documentation

## getId()

nc_type netCDF::NcType::getId | ( |  | ) | const

inline

The netCDF Id of this type.

## getName()

string NcType::getName | ( |  | ) | const

The name of this type. For atomic types, the CDL type names are returned. These are as follows:

- 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".

## getParentGroup()

NcGroup NcType::getParentGroup | ( |  | ) | const

Gets parent group. For an atomic type, returns a Null object.

## getSize()

size_t NcType::getSize | ( |  | ) | const

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.

## getTypeClass()

NcType::ncType NcType::getTypeClass | ( |  | ) | const

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.

## getTypeClassName()

string NcType::getTypeClassName | ( |  | ) | const

Return a string containing the name of the enumerated type. (ie one of the following strings: "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"

## isNull()

bool netCDF::NcType::isNull | ( |  | ) | const

inline

Returns true if this object is null (i.e. it has no contents); otherwise returns false.

## operator!=()

bool NcType::operator!= | ( | const NcType & | rhs | ) | const

!= operator

## operator=()

NcType & NcType::operator= | ( | const NcType & | rhs | ) |

protected

assignment operator

## operator==()

bool NcType::operator== | ( | const NcType & | rhs | ) | const

equivalence operator

## Friends And Related Symbol Documentation

## operator<

bool operator< | ( | const NcType & | lhs,
|  | const NcType & | rhs )

friend

comparator operator

## operator>

bool operator> | ( | const NcType & | lhs,
|  | const NcType & | rhs )

friend

comparator operator

## Member Data Documentation

## g_fileId

int netCDF::NcType::g_fileId

protected

An ncid associated with a particular open file (returned from nc_open). This is required by many of the functions ncType uses, such as nc_inq_type

## groupId

int netCDF::NcType::groupId

protected

the group Id

## myId

nc_type netCDF::NcType::myId

protected

the type Id

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

- ncType.h
- ncType.cpp