NetCDF-C++
4.3.2
Toggle main menu visibility
Loading...
Searching...
No Matches
ncGroupAtt.cpp
1
#include "ncGroupAtt.h"
2
#include "ncGroup.h"
3
#include "ncCheck.h"
4
#include <netcdf.h>
5
using namespace
std;
6
7
8
namespace
netCDF
{
9
// Global comparator operator ==============
10
// comparator operator
11
bool
operator<
(
const
NcGroupAtt
& lhs,
const
NcGroupAtt
& rhs)
12
{
13
return
false
;
14
}
15
16
// comparator operator
17
bool
operator>
(
const
NcGroupAtt
& lhs,
const
NcGroupAtt
& rhs)
18
{
19
return
true
;
20
}
21
}
22
23
24
using namespace
netCDF
;
25
26
// assignment operator
27
NcGroupAtt
&
NcGroupAtt::operator=
(
const
NcGroupAtt
& rhs)
28
{
29
NcAtt::operator=
(rhs);
// assign base class parts
30
return
*
this
;
31
}
32
34
NcGroupAtt::NcGroupAtt
(
const
NcGroupAtt
& rhs):
35
NcAtt
(rhs)
// invoke base class copy constructor
36
{}
37
38
39
// Constructor generates a null object.
40
NcGroupAtt::NcGroupAtt
() :
41
NcAtt
()
// invoke base class constructor
42
{}
43
44
// equivalence operator (doesn't bother compaing varid's of each object).
45
bool
NcGroupAtt::operator==
(
const
NcGroupAtt
& rhs)
46
{
47
if
(nullObject)
48
return
nullObject == rhs.
isNull
();
49
else
50
return
myName == rhs.myName && groupId == rhs.groupId;
51
}
52
53
// Constructor for an existing global attribute.
54
NcGroupAtt::NcGroupAtt
(
const
NcGroup
& grp,
const
int
index):
55
NcAtt
(false)
56
{
57
groupId = grp.
getId
();
58
varId = NC_GLOBAL;
59
// get the name of this attribute
60
char
attName[NC_MAX_NAME+1];
61
ncCheck
(nc_inq_attname(groupId,varId, index, attName),__FILE__,__LINE__);
62
ncCheck
(nc_inq_attname(groupId,varId,index,attName),__FILE__,__LINE__);
63
myName = attName;
64
}
65
netCDF::NcAtt::operator=
NcAtt & operator=(const NcAtt &rhs)
assignment operator
Definition
ncAtt.cpp:14
netCDF::NcAtt::NcAtt
NcAtt()
Constructor generates a null object.
Definition
ncAtt.cpp:24
netCDF::NcAtt::isNull
bool isNull() const
Returns true if this object is null (i.e.
Definition
ncAtt.h:103
netCDF::NcGroupAtt::operator=
NcGroupAtt & operator=(const NcGroupAtt &rhs)
assignment operator
Definition
ncGroupAtt.cpp:27
netCDF::NcGroupAtt::operator==
bool operator==(const NcGroupAtt &rhs)
equivalence operator
Definition
ncGroupAtt.cpp:45
netCDF::NcGroupAtt::operator<
friend bool operator<(const NcGroupAtt &lhs, const NcGroupAtt &rhs)
comparator operator
Definition
ncGroupAtt.cpp:11
netCDF::NcGroupAtt::operator>
friend bool operator>(const NcGroupAtt &lhs, const NcGroupAtt &rhs)
comparator operator
Definition
ncGroupAtt.cpp:17
netCDF::NcGroupAtt::NcGroupAtt
NcGroupAtt()
Constructor generates a null object.
Definition
ncGroupAtt.cpp:40
netCDF::NcGroup
Class represents a netCDF group.
Definition
ncGroup.h:26
netCDF::NcGroup::getId
int getId() const
Gets the group id.
Definition
ncGroup.cpp:144
netCDF
C++ API for netCDF4.
Definition
ncAtt.h:10
netCDF::ncCheck
void ncCheck(int retCode, const char *file, int line)
Function checks error code and if necessary throws an exception.
Definition
ncCheck.cpp:11
Return to the Main Unidata NetCDF page.
Generated on
for NetCDF-C++. NetCDF is a
Unidata
library.