NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MetadataCFVariable.h
Go to the documentation of this file.
1 
15 #ifndef INC_netCDF_MetadataCFVariable_h
16 #define INC_netCDF_MetadataCFVariable_h
17 
18 #include <string>
19 
20 namespace netcdf {
21 
22 template< typename TNumeric >
24 {
25  public:
26 
27  std::string
29  standardName,
30  units;
31  TNumeric
33  validMax,
34  fillValue;
35  std::string
37 
39  : validMin (0),
40  validMax (0),
41  fillValue (0)
42  {
43  }
44 
46  {
47  Copy(rhs);
48  }
49 
51  {
52  Copy(rhs);
53  return *this;
54  }
55 
56  bool operator== (MetadataCFVariable const & rhs) const;
57  bool operator!= (MetadataCFVariable const & rhs) const
58  { return !operator==(rhs); }
59 
60  void Clear ();
61 
62  private:
63 
64  void Copy (MetadataCFVariable const & rhs);
65 
66 };
67 
68 
69 template< typename TNumeric >
71 {
72  return (
73  longName == rhs.longName &&
74  standardName == rhs.standardName &&
75  units == rhs.units &&
76  validMin == rhs.validMin &&
77  validMax == rhs.validMax &&
78  fillValue == rhs.fillValue &&
79  encoding == rhs.encoding );
80 }
81 
82 
83 template< typename TNumeric >
85 {
86  longName = rhs.longName;
87  standardName = rhs.standardName;
88  units = rhs.units;
89  validMin = rhs.validMin;
90  validMax = rhs.validMax;
91  fillValue = rhs.fillValue;
92  encoding = rhs.encoding;
93 }
94 
95 
96 template< typename TNumeric >
98 {
99  longName.clear();
100  standardName.clear();
101  units.clear();
102  validMin = validMax = fillValue = 0;
103  encoding.clear();
104 }
105 
106 
107 } // namespace netcdf
108 
109 #endif // INC_netCDF_MetadataCFVariable_h
MetadataCFVariable(MetadataCFVariable const &rhs)
Definition: MetadataCFVariable.h:45
TNumeric fillValue
_FillValue : matching type
Definition: MetadataCFVariable.h:32
std::string encoding
_Encoding : string
Definition: MetadataCFVariable.h:36
void Clear()
Definition: MetadataCFVariable.h:97
std::string units
units : string
Definition: MetadataCFVariable.h:28
MetadataCFVariable & operator=(MetadataCFVariable const &rhs)
Definition: MetadataCFVariable.h:50
bool operator!=(MetadataCFVariable const &rhs) const
Definition: MetadataCFVariable.h:57
std::string longName
long_name : string
Definition: MetadataCFVariable.h:28
TNumeric validMin
valid_min : numeric type
Definition: MetadataCFVariable.h:32
TNumeric validMax
valid_max : numeric type
Definition: MetadataCFVariable.h:32
std::string standardName
standard_name : string
Definition: MetadataCFVariable.h:28
MetadataCFVariable()
Definition: MetadataCFVariable.h:38
bool operator==(MetadataCFVariable const &rhs) const
Definition: MetadataCFVariable.h:70
Class managing variable metadata that conform to netCDF CF conventions. A typical set of attributes a...
Definition: MetadataCFVariable.h:23