GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
74  GetRecordsFromCollectionRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
75  tableName( tableName_ ),
76  offset( offset_ ),
77  limit( limit_ ),
78  encoding( "binary" ),
79  options( options_ )
80  {
81  }
82 
123  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_):
124  tableName( tableName_ ),
125  offset( offset_ ),
126  limit( limit_ ),
127  encoding( encoding_ ),
128  options( options_ )
129  {
130  }
131 
132  std::string tableName;
133  int64_t offset;
134  int64_t limit;
135  std::string encoding;
136  std::map<std::string, std::string> options;
137  };
138 }
139 
140 namespace avro
141 {
142  template<> struct codec_traits<gpudb::GetRecordsFromCollectionRequest>
143  {
144  static void encode(Encoder& e, const gpudb::GetRecordsFromCollectionRequest& v)
145  {
146  ::avro::encode(e, v.tableName);
147  ::avro::encode(e, v.offset);
148  ::avro::encode(e, v.limit);
149  ::avro::encode(e, v.encoding);
150  ::avro::encode(e, v.options);
151  }
152 
153  static void decode(Decoder& d, gpudb::GetRecordsFromCollectionRequest& v)
154  {
155  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
156  {
157  const std::vector<size_t> fo = rd->fieldOrder();
158 
159  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
160  {
161  switch (*it)
162  {
163  case 0:
164  ::avro::decode(d, v.tableName);
165  break;
166 
167  case 1:
168  ::avro::decode(d, v.offset);
169  break;
170 
171  case 2:
172  ::avro::decode(d, v.limit);
173  break;
174 
175  case 3:
176  ::avro::decode(d, v.encoding);
177  break;
178 
179  case 4:
180  ::avro::decode(d, v.options);
181  break;
182 
183  default:
184  break;
185  }
186  }
187  }
188  else
189  {
190  ::avro::decode(d, v.tableName);
191  ::avro::decode(d, v.offset);
192  ::avro::decode(d, v.limit);
193  ::avro::decode(d, v.encoding);
194  ::avro::decode(d, v.options);
195  }
196  }
197  };
198 }
199 
200 namespace gpudb
201 {
202 
218  {
219 
225  tableName(std::string()),
226  typeNames(std::vector<std::string>()),
227  recordsBinary(std::vector<std::vector<uint8_t> >()),
228  recordsJson(std::vector<std::string>()),
229  recordIds(std::vector<std::string>())
230  {
231  }
232 
233  std::string tableName;
234  std::vector<std::string> typeNames;
235  std::vector<std::vector<uint8_t> > recordsBinary;
236  std::vector<std::string> recordsJson;
237  std::vector<std::string> recordIds;
238  };
239 }
240 
241 namespace avro
242 {
243  template<> struct codec_traits<gpudb::RawGetRecordsFromCollectionResponse>
244  {
245  static void encode(Encoder& e, const gpudb::RawGetRecordsFromCollectionResponse& v)
246  {
247  ::avro::encode(e, v.tableName);
248  ::avro::encode(e, v.typeNames);
249  ::avro::encode(e, v.recordsBinary);
250  ::avro::encode(e, v.recordsJson);
251  ::avro::encode(e, v.recordIds);
252  }
253 
254  static void decode(Decoder& d, gpudb::RawGetRecordsFromCollectionResponse& v)
255  {
256  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
257  {
258  const std::vector<size_t> fo = rd->fieldOrder();
259 
260  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
261  {
262  switch (*it)
263  {
264  case 0:
265  ::avro::decode(d, v.tableName);
266  break;
267 
268  case 1:
269  ::avro::decode(d, v.typeNames);
270  break;
271 
272  case 2:
273  ::avro::decode(d, v.recordsBinary);
274  break;
275 
276  case 3:
277  ::avro::decode(d, v.recordsJson);
278  break;
279 
280  case 4:
281  ::avro::decode(d, v.recordIds);
282  break;
283 
284  default:
285  break;
286  }
287  }
288  }
289  else
290  {
291  ::avro::decode(d, v.tableName);
292  ::avro::decode(d, v.typeNames);
293  ::avro::decode(d, v.recordsBinary);
294  ::avro::decode(d, v.recordsJson);
295  ::avro::decode(d, v.recordIds);
296  }
297  }
298  };
299 }
300 
301 namespace gpudb
302 {
303 
321  template<typename T> struct GetRecordsFromCollectionResponse
322  {
323 
329  tableName(std::string()),
330  typeNames(std::vector<std::string>()),
331  data(std::vector<T>()),
332  recordIds(std::vector<std::string>())
333  {
334  }
335 
336  std::string tableName;
337  std::vector<std::string> typeNames;
338  std::vector<T> data;
339  std::vector<std::string> recordIds;
340  };
341 }
342 
343 #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 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