NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NcTypeUserDef.h
Go to the documentation of this file.
1 
16 #ifndef INC_netcdf_NcTypeUserDef_h
17 #define INC_netcdf_NcTypeUserDef_h
18 
19 #include "NcType.h"
20 #include "NcTypeV4.h"
21 
22 namespace netcdf {
23 
25  : public NcType,
26  public NcTypeV4
27 {
28  public:
29 
30  //~ NcTypeUserDef () ///< null object
31  //~ : NcType(), NcTypeV4()
32  //~ {
33  //~ }
34 
35  //~ NcTypeUserDef (
36  //~ int const useFileID, ///< netCDF file ID number
37  //~ NcGroup const & grp, ///< group ID number
38  //~ std::string const & grpName); ///< type name
39 
41  int const useFileID,
42  NcGroup const & grp,
43  std::string const & myClassName,
44  ncType const classTypeID,
45  int const typeID);
46 
48  : NcType( rhs ),
49  NcTypeV4( rhs )
50  {
51  Copy (rhs);
52  }
53 
54  int GetFileID() const { return fileID; }
55  int GetGroupID () const { return groupID; }
56  int GetTypeID () const { return ncTypeID; }
57  virtual std::string GetName () const;
58  virtual size_t Size () const;
59  NcGroup GetParentGroup() const;
60 
61  virtual ncType getTypeClass () const;
62  virtual std::string const getTypeClassName () const
63  { return std::string(); /* no-op */ };
64 
66  bool operator== (NcTypeUserDef const & rhs) const;
67  bool operator!= (const NcTypeUserDef & rhs) const
68  {return !operator==(rhs);}
69  bool operator< (NcTypeUserDef const & rhs) const;
70 
71  private:
72 
73  int fileID;
74  int groupID;
75  int ncTypeID;
76 
77  void Copy ( NcTypeUserDef const & rhs )
78  {
79  fileID = rhs.fileID;
80  groupID = rhs.groupID;
81  ncTypeID = rhs.ncTypeID;
82  }
83 
84 };
85 
86 } // namespace netcdf
87 
88 #endif // INC_netcdf_NcTypeUserDef_h
NcTypeUserDef(int const useFileID, NcGroup const &grp, std::string const &myClassName, ncType const classTypeID, int const typeID)
ID returned by &quot;nc_def*&quot;.
Definition: NcTypeUserDef.cpp:40
ncType
Definition: NcType.h:56
NcGroup GetParentGroup() const
parent group
Definition: NcTypeUserDef.cpp:92
virtual std::string GetName() const
name of this type
Definition: NcTypeUserDef.cpp:54
Defines a non-atomic, user-defined NetCDF4 type.
Definition: NcTypeUserDef.h:24
Class associated with netCDF version 4 data types.
Definition: NcTypeV4.h:21
virtual size_t Size() const
size of type in bytes
Definition: NcTypeUserDef.cpp:63
int GetGroupID() const
group ID
Definition: NcTypeUserDef.h:55
bool operator!=(const NcTypeUserDef &rhs) const
Definition: NcTypeUserDef.h:67
NcTypeUserDef(NcTypeUserDef const &rhs)
Definition: NcTypeUserDef.h:47
int GetTypeID() const
type ID from nc_def*
Definition: NcTypeUserDef.h:56
bool operator==(NcTypeUserDef const &rhs) const
Definition: NcTypeUserDef.cpp:111
int GetFileID() const
file ID
Definition: NcTypeUserDef.h:54
virtual ncType getTypeClass() const
return enum ncType
Definition: NcTypeUserDef.cpp:72
bool operator<(NcTypeUserDef const &rhs) const
Definition: NcTypeUserDef.cpp:119
virtual std::string const getTypeClassName() const
Definition: NcTypeUserDef.h:62
Base class for all netCDF data types.
Definition: NcType.h:47
Represents a netCDF group.
Definition: NcGroup.h:36
NcTypeUserDef & operator=(NcTypeUserDef const &rhs)
Definition: NcTypeUserDef.cpp:104