GPUdb C++ API  Version 5.2.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 
36  {
37 
43  tableName(std::string()),
44  columnName(std::string()),
45  offset(int64_t()),
46  limit(int64_t()),
47  encoding(std::string("binary")),
48  options(std::map<std::string, std::string>())
49  {
50  }
51 
83  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):
84  tableName(tableName),
85  columnName(columnName),
86  offset(offset),
87  limit(limit),
88  encoding("binary"),
89  options(options)
90  {
91  }
92 
127  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):
128  tableName(tableName),
129  columnName(columnName),
130  offset(offset),
131  limit(limit),
132  encoding(encoding),
133  options(options)
134  {
135  }
136 
137  std::string tableName;
138  std::string columnName;
139  int64_t offset;
140  int64_t limit;
141  std::string encoding;
142  std::map<std::string, std::string> options;
143  };
144 }
145 
146 namespace avro
147 {
148  template<> struct codec_traits<gpudb::AggregateUniqueRequest>
149  {
150  static void encode(Encoder& e, const gpudb::AggregateUniqueRequest& v)
151  {
152  ::avro::encode(e, v.tableName);
153  ::avro::encode(e, v.columnName);
154  ::avro::encode(e, v.offset);
155  ::avro::encode(e, v.limit);
156  ::avro::encode(e, v.encoding);
157  ::avro::encode(e, v.options);
158  }
159 
160  static void decode(Decoder& d, gpudb::AggregateUniqueRequest& v)
161  {
162  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
163  {
164  const std::vector<size_t> fo = rd->fieldOrder();
165 
166  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
167  {
168  switch (*it)
169  {
170  case 0:
171  ::avro::decode(d, v.tableName);
172  break;
173 
174  case 1:
175  ::avro::decode(d, v.columnName);
176  break;
177 
178  case 2:
179  ::avro::decode(d, v.offset);
180  break;
181 
182  case 3:
183  ::avro::decode(d, v.limit);
184  break;
185 
186  case 4:
187  ::avro::decode(d, v.encoding);
188  break;
189 
190  case 5:
191  ::avro::decode(d, v.options);
192  break;
193 
194  default:
195  break;
196  }
197  }
198  }
199  else
200  {
201  ::avro::decode(d, v.tableName);
202  ::avro::decode(d, v.columnName);
203  ::avro::decode(d, v.offset);
204  ::avro::decode(d, v.limit);
205  ::avro::decode(d, v.encoding);
206  ::avro::decode(d, v.options);
207  }
208  }
209  };
210 }
211 
212 namespace gpudb
213 {
214 
237  {
238 
244  tableName(std::string()),
245  responseSchemaStr(std::string()),
246  binaryEncodedResponse(std::vector<uint8_t>()),
247  jsonEncodedResponse(std::string()),
248  hasMoreRecords(bool())
249  {
250  }
251 
252  std::string tableName;
253  std::string responseSchemaStr;
254  std::vector<uint8_t> binaryEncodedResponse;
255  std::string jsonEncodedResponse;
257  };
258 }
259 
260 namespace avro
261 {
262  template<> struct codec_traits<gpudb::RawAggregateUniqueResponse>
263  {
264  static void encode(Encoder& e, const gpudb::RawAggregateUniqueResponse& v)
265  {
266  ::avro::encode(e, v.tableName);
267  ::avro::encode(e, v.responseSchemaStr);
268  ::avro::encode(e, v.binaryEncodedResponse);
269  ::avro::encode(e, v.jsonEncodedResponse);
270  ::avro::encode(e, v.hasMoreRecords);
271  }
272 
273  static void decode(Decoder& d, gpudb::RawAggregateUniqueResponse& v)
274  {
275  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
276  {
277  const std::vector<size_t> fo = rd->fieldOrder();
278 
279  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
280  {
281  switch (*it)
282  {
283  case 0:
284  ::avro::decode(d, v.tableName);
285  break;
286 
287  case 1:
288  ::avro::decode(d, v.responseSchemaStr);
289  break;
290 
291  case 2:
292  ::avro::decode(d, v.binaryEncodedResponse);
293  break;
294 
295  case 3:
296  ::avro::decode(d, v.jsonEncodedResponse);
297  break;
298 
299  case 4:
300  ::avro::decode(d, v.hasMoreRecords);
301  break;
302 
303  default:
304  break;
305  }
306  }
307  }
308  else
309  {
310  ::avro::decode(d, v.tableName);
311  ::avro::decode(d, v.responseSchemaStr);
312  ::avro::decode(d, v.binaryEncodedResponse);
313  ::avro::decode(d, v.jsonEncodedResponse);
314  ::avro::decode(d, v.hasMoreRecords);
315  }
316  }
317  };
318 }
319 
320 namespace gpudb
321 {
322 
345  {
346 
352  tableName(std::string()),
353  responseSchemaStr(std::string()),
354  data(std::vector<gpudb::GenericRecord>()),
355  hasMoreRecords(bool())
356  {
357  }
358 
359  std::string tableName;
360  std::string responseSchemaStr;
361  std::vector<gpudb::GenericRecord> data;
363  };
364 }
365 
366 #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.
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.
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::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.