GPUdb C++ API  Version 5.2.0.0
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 
68  GetRecordsFromCollectionRequest(const std::string& tableName, const int64_t offset, const int64_t limit, const std::map<std::string, std::string>& options):
69  tableName(tableName),
70  offset(offset),
71  limit(limit),
72  encoding("binary"),
73  options(options)
74  {
75  }
76 
107  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):
108  tableName(tableName),
109  offset(offset),
110  limit(limit),
111  encoding(encoding),
112  options(options)
113  {
114  }
115 
116  std::string tableName;
117  int64_t offset;
118  int64_t limit;
119  std::string encoding;
120  std::map<std::string, std::string> options;
121  };
122 }
123 
124 namespace avro
125 {
126  template<> struct codec_traits<gpudb::GetRecordsFromCollectionRequest>
127  {
128  static void encode(Encoder& e, const gpudb::GetRecordsFromCollectionRequest& v)
129  {
130  ::avro::encode(e, v.tableName);
131  ::avro::encode(e, v.offset);
132  ::avro::encode(e, v.limit);
133  ::avro::encode(e, v.encoding);
134  ::avro::encode(e, v.options);
135  }
136 
137  static void decode(Decoder& d, gpudb::GetRecordsFromCollectionRequest& v)
138  {
139  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
140  {
141  const std::vector<size_t> fo = rd->fieldOrder();
142 
143  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
144  {
145  switch (*it)
146  {
147  case 0:
148  ::avro::decode(d, v.tableName);
149  break;
150 
151  case 1:
152  ::avro::decode(d, v.offset);
153  break;
154 
155  case 2:
156  ::avro::decode(d, v.limit);
157  break;
158 
159  case 3:
160  ::avro::decode(d, v.encoding);
161  break;
162 
163  case 4:
164  ::avro::decode(d, v.options);
165  break;
166 
167  default:
168  break;
169  }
170  }
171  }
172  else
173  {
174  ::avro::decode(d, v.tableName);
175  ::avro::decode(d, v.offset);
176  ::avro::decode(d, v.limit);
177  ::avro::decode(d, v.encoding);
178  ::avro::decode(d, v.options);
179  }
180  }
181  };
182 }
183 
184 namespace gpudb
185 {
186 
202  {
203 
209  tableName(std::string()),
210  typeNames(std::vector<std::string>()),
211  recordsBinary(std::vector<std::vector<uint8_t> >()),
212  recordsJson(std::vector<std::string>()),
213  recordIds(std::vector<std::string>())
214  {
215  }
216 
217  std::string tableName;
218  std::vector<std::string> typeNames;
219  std::vector<std::vector<uint8_t> > recordsBinary;
220  std::vector<std::string> recordsJson;
221  std::vector<std::string> recordIds;
222  };
223 }
224 
225 namespace avro
226 {
227  template<> struct codec_traits<gpudb::RawGetRecordsFromCollectionResponse>
228  {
229  static void encode(Encoder& e, const gpudb::RawGetRecordsFromCollectionResponse& v)
230  {
231  ::avro::encode(e, v.tableName);
232  ::avro::encode(e, v.typeNames);
233  ::avro::encode(e, v.recordsBinary);
234  ::avro::encode(e, v.recordsJson);
235  ::avro::encode(e, v.recordIds);
236  }
237 
238  static void decode(Decoder& d, gpudb::RawGetRecordsFromCollectionResponse& v)
239  {
240  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
241  {
242  const std::vector<size_t> fo = rd->fieldOrder();
243 
244  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
245  {
246  switch (*it)
247  {
248  case 0:
249  ::avro::decode(d, v.tableName);
250  break;
251 
252  case 1:
253  ::avro::decode(d, v.typeNames);
254  break;
255 
256  case 2:
257  ::avro::decode(d, v.recordsBinary);
258  break;
259 
260  case 3:
261  ::avro::decode(d, v.recordsJson);
262  break;
263 
264  case 4:
265  ::avro::decode(d, v.recordIds);
266  break;
267 
268  default:
269  break;
270  }
271  }
272  }
273  else
274  {
275  ::avro::decode(d, v.tableName);
276  ::avro::decode(d, v.typeNames);
277  ::avro::decode(d, v.recordsBinary);
278  ::avro::decode(d, v.recordsJson);
279  ::avro::decode(d, v.recordIds);
280  }
281  }
282  };
283 }
284 
285 namespace gpudb
286 {
287 
305  template<typename T> struct GetRecordsFromCollectionResponse
306  {
307 
313  tableName(std::string()),
314  typeNames(std::vector<std::string>()),
315  data(std::vector<T>()),
316  recordIds(std::vector<std::string>())
317  {
318  }
319 
320  std::string tableName;
321  std::vector<std::string> typeNames;
322  std::vector<T> data;
323  std::vector<std::string> recordIds;
324  };
325 }
326 
327 #endif
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.
RawGetRecordsFromCollectionResponse()
Constructs a RawGetRecordsFromCollectionResponse object with default parameter values.
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()
Constructs a GetRecordsFromCollectionRequest object with default parameter values.
GetRecordsFromCollectionResponse()
Constructs a GetRecordsFromCollectionResponse object with default parameter values.
std::vector< std::vector< uint8_t > > recordsBinary
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.
std::map< std::string, std::string > options