GPUdb C++ API  Version 6.2.0.3
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 
76  GetRecordsFromCollectionRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
77  tableName( tableName_ ),
78  offset( offset_ ),
79  limit( limit_ ),
80  encoding( "binary" ),
81  options( options_ )
82  {
83  }
84 
129  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_):
130  tableName( tableName_ ),
131  offset( offset_ ),
132  limit( limit_ ),
133  encoding( encoding_ ),
134  options( options_ )
135  {
136  }
137 
138  std::string tableName;
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::GetRecordsFromCollectionRequest>
149  {
150  static void encode(Encoder& e, const gpudb::GetRecordsFromCollectionRequest& v)
151  {
152  ::avro::encode(e, v.tableName);
153  ::avro::encode(e, v.offset);
154  ::avro::encode(e, v.limit);
155  ::avro::encode(e, v.encoding);
156  ::avro::encode(e, v.options);
157  }
158 
159  static void decode(Decoder& d, gpudb::GetRecordsFromCollectionRequest& v)
160  {
161  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
162  {
163  const std::vector<size_t> fo = rd->fieldOrder();
164 
165  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
166  {
167  switch (*it)
168  {
169  case 0:
170  ::avro::decode(d, v.tableName);
171  break;
172 
173  case 1:
174  ::avro::decode(d, v.offset);
175  break;
176 
177  case 2:
178  ::avro::decode(d, v.limit);
179  break;
180 
181  case 3:
182  ::avro::decode(d, v.encoding);
183  break;
184 
185  case 4:
186  ::avro::decode(d, v.options);
187  break;
188 
189  default:
190  break;
191  }
192  }
193  }
194  else
195  {
196  ::avro::decode(d, v.tableName);
197  ::avro::decode(d, v.offset);
198  ::avro::decode(d, v.limit);
199  ::avro::decode(d, v.encoding);
200  ::avro::decode(d, v.options);
201  }
202  }
203  };
204 }
205 
206 namespace gpudb
207 {
208 
224  {
225 
231  tableName(std::string()),
232  typeNames(std::vector<std::string>()),
233  recordsBinary(std::vector<std::vector<uint8_t> >()),
234  recordsJson(std::vector<std::string>()),
235  recordIds(std::vector<std::string>())
236  {
237  }
238 
239  std::string tableName;
240  std::vector<std::string> typeNames;
241  std::vector<std::vector<uint8_t> > recordsBinary;
242  std::vector<std::string> recordsJson;
243  std::vector<std::string> recordIds;
244  };
245 }
246 
247 namespace avro
248 {
249  template<> struct codec_traits<gpudb::RawGetRecordsFromCollectionResponse>
250  {
251  static void encode(Encoder& e, const gpudb::RawGetRecordsFromCollectionResponse& v)
252  {
253  ::avro::encode(e, v.tableName);
254  ::avro::encode(e, v.typeNames);
255  ::avro::encode(e, v.recordsBinary);
256  ::avro::encode(e, v.recordsJson);
257  ::avro::encode(e, v.recordIds);
258  }
259 
260  static void decode(Decoder& d, gpudb::RawGetRecordsFromCollectionResponse& v)
261  {
262  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
263  {
264  const std::vector<size_t> fo = rd->fieldOrder();
265 
266  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
267  {
268  switch (*it)
269  {
270  case 0:
271  ::avro::decode(d, v.tableName);
272  break;
273 
274  case 1:
275  ::avro::decode(d, v.typeNames);
276  break;
277 
278  case 2:
279  ::avro::decode(d, v.recordsBinary);
280  break;
281 
282  case 3:
283  ::avro::decode(d, v.recordsJson);
284  break;
285 
286  case 4:
287  ::avro::decode(d, v.recordIds);
288  break;
289 
290  default:
291  break;
292  }
293  }
294  }
295  else
296  {
297  ::avro::decode(d, v.tableName);
298  ::avro::decode(d, v.typeNames);
299  ::avro::decode(d, v.recordsBinary);
300  ::avro::decode(d, v.recordsJson);
301  ::avro::decode(d, v.recordIds);
302  }
303  }
304  };
305 }
306 
307 namespace gpudb
308 {
309 
327  template<typename T> struct GetRecordsFromCollectionResponse
328  {
329 
335  tableName(std::string()),
336  typeNames(std::vector<std::string>()),
337  data(std::vector<T>()),
338  recordIds(std::vector<std::string>())
339  {
340  }
341 
342  std::string tableName;
343  std::vector<std::string> typeNames;
344  std::vector<T> data;
345  std::vector<std::string> recordIds;
346  };
347 }
348 
349 #endif
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 getRecordsFromCollection(const GetRecordsFromCollectionRequest&) const...
A set of input parameters for getRecordsFromCollectionRaw(const GetRecordsFromCollectionRequest&) con...
A set of output parameters for getRecordsFromCollectionRaw(const GetRecordsFromCollectionRequest&) co...
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