NetCDF-C++ 4.3.1
netCDF::NcOpaqueType Class Reference

Class represents a netCDF opaque type. More...

#include "ncOpaqueType.h"

Inheritance diagram for netCDF::NcOpaqueType:
netCDF::NcType

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
}
 List of netCDF types that can be represented. More...
 

Public Member Functions

 NcOpaqueType ()
 Constructor generates a null object. More...
 
 NcOpaqueType (const NcGroup &grp, const std::string &name)
 Constructor. More...
 
 NcOpaqueType (const NcOpaqueType &rhs)
 The copy constructor. More...
 
 NcOpaqueType (const NcType &ncType)
 Constructor. More...
 
 ~NcOpaqueType ()
 destructor More...
 
nc_type getId () const
 The netCDF Id of this type. More...
 
std::string getName () const
 The name of this type. More...
 
netCDF::NcGroup getParentGroup () const
 Gets parent group. More...
 
size_t getSize () const
 The size in bytes. More...
 
ncType getTypeClass () const
 The type class returned as enumeration type. More...
 
std::string getTypeClassName () const
 Return a string containing the name of the enumerated type. More...
 
size_t getTypeSize () const
 Returns the size of the opaque type in bytes. More...
 
bool isNull () const
 Returns true if this object is null (i.e. More...
 
bool operator!= (const NcType &) const
 != operator More...
 
NcOpaqueTypeoperator= (const NcOpaqueType &rhs)
 assignment operator More...
 
NcOpaqueTypeoperator= (const NcType &rhs)
 Assignment operator. More...
 
bool operator== (const NcType &) const
 equivalence operator More...
 

Protected Attributes

int g_fileId
 An ncid associated with a particular open file (returned from nc_open). More...
 
int groupId
 the group Id More...
 
nc_type myId
 the type Id More...
 
bool nullObject
 

Detailed Description

Class represents a netCDF opaque type.

Definition at line 14 of file ncOpaqueType.h.

Member Enumeration Documentation

◆ ncType

enum netCDF::NcType::ncType
inherited

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"

Definition at line 25 of file ncType.h.

Constructor & Destructor Documentation

◆ NcOpaqueType() [1/4]

NcOpaqueType::NcOpaqueType ( )

Constructor generates a null object.

Definition at line 41 of file ncOpaqueType.cpp.

◆ NcOpaqueType() [2/4]

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

Constructor.

The opaque Type must already exist in the netCDF file. New netCDF opaque types # can be added using NcGroup::addNcOpaqueType();

Parameters
grpThe parent group where this type is defined.
nameName of new type.

◆ NcOpaqueType() [3/4]

NcOpaqueType::NcOpaqueType ( const NcType ncType)

Constructor.

Constructs from the base type NcType object. Will throw an exception if the NcType is not the base of a Opaque type.

Parameters
ncTypeA Nctype object.

Definition at line 53 of file ncOpaqueType.cpp.

◆ NcOpaqueType() [4/4]

NcOpaqueType::NcOpaqueType ( const NcOpaqueType rhs)

The copy constructor.

Definition at line 34 of file ncOpaqueType.cpp.

◆ ~NcOpaqueType()

netCDF::NcOpaqueType::~NcOpaqueType ( )
inline

destructor

Definition at line 50 of file ncOpaqueType.h.

Member Function Documentation

◆ getId()

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

The netCDF Id of this type.

Definition at line 88 of file ncType.h.

◆ getName()

string NcType::getName ( ) const
inherited

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

Definition at line 94 of file ncType.cpp.

◆ getParentGroup()

NcGroup NcType::getParentGroup ( ) const
inherited

Gets parent group.

For an atomic type, returns a Null object.

Definition at line 89 of file ncType.cpp.

◆ getSize()

size_t NcType::getSize ( ) const
inherited

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.

Definition at line 108 of file ncType.cpp.

◆ getTypeClass()

NcType::ncType NcType::getTypeClass ( ) const
inherited

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.

Definition at line 116 of file ncType.cpp.

◆ getTypeClassName()

string NcType::getTypeClassName ( ) const
inherited

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"

Definition at line 144 of file ncType.cpp.

◆ getTypeSize()

size_t NcOpaqueType::getTypeSize ( ) const

Returns the size of the opaque type in bytes.

Definition at line 61 of file ncOpaqueType.cpp.

◆ isNull()

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

Returns true if this object is null (i.e.

it has no contents); otherwise returns false.

Definition at line 133 of file ncType.h.

◆ operator!=()

bool NcType::operator!= ( const NcType rhs) const
inherited

!= operator

Definition at line 83 of file ncType.cpp.

◆ operator=() [1/2]

NcOpaqueType & NcOpaqueType::operator= ( const NcOpaqueType rhs)

assignment operator

Definition at line 14 of file ncOpaqueType.cpp.

◆ operator=() [2/2]

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

Assignment operator.

This assigns from the base type NcType object. Will throw an exception if the NcType is not the base of an Opaque type.

Definition at line 22 of file ncOpaqueType.cpp.

◆ operator==()

bool NcType::operator== ( const NcType rhs) const
inherited

equivalence operator

Definition at line 74 of file ncType.cpp.

Field Documentation

◆ g_fileId

int netCDF::NcType::g_fileId
protectedinherited

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

Definition at line 158 of file ncType.h.

◆ groupId

int netCDF::NcType::groupId
protectedinherited

the group Id

Definition at line 152 of file ncType.h.

◆ myId

nc_type netCDF::NcType::myId
protectedinherited

the type Id

Definition at line 149 of file ncType.h.

◆ nullObject

bool netCDF::NcType::nullObject
protectedinherited

Definition at line 146 of file ncType.h.


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

Return to the Main Unidata NetCDF page.
Generated on Wed Nov 10 2021 15:25:08 for NetCDF-C++. NetCDF is a Unidata library.