GPUdb C++ API  Version 5.2.0.0
visualize_image_heatmap.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __VISUALIZE_IMAGE_HEATMAP_H__
7 #define __VISUALIZE_IMAGE_HEATMAP_H__
8 
13 namespace gpudb
14 {
15 
22  struct VisualizeImageHeatmapRequest
23  {
24 
30  VisualizeImageHeatmapRequest() :
31  tableNames(std::vector<std::string>()),
32  xColumnName(std::string()),
33  yColumnName(std::string()),
34  valueColumnName(std::string()),
35  minX(double()),
36  maxX(double()),
37  minY(double()),
38  maxY(double()),
39  width(int32_t()),
40  height(int32_t()),
41  projection(std::string()),
42  styleOptions(std::map<std::string, std::string>()),
43  options(std::map<std::string, std::string>())
44  {
45  }
46 
80  VisualizeImageHeatmapRequest(const std::vector<std::string>& tableNames, const std::string& xColumnName, const std::string& yColumnName, const std::string& valueColumnName, const double minX, const double maxX, const double minY, const double maxY, const int32_t width, const int32_t height, const std::string& projection, const std::map<std::string, std::string>& styleOptions, const std::map<std::string, std::string>& options):
81  tableNames(tableNames),
82  xColumnName(xColumnName),
83  yColumnName(yColumnName),
84  valueColumnName(valueColumnName),
85  minX(minX),
86  maxX(maxX),
87  minY(minY),
88  maxY(maxY),
89  width(width),
90  height(height),
91  projection(projection),
92  styleOptions(styleOptions),
93  options(options)
94  {
95  }
96 
101  std::vector<std::string> tableNames;
102  std::string xColumnName;
103  std::string yColumnName;
104  std::string valueColumnName;
105  double minX;
106  double maxX;
107  double minY;
108  double maxY;
109  int32_t width;
110  int32_t height;
111  std::string projection;
112  std::map<std::string, std::string> styleOptions;
113  std::map<std::string, std::string> options;
114  };
115 }
116 
121 namespace avro
122 {
123  template<> struct codec_traits<gpudb::VisualizeImageHeatmapRequest>
124  {
125  static void encode(Encoder& e, const gpudb::VisualizeImageHeatmapRequest& v)
126  {
127  ::avro::encode(e, v.tableNames);
128  ::avro::encode(e, v.xColumnName);
129  ::avro::encode(e, v.yColumnName);
130  ::avro::encode(e, v.valueColumnName);
131  ::avro::encode(e, v.minX);
132  ::avro::encode(e, v.maxX);
133  ::avro::encode(e, v.minY);
134  ::avro::encode(e, v.maxY);
135  ::avro::encode(e, v.width);
136  ::avro::encode(e, v.height);
137  ::avro::encode(e, v.projection);
138  ::avro::encode(e, v.styleOptions);
139  ::avro::encode(e, v.options);
140  }
141 
142  static void decode(Decoder& d, gpudb::VisualizeImageHeatmapRequest& v)
143  {
144  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
145  {
146  const std::vector<size_t> fo = rd->fieldOrder();
147 
148  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
149  {
150  switch (*it)
151  {
152  case 0:
153  ::avro::decode(d, v.tableNames);
154  break;
155 
156  case 1:
157  ::avro::decode(d, v.xColumnName);
158  break;
159 
160  case 2:
161  ::avro::decode(d, v.yColumnName);
162  break;
163 
164  case 3:
165  ::avro::decode(d, v.valueColumnName);
166  break;
167 
168  case 4:
169  ::avro::decode(d, v.minX);
170  break;
171 
172  case 5:
173  ::avro::decode(d, v.maxX);
174  break;
175 
176  case 6:
177  ::avro::decode(d, v.minY);
178  break;
179 
180  case 7:
181  ::avro::decode(d, v.maxY);
182  break;
183 
184  case 8:
185  ::avro::decode(d, v.width);
186  break;
187 
188  case 9:
189  ::avro::decode(d, v.height);
190  break;
191 
192  case 10:
193  ::avro::decode(d, v.projection);
194  break;
195 
196  case 11:
197  ::avro::decode(d, v.styleOptions);
198  break;
199 
200  case 12:
201  ::avro::decode(d, v.options);
202  break;
203 
204  default:
205  break;
206  }
207  }
208  }
209  else
210  {
211  ::avro::decode(d, v.tableNames);
212  ::avro::decode(d, v.xColumnName);
213  ::avro::decode(d, v.yColumnName);
214  ::avro::decode(d, v.valueColumnName);
215  ::avro::decode(d, v.minX);
216  ::avro::decode(d, v.maxX);
217  ::avro::decode(d, v.minY);
218  ::avro::decode(d, v.maxY);
219  ::avro::decode(d, v.width);
220  ::avro::decode(d, v.height);
221  ::avro::decode(d, v.projection);
222  ::avro::decode(d, v.styleOptions);
223  ::avro::decode(d, v.options);
224  }
225  }
226  };
227 }
228 
233 namespace gpudb
234 {
235 
242  struct VisualizeImageHeatmapResponse
243  {
244 
250  VisualizeImageHeatmapResponse() :
251  width(int32_t()),
252  height(int32_t()),
253  bgColor(int64_t()),
254  imageData(std::vector<uint8_t>())
255  {
256  }
257 
262  int32_t width;
263  int32_t height;
264  int64_t bgColor;
265  std::vector<uint8_t> imageData;
266  };
267 }
268 
273 namespace avro
274 {
275  template<> struct codec_traits<gpudb::VisualizeImageHeatmapResponse>
276  {
277  static void encode(Encoder& e, const gpudb::VisualizeImageHeatmapResponse& v)
278  {
279  ::avro::encode(e, v.width);
280  ::avro::encode(e, v.height);
281  ::avro::encode(e, v.bgColor);
282  ::avro::encode(e, v.imageData);
283  }
284 
285  static void decode(Decoder& d, gpudb::VisualizeImageHeatmapResponse& v)
286  {
287  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
288  {
289  const std::vector<size_t> fo = rd->fieldOrder();
290 
291  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
292  {
293  switch (*it)
294  {
295  case 0:
296  ::avro::decode(d, v.width);
297  break;
298 
299  case 1:
300  ::avro::decode(d, v.height);
301  break;
302 
303  case 2:
304  ::avro::decode(d, v.bgColor);
305  break;
306 
307  case 3:
308  ::avro::decode(d, v.imageData);
309  break;
310 
311  default:
312  break;
313  }
314  }
315  }
316  else
317  {
318  ::avro::decode(d, v.width);
319  ::avro::decode(d, v.height);
320  ::avro::decode(d, v.bgColor);
321  ::avro::decode(d, v.imageData);
322  }
323  }
324  };
325 }
326 
327 #endif