NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NcChar.h
Go to the documentation of this file.
1 
16 #ifndef INC_netcdf_NcChar_h
17 #define INC_netcdf_NcChar_h
18 
19 #include "NcType.h"
20 
21 namespace netcdf {
22 
23  class NcChar : public NcType
24  {
25  public:
26  typedef char value_type;
27  typedef std::vector<value_type> vector_type;
28 
29  NcChar();
30 
31  static value_type FillValue () { return fillValue; }
32  static value_type MinValue () { return minValue; }
33  static value_type MaxValue () { return maxValue; }
34  static std::size_t SizeOf () { return sizeof(value_type); }
35 
36  void Get (
37  int const groupID,
38  int const varID,
39  char** & data);
40 
41  void Get (
42  int const groupID,
43  int const varID,
44  std::vector<std::string> & data);
45 
46  void Get (
47  int const groupID,
48  int const varID,
49  vector_type & data);
50 
51 // void Get ( ///< read a single value at indices
52 // int const groupID, ///< group ID
53 // int const varID, ///< variable ID
54 // TVecIndex const & indices, ///< indices at which to read
55 // value_type & data); ///< receives value
56 
57  void Get (
58  int const groupID,
59  int const varID,
60  TVecIndex const & indices,
61  std::string & data);
62 
63  void Get (
64  int const groupID,
65  int const varID,
66  std::size_t const start,
67  std::size_t const count,
68  char** & data);
69 
70  void Get (
71  int const groupID,
72  int const varID,
73  std::size_t const start,
74  std::size_t const count,
75  std::vector<std::string> & data);
76 
77  void Get (
78  int const groupID,
79  int const varID,
80  TVecIndex const & start,
81  TVecIndex const & count,
82  vector_type & data);
83 
84 // void Get ( ///< read a subsampled (strided) section
85 // int const groupID, ///< group ID
86 // int const varID, ///< variable ID
87 // TVecIndex const & start, ///< zero-based index to start reading
88 // TVecIndex const & count, ///< count along each dimension (>= 1)
89 // TVecStride const & stride, ///< interval along each dimension
90 // vector_type & data); ///< vector to receive data values
91 
92 // void Get ( ///< read a mapped array section
93 // int const groupID, ///< group ID
94 // int const varID, ///< variable ID
95 // TVecIndex const & start, ///< zero-based index to start reading
96 // TVecIndex const & count, ///< count along each dimension (>= 1)
97 // TVecStride const & stride, ///< interval along each dimension
98 // TVecStride const & imap, ///< mapping intervals for each dimension (see NetCDF doc)
99 // vector_type & data); ///< vector to receive data values
100 
101  void Put (
102  int const groupID,
103  int const varID,
104  vector_type const & data);
105 
106 // void Put ( ///< write an array of values
107 // int const groupID, ///< group ID
108 // int const varID, ///< variable ID
109 // TVecIndex const & indices, ///< indices at which to write
110 // value_type const & data); ///< value to write
111 
112  void Put (
113  int const groupID,
114  int const varID,
115  TVecIndex const & start,
116  TVecIndex const & count,
117  vector_type const & data);
118 
119 // void Put ( ///< write a subsampled (strided) section
120 // int const groupID, ///< group ID
121 // int const varID, ///< variable ID
122 // TVecIndex const & start, ///< zero-based index to start write
123 // TVecIndex const & count, ///< count along each dimension (>= 1)
124 // TVecStride const & stride, ///< interval along each dimension
125 // vector_type const & data); ///< vector of values to write
126 
127 // void Put ( ///< write a mapped array section
128 // int const groupID, ///< group ID
129 // int const varID, ///< variable ID
130 // TVecIndex const & start, ///< zero-based index to start reading
131 // TVecIndex const & count, ///< count along each dimension (>= 1)
132 // TVecStride const & stride, ///< interval along each dimension
133 // TVecStride const & imap, ///< mapping intervals for each dimension (see NetCDF doc)
134 // vector_type const & data); ///< vector of values to write
135  private:
136 
137  static char const * const myTypeName;
138  static value_type const fillValue = NC_FILL_CHAR;
139  static value_type const minValue = 0;
140  static value_type const maxValue = NC_MAX_BYTE;
141 
142  };
143 
145  extern NcChar ncChar;
146 
147 } // namespace netcdf
148 #endif
static value_type MinValue()
Definition: NcChar.h:32
NcChar()
Definition: NcChar.cpp:28
Represents a netCDF atomic Char type.
Definition: NcChar.h:23
std::vector< value_type > vector_type
Definition: NcChar.h:27
NcChar ncChar
Definition: NcChar.cpp:24
static value_type MaxValue()
Definition: NcChar.h:33
std::vector< std::size_t > TVecIndex
Definition: NcType.h:43
char value_type
Definition: NcChar.h:26
static value_type FillValue()
Definition: NcChar.h:31
void Put(int const groupID, int const varID, vector_type const &data)
data to write
Definition: NcChar.cpp:189
void Get(int const groupID, int const varID, char **&data)
receives data; free with FreeCStringArray
Definition: NcChar.cpp:33
static std::size_t SizeOf()
Definition: NcChar.h:34
Base class for all netCDF data types.
Definition: NcType.h:47