NetCDF-C++
4.3.2
Toggle main menu visibility
Loading...
Searching...
No Matches
ncType.h
1
#include <string>
2
#include "netcdf.h"
3
4
#ifndef NcTypeClass
5
#define NcTypeClass
6
7
8
namespace
netCDF
9
{
10
11
class
NcGroup
;
// forward declaration to avoid cyclic reference.
12
14
class
NcType
15
{
16
17
public
:
18
25
enum
ncType
26
{
27
nc_BYTE
= NC_BYTE,
28
nc_CHAR
= NC_CHAR,
29
nc_SHORT
= NC_SHORT,
30
nc_INT
= NC_INT,
31
nc_FLOAT
= NC_FLOAT,
32
nc_DOUBLE
= NC_DOUBLE,
33
nc_UBYTE
= NC_UBYTE,
34
nc_USHORT
= NC_USHORT,
35
nc_UINT
= NC_UINT,
36
nc_INT64
= NC_INT64,
37
nc_UINT64
= NC_UINT64,
38
nc_STRING
= NC_STRING,
39
nc_VLEN
= NC_VLEN,
40
nc_OPAQUE
= NC_OPAQUE,
41
nc_ENUM
= NC_ENUM,
42
nc_COMPOUND
= NC_COMPOUND
43
};
44
46
NcType
();
47
55
NcType
(
const
netCDF::NcGroup
& grp,
const
std::string& name);
56
57
65
NcType
(
const
netCDF::NcGroup
& grp, nc_type
id
);
66
72
NcType
(nc_type
id
);
73
75
NcType
(
const
NcType
& rhs);
76
78
virtual
~NcType
() {}
79
81
bool
operator==
(
const
NcType
&)
const
;
82
84
bool
operator!=
(
const
NcType
&)
const
;
85
86
// accessors to private data.
88
nc_type
getId
()
const
{
return
myId
;}
89
91
netCDF::NcGroup
getParentGroup
()
const
;
92
108
std::string
getName
()
const
;
109
116
size_t
getSize
()
const
;
117
123
ncType
getTypeClass
()
const
;
124
130
std::string
getTypeClassName
()
const
;
131
133
bool
isNonPrimitive
()
const
;
134
136
bool
isNull
()
const
{
return
nullObject;}
137
139
friend
bool
operator<(
const
NcType
& lhs,
const
NcType
& rhs);
140
142
friend
bool
operator>(
const
NcType
& lhs,
const
NcType
& rhs);
143
144
protected
:
145
147
NcType
&
operator=
(
const
NcType
& rhs);
148
149
bool
nullObject;
150
152
nc_type
myId
;
153
155
int
groupId
;
156
161
int
g_fileId
;
162
163
};
164
165
}
166
#endif
netCDF::NcGroup
Class represents a netCDF group.
Definition
ncGroup.h:26
netCDF::NcType
Base class inherited by NcOpaque, NcVlen, NcCompound and NcEnum classes.
Definition
ncType.h:15
netCDF::NcType::groupId
int groupId
the group Id
Definition
ncType.h:155
netCDF::NcType::getTypeClass
ncType getTypeClass() const
The type class returned as enumeration type.
Definition
ncType.cpp:111
netCDF::NcType::getParentGroup
netCDF::NcGroup getParentGroup() const
Gets parent group.
Definition
ncType.cpp:88
netCDF::NcType::NcType
NcType()
Constructor generates a null object.
Definition
ncType.cpp:43
netCDF::NcType::getSize
size_t getSize() const
The size in bytes.
Definition
ncType.cpp:103
netCDF::NcType::operator==
bool operator==(const NcType &) const
equivalence operator
Definition
ncType.cpp:73
netCDF::NcType::myId
nc_type myId
the type Id
Definition
ncType.h:152
netCDF::NcType::getTypeClassName
std::string getTypeClassName() const
Return a string containing the name of the enumerated type.
Definition
ncType.cpp:139
netCDF::NcType::NcType
NcType(const netCDF::NcGroup &grp, const std::string &name)
Constructor for a non-global type.
netCDF::NcType::isNonPrimitive
bool isNonPrimitive() const
Return true if this is not a primitive type.
Definition
ncType.cpp:163
netCDF::NcType::operator=
NcType & operator=(const NcType &rhs)
assignment operator
Definition
ncType.cpp:26
netCDF::NcType::ncType
ncType
List of netCDF types that can be represented.
Definition
ncType.h:26
netCDF::NcType::nc_DOUBLE
@ nc_DOUBLE
double precision floating point number
Definition
ncType.h:32
netCDF::NcType::nc_UBYTE
@ nc_UBYTE
unsigned 1 byte int
Definition
ncType.h:33
netCDF::NcType::nc_OPAQUE
@ nc_OPAQUE
"NcOpaque type"
Definition
ncType.h:40
netCDF::NcType::nc_CHAR
@ nc_CHAR
ISO/ASCII character.
Definition
ncType.h:28
netCDF::NcType::nc_SHORT
@ nc_SHORT
signed 2 byte integer
Definition
ncType.h:29
netCDF::NcType::nc_BYTE
@ nc_BYTE
signed 1 byte integer
Definition
ncType.h:27
netCDF::NcType::nc_UINT64
@ nc_UINT64
unsigned 8-byte int
Definition
ncType.h:37
netCDF::NcType::nc_VLEN
@ nc_VLEN
"NcVlen type"
Definition
ncType.h:39
netCDF::NcType::nc_UINT
@ nc_UINT
unsigned 4-byte int
Definition
ncType.h:35
netCDF::NcType::nc_INT
@ nc_INT
signed 4 byte integer
Definition
ncType.h:30
netCDF::NcType::nc_ENUM
@ nc_ENUM
"NcEnum type"
Definition
ncType.h:41
netCDF::NcType::nc_STRING
@ nc_STRING
string
Definition
ncType.h:38
netCDF::NcType::nc_INT64
@ nc_INT64
signed 8-byte int
Definition
ncType.h:36
netCDF::NcType::nc_USHORT
@ nc_USHORT
unsigned 2-byte int
Definition
ncType.h:34
netCDF::NcType::nc_FLOAT
@ nc_FLOAT
single precision floating point number
Definition
ncType.h:31
netCDF::NcType::nc_COMPOUND
@ nc_COMPOUND
"NcCompound type"
Definition
ncType.h:42
netCDF::NcType::getName
std::string getName() const
The name of this type.
Definition
ncType.cpp:93
netCDF::NcType::isNull
bool isNull() const
Returns true if this object is null (i.e.
Definition
ncType.h:136
netCDF::NcType::operator!=
bool operator!=(const NcType &) const
!= operator
Definition
ncType.cpp:82
netCDF::NcType::getId
nc_type getId() const
The netCDF Id of this type.
Definition
ncType.h:88
netCDF::NcType::~NcType
virtual ~NcType()
destructor
Definition
ncType.h:78
netCDF::NcType::g_fileId
int g_fileId
An ncid associated with a particular open file (returned from nc_open).
Definition
ncType.h:161
netCDF
C++ API for netCDF4.
Definition
ncAtt.h:10
Return to the Main Unidata NetCDF page.
Generated on
for NetCDF-C++. NetCDF is a
Unidata
library.