NetCDF-C++
4.3.1-developer
|
Class represents a netCDF enum type. More...
#include "ncEnumType.h"
Public Types | |
enum | ncEnumType { nc_BYTE = NC_BYTE, nc_SHORT = NC_SHORT, nc_INT = NC_INT, nc_UBYTE = NC_UBYTE, nc_USHORT = NC_USHORT, nc_UINT = NC_UINT, nc_INT64 = NC_INT64, nc_UINT64 = NC_UINT64 } |
List of NetCDF-4 Enumeration types. More... | |
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 | |
NcEnumType () | |
Constructor generates a null object. More... | |
NcEnumType (const NcGroup &grp, const std::string &name) | |
Constructor. More... | |
NcEnumType (const NcType &ncType) | |
Constructor. More... | |
NcEnumType (const NcEnumType &rhs) | |
The copy constructor. More... | |
~NcEnumType () | |
Destructor. More... | |
template<class T > | |
void | addMember (const std::string &name, T memberValue) |
Adds a new member to this NcEnumType type. More... | |
NcType | getBaseType () const |
Returns the base type. More... | |
nc_type | getId () const |
The netCDF Id of this type. More... | |
size_t | getMemberCount () const |
Returns number of members in this NcEnumType object. More... | |
std::string | getMemberNameFromIndex (int index) const |
Returns the member name for the given zero-based index. More... | |
template<class T > | |
std::string | getMemberNameFromValue (const T memberValue) const |
Returns the member name for the given NcEnumType value. More... | |
template<class T > | |
void | getMemberValue (int index, T &memberValue) const |
Returns the value of a member with the given zero-based index. 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... | |
bool | isNull () const |
Returns true if this object is null (i.e. More... | |
bool | operator!= (const NcType &) const |
!= operator More... | |
NcEnumType & | operator= (const NcEnumType &rhs) |
assignment operator More... | |
NcEnumType & | operator= (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 |
Class represents a netCDF enum type.
Definition at line 15 of file ncEnumType.h.
List of NetCDF-4 Enumeration types.
Definition at line 20 of file ncEnumType.h.
|
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.
NcEnumType::NcEnumType | ( | ) |
Constructor generates a null object.
Definition at line 50 of file ncEnumType.cpp.
netCDF::NcEnumType::NcEnumType | ( | const NcGroup & | grp, |
const std::string & | name | ||
) |
NcEnumType::NcEnumType | ( | const NcType & | ncType | ) |
Constructor.
Constructs from the base type NcType object. Will throw an exception if the NcType is not the base of an Enum type.
ncType | A Nctype object. |
Definition at line 61 of file ncEnumType.cpp.
NcEnumType::NcEnumType | ( | const NcEnumType & | rhs | ) |
The copy constructor.
Definition at line 43 of file ncEnumType.cpp.
|
inline |
Destructor.
Definition at line 63 of file ncEnumType.h.
|
inline |
Adds a new member to this NcEnumType type.
name | Name for this new Enum memebr. |
memberValue | Member value, must be of the correct NcType. |
Definition at line 71 of file ncEnumType.h.
NcType NcEnumType::getBaseType | ( | ) | const |
Returns the base type.
Definition at line 69 of file ncEnumType.cpp.
|
inlineinherited |
size_t NcEnumType::getMemberCount | ( | ) | const |
Returns number of members in this NcEnumType object.
Definition at line 97 of file ncEnumType.cpp.
string NcEnumType::getMemberNameFromIndex | ( | int | index | ) | const |
Returns the member name for the given zero-based index.
Definition at line 107 of file ncEnumType.cpp.
|
inline |
Returns the member name for the given NcEnumType value.
Definition at line 83 of file ncEnumType.h.
|
inline |
Returns the value of a member with the given zero-based index.
name | Name for this new Enum member. |
memberValue | Member value, returned by this routine. |
Definition at line 94 of file ncEnumType.h.
|
inherited |
The name of this type.
For atomic types, the CDL type names are returned. These are as follows:
Definition at line 94 of file ncType.cpp.
|
inherited |
Gets parent group.
For an atomic type, returns a Null object.
Definition at line 89 of file ncType.cpp.
|
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.
|
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.
|
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.
|
inlineinherited |
|
inherited |
!= operator
Definition at line 83 of file ncType.cpp.
NcEnumType & NcEnumType::operator= | ( | const NcEnumType & | rhs | ) |
assignment operator
Definition at line 24 of file ncEnumType.cpp.
NcEnumType & NcEnumType::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 Enum type.
Definition at line 31 of file ncEnumType.cpp.
|
inherited |
equivalence operator
Definition at line 74 of file ncType.cpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |