NetCDF-C++  4.3.1-developer
ncCompoundType.h
1 #include <string>
2 #include <vector>
3 #include "ncType.h"
4 #include "netcdf.h"
5 
6 #ifndef NcCompoundTypeClass
7 #define NcCompoundTypeClass
8 
9 
10 namespace netCDF
11 {
12  class NcGroup; // forward declaration.
13 
17  class NcCompoundType : public NcType
18  {
19  public:
20 
23 
31  NcCompoundType(const NcGroup& grp, const std::string& name);
32 
39 
42 
47  NcCompoundType& operator=(const NcType& rhs);
48 
50  NcCompoundType(const NcCompoundType& rhs);
51 
53  bool operator==(const NcCompoundType & rhs);
54 
57 
58 
66  void addMember(const std::string& memName, const NcType& newMemberType,size_t offset);
67 
76  void addMember(const std::string& memName, const NcType& newMemberType, size_t offset, const std::vector<int>& shape);
77 
78 
80  size_t getMemberCount() const;
81 
83  NcType getMember(int memberIndex) const;
84 
86  std::string getMemberName(int memberIndex) const;
87 
89  int getMemberIndex(const std::string& memberName) const;
90 
92  size_t getMemberOffset(const int index) const;
93 
99  int getMemberDimCount(int memberIndex) const;
100 
101 
107  std::vector<int> getMemberShape(int memberIndex) const;
108 
109 
110  private:
111 
112  int myOffset;
113 
114  };
115 
116 }
117 
118 
119 #endif
~NcCompoundType()
destructor
Base class inherited by NcOpaque, NcVlen, NcCompound and NcEnum classes.
Definition: ncType.h:14
NcCompoundType & operator=(const NcCompoundType &rhs)
assignment operator
size_t getMemberCount() const
Returns number of members in this NcCompoundType object.
C++ API for netCDF4.
Definition: ncAtt.h:9
std::string getMemberName(int memberIndex) const
Returns name of member field.
Class represents a netCDF compound type.
Class represents a netCDF group.
Definition: ncGroup.h:27
ncType
List of netCDF types that can be represented.
Definition: ncType.h:25
NcType getMember(int memberIndex) const
Returns a NcType object for a single member.
std::vector< int > getMemberShape(int memberIndex) const
Returns the shape of a given member.
bool operator==(const NcCompoundType &rhs)
equivalence operator
size_t getMemberOffset(const int index) const
Returns the offset of the member with given index.
int getMemberDimCount(int memberIndex) const
Returns the number of dimensions of a member with the given index.
NcCompoundType()
Constructor generates a null object.
int getMemberIndex(const std::string &memberName) const
Returns index of named member field.
void addMember(const std::string &memName, const NcType &newMemberType, size_t offset)
Adds a named field.

Return to the Main Unidata NetCDF page.
Generated on Fri Nov 11 2016 15:28:29 for NetCDF-C++. NetCDF is a Unidata library.