GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
get_records_from_collection.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 __GET_RECORDS_FROM_COLLECTION_H__
7 #define __GET_RECORDS_FROM_COLLECTION_H__
8 
9 namespace gpudb
10 {
11 
27  {
28 
34  tableName(std::string()),
35  offset(int64_t()),
36  limit(int64_t()),
37  encoding(std::string("binary")),
38  options(std::map<std::string, std::string>())
39  {
40  }
41 
81  GetRecordsFromCollectionRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
82  tableName( tableName_ ),
83  offset( offset_ ),
84  limit( limit_ ),
85  encoding( "binary" ),
86  options( options_ )
87  {
88  }
89 
139  GetRecordsFromCollectionRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
140  tableName( tableName_ ),
141  offset( offset_ ),
142  limit( limit_ ),
143  encoding( encoding_ ),
144  options( options_ )
145  {
146  }
147 
148  std::string tableName;
149  int64_t offset;
150  int64_t limit;
151  std::string encoding;
152  std::map<std::string, std::string> options;
153  };
154 }
155 
156 namespace avro
157 {
158  template<> struct codec_traits<gpudb::GetRecordsFromCollectionRequest>
159  {
160  static void encode(Encoder& e, const gpudb::GetRecordsFromCollectionRequest& v)
161  {
162  ::avro::encode(e, v.tableName);
163  ::avro::encode(e, v.offset);
164  ::avro::encode(e, v.limit);
165  ::avro::encode(e, v.encoding);
166  ::avro::encode(e, v.options);
167  }
168 
169  static void decode(Decoder& d, gpudb::GetRecordsFromCollectionRequest& v)
170  {
171  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
172  {
173  const std::vector<size_t> fo = rd->fieldOrder();
174 
175  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
176  {
177  switch (*it)
178  {
179  case 0:
180  ::avro::decode(d, v.tableName);
181  break;
182 
183  case 1:
184  ::avro::decode(d, v.offset);
185  break;
186 
187  case 2:
188  ::avro::decode(d, v.limit);
189  break;
190 
191  case 3:
192  ::avro::decode(d, v.encoding);
193  break;
194 
195  case 4:
196  ::avro::decode(d, v.options);
197  break;
198 
199  default:
200  break;
201  }
202  }
203  }
204  else
205  {
206  ::avro::decode(d, v.tableName);
207  ::avro::decode(d, v.offset);
208  ::avro::decode(d, v.limit);
209  ::avro::decode(d, v.encoding);
210  ::avro::decode(d, v.options);
211  }
212  }
213  };
214 }
215 
216 namespace gpudb
217 {
218 
234  {
235 
241  tableName(std::string()),
242  typeNames(std::vector<std::string>()),
243  recordsBinary(std::vector<std::vector<uint8_t> >()),
244  recordsJson(std::vector<std::string>()),
245  recordIds(std::vector<std::string>()),
246  info(std::map<std::string, std::string>())
247  {
248  }
249 
250  std::string tableName;
251  std::vector<std::string> typeNames;
252  std::vector<std::vector<uint8_t> > recordsBinary;
253  std::vector<std::string> recordsJson;
254  std::vector<std::string> recordIds;
255  std::map<std::string, std::string> info;
256  };
257 }
258 
259 namespace avro
260 {
261  template<> struct codec_traits<gpudb::RawGetRecordsFromCollectionResponse>
262  {
263  static void encode(Encoder& e, const gpudb::RawGetRecordsFromCollectionResponse& v)
264  {
265  ::avro::encode(e, v.tableName);
266  ::avro::encode(e, v.typeNames);
267  ::avro::encode(e, v.recordsBinary);
268  ::avro::encode(e, v.recordsJson);
269  ::avro::encode(e, v.recordIds);
270  ::avro::encode(e, v.info);
271  }
272 
273  static void decode(Decoder& d, gpudb::RawGetRecordsFromCollectionResponse& 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.typeNames);
289  break;
290 
291  case 2:
292  ::avro::decode(d, v.recordsBinary);
293  break;
294 
295  case 3:
296  ::avro::decode(d, v.recordsJson);
297  break;
298 
299  case 4:
300  ::avro::decode(d, v.recordIds);
301  break;
302 
303  case 5:
304  ::avro::decode(d, v.info);
305  break;
306 
307  default:
308  break;
309  }
310  }
311  }
312  else
313  {
314  ::avro::decode(d, v.tableName);
315  ::avro::decode(d, v.typeNames);
316  ::avro::decode(d, v.recordsBinary);
317  ::avro::decode(d, v.recordsJson);
318  ::avro::decode(d, v.recordIds);
319  ::avro::decode(d, v.info);
320  }
321  }
322  };
323 }
324 
325 namespace gpudb
326 {
327 
345  template<typename T> struct GetRecordsFromCollectionResponse
346  {
347 
353  tableName(std::string()),
354  typeNames(std::vector<std::string>()),
355  data(std::vector<T>()),
356  recordIds(std::vector<std::string>()),
357  info(std::map<std::string, std::string>())
358  {
359  }
360 
361  std::string tableName;
362  std::vector<std::string> typeNames;
363  std::vector<T> data;
364  std::vector<std::string> recordIds;
365  std::map<std::string, std::string> info;
366  };
367 }
368 
369 #endif
std::map< std::string, std::string > info
RawGetRecordsFromCollectionResponse()
Constructs a RawGetRecordsFromCollectionResponse object with default parameter values.
GetRecordsFromCollectionRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsFromCollectionRequest object with the specified parameters.
A set of output parameters for const.
A set of input parameters for const.
A set of output parameters for const.
GetRecordsFromCollectionRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsFromCollectionRequest object with the specified parameters.
GetRecordsFromCollectionRequest()
Constructs a GetRecordsFromCollectionRequest object with default parameter values.
GetRecordsFromCollectionResponse()
Constructs a GetRecordsFromCollectionResponse object with default parameter values.
std::vector< std::vector< uint8_t > > recordsBinary
std::map< std::string, std::string > options