GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
58  {
59 
65  tableName(std::string()),
66  columnName(std::string()),
67  offset(int64_t()),
68  limit(int64_t()),
69  encoding(std::string("binary")),
70  options(std::map<std::string, std::string>())
71  {
72  }
73 
210  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_):
211  tableName( tableName_ ),
212  columnName( columnName_ ),
213  offset( offset_ ),
214  limit( limit_ ),
215  encoding( "binary" ),
216  options( options_ )
217  {
218  }
219 
367  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_):
368  tableName( tableName_ ),
369  columnName( columnName_ ),
370  offset( offset_ ),
371  limit( limit_ ),
372  encoding( encoding_ ),
373  options( options_ )
374  {
375  }
376 
377  std::string tableName;
378  std::string columnName;
379  int64_t offset;
380  int64_t limit;
381  std::string encoding;
382  std::map<std::string, std::string> options;
383  };
384 }
385 
386 namespace avro
387 {
388  template<> struct codec_traits<gpudb::AggregateUniqueRequest>
389  {
390  static void encode(Encoder& e, const gpudb::AggregateUniqueRequest& v)
391  {
392  ::avro::encode(e, v.tableName);
393  ::avro::encode(e, v.columnName);
394  ::avro::encode(e, v.offset);
395  ::avro::encode(e, v.limit);
396  ::avro::encode(e, v.encoding);
397  ::avro::encode(e, v.options);
398  }
399 
400  static void decode(Decoder& d, gpudb::AggregateUniqueRequest& v)
401  {
402  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
403  {
404  const std::vector<size_t> fo = rd->fieldOrder();
405 
406  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
407  {
408  switch (*it)
409  {
410  case 0:
411  ::avro::decode(d, v.tableName);
412  break;
413 
414  case 1:
415  ::avro::decode(d, v.columnName);
416  break;
417 
418  case 2:
419  ::avro::decode(d, v.offset);
420  break;
421 
422  case 3:
423  ::avro::decode(d, v.limit);
424  break;
425 
426  case 4:
427  ::avro::decode(d, v.encoding);
428  break;
429 
430  case 5:
431  ::avro::decode(d, v.options);
432  break;
433 
434  default:
435  break;
436  }
437  }
438  }
439  else
440  {
441  ::avro::decode(d, v.tableName);
442  ::avro::decode(d, v.columnName);
443  ::avro::decode(d, v.offset);
444  ::avro::decode(d, v.limit);
445  ::avro::decode(d, v.encoding);
446  ::avro::decode(d, v.options);
447  }
448  }
449  };
450 }
451 
452 namespace gpudb
453 {
454 
499  {
500 
506  tableName(std::string()),
507  responseSchemaStr(std::string()),
508  binaryEncodedResponse(std::vector<uint8_t>()),
509  jsonEncodedResponse(std::string()),
510  hasMoreRecords(bool()),
511  info(std::map<std::string, std::string>())
512  {
513  }
514 
515  std::string tableName;
516  std::string responseSchemaStr;
517  std::vector<uint8_t> binaryEncodedResponse;
518  std::string jsonEncodedResponse;
520  std::map<std::string, std::string> info;
521  };
522 }
523 
524 namespace avro
525 {
526  template<> struct codec_traits<gpudb::RawAggregateUniqueResponse>
527  {
528  static void encode(Encoder& e, const gpudb::RawAggregateUniqueResponse& v)
529  {
530  ::avro::encode(e, v.tableName);
531  ::avro::encode(e, v.responseSchemaStr);
532  ::avro::encode(e, v.binaryEncodedResponse);
533  ::avro::encode(e, v.jsonEncodedResponse);
534  ::avro::encode(e, v.hasMoreRecords);
535  ::avro::encode(e, v.info);
536  }
537 
538  static void decode(Decoder& d, gpudb::RawAggregateUniqueResponse& v)
539  {
540  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
541  {
542  const std::vector<size_t> fo = rd->fieldOrder();
543 
544  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
545  {
546  switch (*it)
547  {
548  case 0:
549  ::avro::decode(d, v.tableName);
550  break;
551 
552  case 1:
553  ::avro::decode(d, v.responseSchemaStr);
554  break;
555 
556  case 2:
557  ::avro::decode(d, v.binaryEncodedResponse);
558  break;
559 
560  case 3:
561  ::avro::decode(d, v.jsonEncodedResponse);
562  break;
563 
564  case 4:
565  ::avro::decode(d, v.hasMoreRecords);
566  break;
567 
568  case 5:
569  ::avro::decode(d, v.info);
570  break;
571 
572  default:
573  break;
574  }
575  }
576  }
577  else
578  {
579  ::avro::decode(d, v.tableName);
580  ::avro::decode(d, v.responseSchemaStr);
581  ::avro::decode(d, v.binaryEncodedResponse);
582  ::avro::decode(d, v.jsonEncodedResponse);
583  ::avro::decode(d, v.hasMoreRecords);
584  ::avro::decode(d, v.info);
585  }
586  }
587  };
588 }
589 
590 namespace gpudb
591 {
592 
637  {
638 
644  tableName(std::string()),
645  responseSchemaStr(std::string()),
646  data(std::vector<gpudb::GenericRecord>()),
647  hasMoreRecords(bool()),
648  info(std::map<std::string, std::string>()),
649  dataTypePtr((gpudb::Type*)NULL)
650  {
651  }
652 
653  std::string tableName;
654  std::string responseSchemaStr;
655  std::vector<gpudb::GenericRecord> data;
657  std::map<std::string, std::string> info;
659  };
660 }
661 
662 #endif
AggregateUniqueRequest()
Constructs an AggregateUniqueRequest object with default parameter values.
boost::shared_ptr< Type > gpudb_type_ptr_t
std::vector< gpudb::GenericRecord > data
std::map< std::string, std::string > info
A set of input parameters for const.
A set of output parameters for 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
std::map< std::string, std::string > info
A set of output parameters for 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.