GPUdb C++ API  Version 6.1.0.0
aggregate_unique.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 __AGGREGATE_UNIQUE_H__
7 #define __AGGREGATE_UNIQUE_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
13 
51  {
52 
58  tableName(std::string()),
59  columnName(std::string()),
60  offset(int64_t()),
61  limit(int64_t()),
62  encoding(std::string("binary")),
63  options(std::map<std::string, std::string>())
64  {
65  }
66 
154  AggregateUniqueRequest(const std::string& tableName_, const std::string& columnName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
155  tableName( tableName_ ),
156  columnName( columnName_ ),
157  offset( offset_ ),
158  limit( limit_ ),
159  encoding( "binary" ),
160  options( options_ )
161  {
162  }
163 
262  AggregateUniqueRequest(const std::string& tableName_, const std::string& columnName_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
263  tableName( tableName_ ),
264  columnName( columnName_ ),
265  offset( offset_ ),
266  limit( limit_ ),
267  encoding( encoding_ ),
268  options( options_ )
269  {
270  }
271 
272  std::string tableName;
273  std::string columnName;
274  int64_t offset;
275  int64_t limit;
276  std::string encoding;
277  std::map<std::string, std::string> options;
278  };
279 }
280 
281 namespace avro
282 {
283  template<> struct codec_traits<gpudb::AggregateUniqueRequest>
284  {
285  static void encode(Encoder& e, const gpudb::AggregateUniqueRequest& v)
286  {
287  ::avro::encode(e, v.tableName);
288  ::avro::encode(e, v.columnName);
289  ::avro::encode(e, v.offset);
290  ::avro::encode(e, v.limit);
291  ::avro::encode(e, v.encoding);
292  ::avro::encode(e, v.options);
293  }
294 
295  static void decode(Decoder& d, gpudb::AggregateUniqueRequest& v)
296  {
297  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
298  {
299  const std::vector<size_t> fo = rd->fieldOrder();
300 
301  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
302  {
303  switch (*it)
304  {
305  case 0:
306  ::avro::decode(d, v.tableName);
307  break;
308 
309  case 1:
310  ::avro::decode(d, v.columnName);
311  break;
312 
313  case 2:
314  ::avro::decode(d, v.offset);
315  break;
316 
317  case 3:
318  ::avro::decode(d, v.limit);
319  break;
320 
321  case 4:
322  ::avro::decode(d, v.encoding);
323  break;
324 
325  case 5:
326  ::avro::decode(d, v.options);
327  break;
328 
329  default:
330  break;
331  }
332  }
333  }
334  else
335  {
336  ::avro::decode(d, v.tableName);
337  ::avro::decode(d, v.columnName);
338  ::avro::decode(d, v.offset);
339  ::avro::decode(d, v.limit);
340  ::avro::decode(d, v.encoding);
341  ::avro::decode(d, v.options);
342  }
343  }
344  };
345 }
346 
347 namespace gpudb
348 {
349 
387  {
388 
394  tableName(std::string()),
395  responseSchemaStr(std::string()),
396  binaryEncodedResponse(std::vector<uint8_t>()),
397  jsonEncodedResponse(std::string()),
398  hasMoreRecords(bool())
399  {
400  }
401 
402  std::string tableName;
403  std::string responseSchemaStr;
404  std::vector<uint8_t> binaryEncodedResponse;
405  std::string jsonEncodedResponse;
407  };
408 }
409 
410 namespace avro
411 {
412  template<> struct codec_traits<gpudb::RawAggregateUniqueResponse>
413  {
414  static void encode(Encoder& e, const gpudb::RawAggregateUniqueResponse& v)
415  {
416  ::avro::encode(e, v.tableName);
417  ::avro::encode(e, v.responseSchemaStr);
418  ::avro::encode(e, v.binaryEncodedResponse);
419  ::avro::encode(e, v.jsonEncodedResponse);
420  ::avro::encode(e, v.hasMoreRecords);
421  }
422 
423  static void decode(Decoder& d, gpudb::RawAggregateUniqueResponse& v)
424  {
425  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
426  {
427  const std::vector<size_t> fo = rd->fieldOrder();
428 
429  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
430  {
431  switch (*it)
432  {
433  case 0:
434  ::avro::decode(d, v.tableName);
435  break;
436 
437  case 1:
438  ::avro::decode(d, v.responseSchemaStr);
439  break;
440 
441  case 2:
442  ::avro::decode(d, v.binaryEncodedResponse);
443  break;
444 
445  case 3:
446  ::avro::decode(d, v.jsonEncodedResponse);
447  break;
448 
449  case 4:
450  ::avro::decode(d, v.hasMoreRecords);
451  break;
452 
453  default:
454  break;
455  }
456  }
457  }
458  else
459  {
460  ::avro::decode(d, v.tableName);
461  ::avro::decode(d, v.responseSchemaStr);
462  ::avro::decode(d, v.binaryEncodedResponse);
463  ::avro::decode(d, v.jsonEncodedResponse);
464  ::avro::decode(d, v.hasMoreRecords);
465  }
466  }
467  };
468 }
469 
470 namespace gpudb
471 {
472 
510  {
511 
517  tableName(std::string()),
518  responseSchemaStr(std::string()),
519  data(std::vector<gpudb::GenericRecord>()),
520  hasMoreRecords(bool())
521  {
522  }
523 
524  std::string tableName;
525  std::string responseSchemaStr;
526  std::vector<gpudb::GenericRecord> data;
528  };
529 }
530 
531 #endif
AggregateUniqueRequest()
Constructs an AggregateUniqueRequest object with default parameter values.
std::vector< gpudb::GenericRecord > data
A set of input parameters for aggregateUniqueRaw(const AggregateUniqueRequest&) const.
A set of output parameters for aggregateUnique(const AggregateUniqueRequest&) const.
AggregateUniqueResponse()
Constructs an AggregateUniqueResponse object with default parameter values.
RawAggregateUniqueResponse()
Constructs a RawAggregateUniqueResponse object with default parameter values.
AggregateUniqueRequest(const std::string &tableName_, const std::string &columnName_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUniqueRequest object with the specified parameters.
std::map< std::string, std::string > options
std::vector< uint8_t > binaryEncodedResponse
A set of output parameters for aggregateUniqueRaw(const AggregateUniqueRequest&) const.
AggregateUniqueRequest(const std::string &tableName_, const std::string &columnName_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUniqueRequest object with the specified parameters.