NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NcCompoundType.h
Go to the documentation of this file.
1 
16 #ifndef INC_netcdf_NcCompoundType_h
17 #define INC_netcdf_NcCompoundType_h
18 
19 #include "NcTypeUserDef.h"
20 #include <vector>
21 
22 namespace netcdf {
23  class NcGroup;
24 
29  {
30  public:
31 
33  NcCompoundType ();
34 
43  int const useFileID,
44  NcGroup const & grp,
45  std::string const name,
46  int const typeID);
47 
49  : NcTypeUserDef(rhs),
50  myOffset (rhs.myOffset)
51  {
52  }
53 
54  virtual std::string const getTypeClassName () const { return myTypeName; }
55 
63  void addMember(
64  std::string const memName,
65  NcType const & newMemberType,
66  size_t const offset);
67 
76  void addMember(
77  std::string const memName,
78  NcType const & newMemberType,
79  size_t const offset,
80  const std::vector<int>& shape);
81 
82 
84  size_t getMemberCount() const;
85 
87  NcType getMember(int const memberIndex) const;
88 
90  size_t getMemberOffset(const int index) const;
91 
97  int getMemberDimCount(int const memberIndex) const;
98 
104  std::vector<int> getMemberShape(int const memberIndex) const;
105 
107  bool operator==(NcCompoundType const & rhs) const;
108  bool operator!=(NcCompoundType const & rhs) const
109  {
110  return !(*this == rhs);
111  }
112 
113  private:
114 
115  static char const * const myTypeName;
116  int myOffset;
117 
118  };
119 
120 } // namespace netcdf
121 
122 
123 #endif
bool operator==(NcCompoundType const &rhs) const
Definition: NcCompoundType.cpp:61
size_t getMemberOffset(const int index) const
Definition: NcCompoundType.cpp:155
Defines a non-atomic, user-defined NetCDF4 type.
Definition: NcTypeUserDef.h:24
void addMember(std::string const memName, NcType const &newMemberType, size_t const offset)
Definition: NcCompoundType.cpp:72
NcCompoundType & operator=(NcCompoundType const &rhs)
Definition: NcCompoundType.cpp:54
NcType getMember(int const memberIndex) const
Definition: NcCompoundType.cpp:103
virtual std::string const getTypeClassName() const
Definition: NcCompoundType.h:54
std::vector< int > getMemberShape(int const memberIndex) const
Definition: NcCompoundType.cpp:145
NcCompoundType()
Definition: NcCompoundType.cpp:40
Represents a netCDF compound type.
Definition: NcCompoundType.h:28
bool operator!=(NcCompoundType const &rhs) const
Definition: NcCompoundType.h:108
int getMemberDimCount(int const memberIndex) const
Definition: NcCompoundType.cpp:136
size_t getMemberCount() const
Definition: NcCompoundType.cpp:95
Base class for all netCDF data types.
Definition: NcType.h:47
NcCompoundType(NcCompoundType const &rhs)
Definition: NcCompoundType.h:48
Represents a netCDF group.
Definition: NcGroup.h:36