GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
135  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_):
136  tableName( tableName_ ),
137  columnName( columnName_ ),
138  offset( offset_ ),
139  limit( limit_ ),
140  encoding( "binary" ),
141  options( options_ )
142  {
143  }
144 
222  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_):
223  tableName( tableName_ ),
224  columnName( columnName_ ),
225  offset( offset_ ),
226  limit( limit_ ),
227  encoding( encoding_ ),
228  options( options_ )
229  {
230  }
231 
232  std::string tableName;
233  std::string columnName;
234  int64_t offset;
235  int64_t limit;
236  std::string encoding;
237  std::map<std::string, std::string> options;
238  };
239 }
240 
241 namespace avro
242 {
243  template<> struct codec_traits<gpudb::AggregateUniqueRequest>
244  {
245  static void encode(Encoder& e, const gpudb::AggregateUniqueRequest& v)
246  {
247  ::avro::encode(e, v.tableName);
248  ::avro::encode(e, v.columnName);
249  ::avro::encode(e, v.offset);
250  ::avro::encode(e, v.limit);
251  ::avro::encode(e, v.encoding);
252  ::avro::encode(e, v.options);
253  }
254 
255  static void decode(Decoder& d, gpudb::AggregateUniqueRequest& v)
256  {
257  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
258  {
259  const std::vector<size_t> fo = rd->fieldOrder();
260 
261  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
262  {
263  switch (*it)
264  {
265  case 0:
266  ::avro::decode(d, v.tableName);
267  break;
268 
269  case 1:
270  ::avro::decode(d, v.columnName);
271  break;
272 
273  case 2:
274  ::avro::decode(d, v.offset);
275  break;
276 
277  case 3:
278  ::avro::decode(d, v.limit);
279  break;
280 
281  case 4:
282  ::avro::decode(d, v.encoding);
283  break;
284 
285  case 5:
286  ::avro::decode(d, v.options);
287  break;
288 
289  default:
290  break;
291  }
292  }
293  }
294  else
295  {
296  ::avro::decode(d, v.tableName);
297  ::avro::decode(d, v.columnName);
298  ::avro::decode(d, v.offset);
299  ::avro::decode(d, v.limit);
300  ::avro::decode(d, v.encoding);
301  ::avro::decode(d, v.options);
302  }
303  }
304  };
305 }
306 
307 namespace gpudb
308 {
309 
347  {
348 
354  tableName(std::string()),
355  responseSchemaStr(std::string()),
356  binaryEncodedResponse(std::vector<uint8_t>()),
357  jsonEncodedResponse(std::string()),
358  hasMoreRecords(bool())
359  {
360  }
361 
362  std::string tableName;
363  std::string responseSchemaStr;
364  std::vector<uint8_t> binaryEncodedResponse;
365  std::string jsonEncodedResponse;
367  };
368 }
369 
370 namespace avro
371 {
372  template<> struct codec_traits<gpudb::RawAggregateUniqueResponse>
373  {
374  static void encode(Encoder& e, const gpudb::RawAggregateUniqueResponse& v)
375  {
376  ::avro::encode(e, v.tableName);
377  ::avro::encode(e, v.responseSchemaStr);
378  ::avro::encode(e, v.binaryEncodedResponse);
379  ::avro::encode(e, v.jsonEncodedResponse);
380  ::avro::encode(e, v.hasMoreRecords);
381  }
382 
383  static void decode(Decoder& d, gpudb::RawAggregateUniqueResponse& v)
384  {
385  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
386  {
387  const std::vector<size_t> fo = rd->fieldOrder();
388 
389  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
390  {
391  switch (*it)
392  {
393  case 0:
394  ::avro::decode(d, v.tableName);
395  break;
396 
397  case 1:
398  ::avro::decode(d, v.responseSchemaStr);
399  break;
400 
401  case 2:
402  ::avro::decode(d, v.binaryEncodedResponse);
403  break;
404 
405  case 3:
406  ::avro::decode(d, v.jsonEncodedResponse);
407  break;
408 
409  case 4:
410  ::avro::decode(d, v.hasMoreRecords);
411  break;
412 
413  default:
414  break;
415  }
416  }
417  }
418  else
419  {
420  ::avro::decode(d, v.tableName);
421  ::avro::decode(d, v.responseSchemaStr);
422  ::avro::decode(d, v.binaryEncodedResponse);
423  ::avro::decode(d, v.jsonEncodedResponse);
424  ::avro::decode(d, v.hasMoreRecords);
425  }
426  }
427  };
428 }
429 
430 namespace gpudb
431 {
432 
470  {
471 
477  tableName(std::string()),
478  responseSchemaStr(std::string()),
479  data(std::vector<gpudb::GenericRecord>()),
480  hasMoreRecords(bool())
481  {
482  }
483 
484  std::string tableName;
485  std::string responseSchemaStr;
486  std::vector<gpudb::GenericRecord> data;
488  };
489 }
490 
491 #endif
AggregateUniqueRequest()
Constructs an AggregateUniqueRequest object with default parameter values.
std::vector< gpudb::GenericRecord > data
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
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.