GPUdb C++ API  Version 6.2.0.3
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 
169  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_):
170  tableName( tableName_ ),
171  columnName( columnName_ ),
172  offset( offset_ ),
173  limit( limit_ ),
174  encoding( "binary" ),
175  options( options_ )
176  {
177  }
178 
292  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_):
293  tableName( tableName_ ),
294  columnName( columnName_ ),
295  offset( offset_ ),
296  limit( limit_ ),
297  encoding( encoding_ ),
298  options( options_ )
299  {
300  }
301 
302  std::string tableName;
303  std::string columnName;
304  int64_t offset;
305  int64_t limit;
306  std::string encoding;
307  std::map<std::string, std::string> options;
308  };
309 }
310 
311 namespace avro
312 {
313  template<> struct codec_traits<gpudb::AggregateUniqueRequest>
314  {
315  static void encode(Encoder& e, const gpudb::AggregateUniqueRequest& v)
316  {
317  ::avro::encode(e, v.tableName);
318  ::avro::encode(e, v.columnName);
319  ::avro::encode(e, v.offset);
320  ::avro::encode(e, v.limit);
321  ::avro::encode(e, v.encoding);
322  ::avro::encode(e, v.options);
323  }
324 
325  static void decode(Decoder& d, gpudb::AggregateUniqueRequest& v)
326  {
327  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
328  {
329  const std::vector<size_t> fo = rd->fieldOrder();
330 
331  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
332  {
333  switch (*it)
334  {
335  case 0:
336  ::avro::decode(d, v.tableName);
337  break;
338 
339  case 1:
340  ::avro::decode(d, v.columnName);
341  break;
342 
343  case 2:
344  ::avro::decode(d, v.offset);
345  break;
346 
347  case 3:
348  ::avro::decode(d, v.limit);
349  break;
350 
351  case 4:
352  ::avro::decode(d, v.encoding);
353  break;
354 
355  case 5:
356  ::avro::decode(d, v.options);
357  break;
358 
359  default:
360  break;
361  }
362  }
363  }
364  else
365  {
366  ::avro::decode(d, v.tableName);
367  ::avro::decode(d, v.columnName);
368  ::avro::decode(d, v.offset);
369  ::avro::decode(d, v.limit);
370  ::avro::decode(d, v.encoding);
371  ::avro::decode(d, v.options);
372  }
373  }
374  };
375 }
376 
377 namespace gpudb
378 {
379 
417  {
418 
424  tableName(std::string()),
425  responseSchemaStr(std::string()),
426  binaryEncodedResponse(std::vector<uint8_t>()),
427  jsonEncodedResponse(std::string()),
428  hasMoreRecords(bool())
429  {
430  }
431 
432  std::string tableName;
433  std::string responseSchemaStr;
434  std::vector<uint8_t> binaryEncodedResponse;
435  std::string jsonEncodedResponse;
437  };
438 }
439 
440 namespace avro
441 {
442  template<> struct codec_traits<gpudb::RawAggregateUniqueResponse>
443  {
444  static void encode(Encoder& e, const gpudb::RawAggregateUniqueResponse& v)
445  {
446  ::avro::encode(e, v.tableName);
447  ::avro::encode(e, v.responseSchemaStr);
448  ::avro::encode(e, v.binaryEncodedResponse);
449  ::avro::encode(e, v.jsonEncodedResponse);
450  ::avro::encode(e, v.hasMoreRecords);
451  }
452 
453  static void decode(Decoder& d, gpudb::RawAggregateUniqueResponse& v)
454  {
455  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
456  {
457  const std::vector<size_t> fo = rd->fieldOrder();
458 
459  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
460  {
461  switch (*it)
462  {
463  case 0:
464  ::avro::decode(d, v.tableName);
465  break;
466 
467  case 1:
468  ::avro::decode(d, v.responseSchemaStr);
469  break;
470 
471  case 2:
472  ::avro::decode(d, v.binaryEncodedResponse);
473  break;
474 
475  case 3:
476  ::avro::decode(d, v.jsonEncodedResponse);
477  break;
478 
479  case 4:
480  ::avro::decode(d, v.hasMoreRecords);
481  break;
482 
483  default:
484  break;
485  }
486  }
487  }
488  else
489  {
490  ::avro::decode(d, v.tableName);
491  ::avro::decode(d, v.responseSchemaStr);
492  ::avro::decode(d, v.binaryEncodedResponse);
493  ::avro::decode(d, v.jsonEncodedResponse);
494  ::avro::decode(d, v.hasMoreRecords);
495  }
496  }
497  };
498 }
499 
500 namespace gpudb
501 {
502 
540  {
541 
547  tableName(std::string()),
548  responseSchemaStr(std::string()),
549  data(std::vector<gpudb::GenericRecord>()),
550  hasMoreRecords(bool()),
551  dataTypePtr((gpudb::Type*)NULL)
552  {
553  }
554 
555  std::string tableName;
556  std::string responseSchemaStr;
557  std::vector<gpudb::GenericRecord> data;
560  };
561 }
562 
563 #endif
AggregateUniqueRequest()
Constructs an AggregateUniqueRequest object with default parameter values.
boost::shared_ptr< Type > gpudb_type_ptr_t
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.