GPUdb C++ API  Version 5.2.0.0
visualize_image.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_H__
7 #define __VISUALIZE_IMAGE_H__
8 
13 namespace gpudb
14 {
15 
22  struct VisualizeImageRequest
23  {
24 
30  VisualizeImageRequest() :
31  tableNames(std::vector<std::string>()),
32  worldTableNames(std::vector<std::string>()),
33  xColumnName(std::string()),
34  yColumnName(std::string()),
35  trackIds(std::vector<std::vector<std::string> >()),
36  minX(double()),
37  maxX(double()),
38  minY(double()),
39  maxY(double()),
40  width(int32_t()),
41  height(int32_t()),
42  projection(std::string()),
43  bgColor(int64_t()),
44  styleOptions(std::map<std::string, std::vector<std::string> >()),
45  options(std::map<std::string, std::string>())
46  {
47  }
48 
107  VisualizeImageRequest(const std::vector<std::string>& tableNames, const std::vector<std::string>& worldTableNames, const std::string& xColumnName, const std::string& yColumnName, const std::vector<std::vector<std::string> >& trackIds, 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 int64_t bgColor, const std::map<std::string, std::vector<std::string> >& styleOptions, const std::map<std::string, std::string>& options):
108  tableNames(tableNames),
109  worldTableNames(worldTableNames),
110  xColumnName(xColumnName),
111  yColumnName(yColumnName),
112  trackIds(trackIds),
113  minX(minX),
114  maxX(maxX),
115  minY(minY),
116  maxY(maxY),
117  width(width),
118  height(height),
119  projection(projection),
120  bgColor(bgColor),
121  styleOptions(styleOptions),
122  options(options)
123  {
124  }
125 
130  std::vector<std::string> tableNames;
131  std::vector<std::string> worldTableNames;
132  std::string xColumnName;
133  std::string yColumnName;
134  std::vector<std::vector<std::string> > trackIds;
135  double minX;
136  double maxX;
137  double minY;
138  double maxY;
139  int32_t width;
140  int32_t height;
141  std::string projection;
142  int64_t bgColor;
143  std::map<std::string, std::vector<std::string> > styleOptions;
144  std::map<std::string, std::string> options;
145  };
146 }
147 
152 namespace avro
153 {
154  template<> struct codec_traits<gpudb::VisualizeImageRequest>
155  {
156  static void encode(Encoder& e, const gpudb::VisualizeImageRequest& v)
157  {
158  ::avro::encode(e, v.tableNames);
159  ::avro::encode(e, v.worldTableNames);
160  ::avro::encode(e, v.xColumnName);
161  ::avro::encode(e, v.yColumnName);
162  ::avro::encode(e, v.trackIds);
163  ::avro::encode(e, v.minX);
164  ::avro::encode(e, v.maxX);
165  ::avro::encode(e, v.minY);
166  ::avro::encode(e, v.maxY);
167  ::avro::encode(e, v.width);
168  ::avro::encode(e, v.height);
169  ::avro::encode(e, v.projection);
170  ::avro::encode(e, v.bgColor);
171  ::avro::encode(e, v.styleOptions);
172  ::avro::encode(e, v.options);
173  }
174 
175  static void decode(Decoder& d, gpudb::VisualizeImageRequest& v)
176  {
177  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
178  {
179  const std::vector<size_t> fo = rd->fieldOrder();
180 
181  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
182  {
183  switch (*it)
184  {
185  case 0:
186  ::avro::decode(d, v.tableNames);
187  break;
188 
189  case 1:
190  ::avro::decode(d, v.worldTableNames);
191  break;
192 
193  case 2:
194  ::avro::decode(d, v.xColumnName);
195  break;
196 
197  case 3:
198  ::avro::decode(d, v.yColumnName);
199  break;
200 
201  case 4:
202  ::avro::decode(d, v.trackIds);
203  break;
204 
205  case 5:
206  ::avro::decode(d, v.minX);
207  break;
208 
209  case 6:
210  ::avro::decode(d, v.maxX);
211  break;
212 
213  case 7:
214  ::avro::decode(d, v.minY);
215  break;
216 
217  case 8:
218  ::avro::decode(d, v.maxY);
219  break;
220 
221  case 9:
222  ::avro::decode(d, v.width);
223  break;
224 
225  case 10:
226  ::avro::decode(d, v.height);
227  break;
228 
229  case 11:
230  ::avro::decode(d, v.projection);
231  break;
232 
233  case 12:
234  ::avro::decode(d, v.bgColor);
235  break;
236 
237  case 13:
238  ::avro::decode(d, v.styleOptions);
239  break;
240 
241  case 14:
242  ::avro::decode(d, v.options);
243  break;
244 
245  default:
246  break;
247  }
248  }
249  }
250  else
251  {
252  ::avro::decode(d, v.tableNames);
253  ::avro::decode(d, v.worldTableNames);
254  ::avro::decode(d, v.xColumnName);
255  ::avro::decode(d, v.yColumnName);
256  ::avro::decode(d, v.trackIds);
257  ::avro::decode(d, v.minX);
258  ::avro::decode(d, v.maxX);
259  ::avro::decode(d, v.minY);
260  ::avro::decode(d, v.maxY);
261  ::avro::decode(d, v.width);
262  ::avro::decode(d, v.height);
263  ::avro::decode(d, v.projection);
264  ::avro::decode(d, v.bgColor);
265  ::avro::decode(d, v.styleOptions);
266  ::avro::decode(d, v.options);
267  }
268  }
269  };
270 }
271 
276 namespace gpudb
277 {
278 
285  struct VisualizeImageResponse
286  {
287 
293  VisualizeImageResponse() :
294  width(double()),
295  height(double()),
296  bgColor(int64_t()),
297  imageData(std::vector<uint8_t>())
298  {
299  }
300 
305  double width;
306  double height;
307  int64_t bgColor;
308  std::vector<uint8_t> imageData;
309  };
310 }
311 
316 namespace avro
317 {
318  template<> struct codec_traits<gpudb::VisualizeImageResponse>
319  {
320  static void encode(Encoder& e, const gpudb::VisualizeImageResponse& v)
321  {
322  ::avro::encode(e, v.width);
323  ::avro::encode(e, v.height);
324  ::avro::encode(e, v.bgColor);
325  ::avro::encode(e, v.imageData);
326  }
327 
328  static void decode(Decoder& d, gpudb::VisualizeImageResponse& v)
329  {
330  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
331  {
332  const std::vector<size_t> fo = rd->fieldOrder();
333 
334  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
335  {
336  switch (*it)
337  {
338  case 0:
339  ::avro::decode(d, v.width);
340  break;
341 
342  case 1:
343  ::avro::decode(d, v.height);
344  break;
345 
346  case 2:
347  ::avro::decode(d, v.bgColor);
348  break;
349 
350  case 3:
351  ::avro::decode(d, v.imageData);
352  break;
353 
354  default:
355  break;
356  }
357  }
358  }
359  else
360  {
361  ::avro::decode(d, v.width);
362  ::avro::decode(d, v.height);
363  ::avro::decode(d, v.bgColor);
364  ::avro::decode(d, v.imageData);
365  }
366  }
367  };
368 }
369 
370 #endif