NetCDF-C++ 4.3.1
ncDim.h
1#include <string>
2#include "netcdf.h"
3
4#ifndef NcDimClass
5#define NcDimClass
6
7
8namespace netCDF
9{
10 class NcGroup; // forward declaration.
11
13 class NcDim {
14
15 public:
16
18 ~NcDim(){};
19
21 NcDim ();
22
29 NcDim(const NcGroup& grp, int dimId);
30
32 NcDim& operator =(const NcDim &);
33
35 bool operator==(const NcDim& rhs) const;
36
38 bool operator!=(const NcDim& rhs) const;
39
41 NcDim(const NcDim& ncDim);
42
44 std::string getName() const;
45
47 int getId() const {return myId;};
48
50 NcGroup getParentGroup() const;
51
53 bool isUnlimited() const;
54
56 size_t getSize() const;
57
59 void rename( const std::string& newName);
60
62 bool isNull() const {return nullObject;}
63
65 friend bool operator<(const NcDim& lhs,const NcDim& rhs);
66
68 friend bool operator>(const NcDim& lhs,const NcDim& rhs);
69
70 private:
71
72 bool nullObject;
73
74 int myId;
75
76 int groupId;
77
78 };
79
80}
81
82
83#endif
Class represents a netCDF dimension.
Definition: ncDim.h:13
friend bool operator<(const NcDim &lhs, const NcDim &rhs)
comparator operator
Definition: ncDim.cpp:11
friend bool operator>(const NcDim &lhs, const NcDim &rhs)
comparator operator
Definition: ncDim.cpp:17
std::string getName() const
The name of this dimension.
Definition: ncDim.cpp:106
size_t getSize() const
The size of the dimension; for unlimited, this is the number of records written so far.
Definition: ncDim.cpp:77
bool isUnlimited() const
Returns true if this is an unlimited dimension.
Definition: ncDim.cpp:86
bool isNull() const
Returns true if this object is null (i.e.
Definition: ncDim.h:62
bool operator!=(const NcDim &rhs) const
!= operator
Definition: ncDim.cpp:52
NcGroup getParentGroup() const
Gets a NcGroup object of the parent group.
Definition: ncDim.cpp:59
NcDim & operator=(const NcDim &)
assignment operator
Definition: ncDim.cpp:26
int getId() const
The netCDF Id of this dimension.
Definition: ncDim.h:47
bool operator==(const NcDim &rhs) const
equivalence operator
Definition: ncDim.cpp:43
void rename(const std::string &newName)
renames the dimension
Definition: ncDim.cpp:114
~NcDim()
destructor
Definition: ncDim.h:18
NcDim()
Constructor generates a null object.
Definition: ncDim.cpp:64
Class represents a netCDF group.
Definition: ncGroup.h:28
C++ API for netCDF4.
Definition: ncAtt.h:10

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