NetCDF-C++ 4.3.1
ncAtt.h
1#include "ncType.h"
2#include "ncException.h"
3#include <string>
4#include <typeinfo>
5
6#ifndef NcAttClass
7#define NcAttClass
8
9namespace netCDF
10{
11
13 class NcAtt
14 {
15 public:
16
18 virtual ~NcAtt()=0;
19
21 NcAtt ();
22
24 NcAtt(bool nullObject);
25
27 NcAtt(const NcAtt& rhs);
28
30 std::string getName() const {return myName;}
31
33 size_t getAttLength() const;
34
36 NcType getType() const;
37
39 NcGroup getParentGroup() const;
40
42 bool operator== (const NcAtt& rhs) const;
43
45 bool operator!=(const NcAtt& rhs) const;
46
49 void getValues(char* dataValues) const;
52 void getValues(unsigned char* dataValues) const;
55 void getValues(signed char* dataValues) const;
58 void getValues(short* dataValues) const;
61 void getValues(int* dataValues) const;
64 void getValues(long* dataValues) const;
67 void getValues(float* dataValues) const;
70 void getValues(double* dataValues) const;
73 void getValues(unsigned short* dataValues) const;
76 void getValues(unsigned int* dataValues) const;
79 void getValues(long long* dataValues) const;
82 void getValues(unsigned long long* dataValues) const;
85 void getValues(char** dataValues) const;
86
90 void getValues(std::string& dataValues) const;
91
100 void getValues(void* dataValues) const;
101
103 bool isNull() const {return nullObject;}
104
105 protected:
107 NcAtt& operator= (const NcAtt& rhs);
108
109 bool nullObject;
110
111 std::string myName;
112
113 int groupId;
114
115 int varId;
116
117 };
118
119}
120
121#endif
Abstract base class represents inherited by ncVarAtt and ncGroupAtt.
Definition: ncAtt.h:14
void getValues(std::string &dataValues) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator!=(const NcAtt &rhs) const
!= operator
Definition: ncAtt.cpp:52
std::string getName() const
Get the attribute name.
Definition: ncAtt.h:30
NcAtt & operator=(const NcAtt &rhs)
assignment operator
Definition: ncAtt.cpp:14
NcAtt()
Constructor generates a null object.
Definition: ncAtt.cpp:24
size_t getAttLength() const
Gets attribute length.
Definition: ncAtt.cpp:87
bool operator==(const NcAtt &rhs) const
equivalence operator
Definition: ncAtt.cpp:43
bool isNull() const
Returns true if this object is null (i.e.
Definition: ncAtt.h:103
virtual ~NcAtt()=0
destructor
Definition: ncAtt.cpp:11
NcType getType() const
Returns the attribute type.
Definition: ncAtt.cpp:64
void getValues(char *dataValues) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ncAtt.cpp:110
NcGroup getParentGroup() const
Gets parent group.
Definition: ncAtt.cpp:58
Class represents a netCDF group.
Definition: ncGroup.h:28
Base class inherited by NcOpaque, NcVlen, NcCompound and NcEnum classes.
Definition: ncType.h:15
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.