GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
merge_records.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 __MERGE_RECORDS_H__
7 #define __MERGE_RECORDS_H__
8 
9 namespace gpudb
10 {
11 
34  {
35 
41  tableName(std::string()),
42  sourceTableNames(std::vector<std::string>()),
43  fieldMaps(std::vector<std::map<std::string, std::string> >()),
44  options(std::map<std::string, std::string>())
45  {
46  }
47 
152  MergeRecordsRequest(const std::string& tableName_, const std::vector<std::string>& sourceTableNames_, const std::vector<std::map<std::string, std::string> >& fieldMaps_, const std::map<std::string, std::string>& options_):
153  tableName( tableName_ ),
154  sourceTableNames( sourceTableNames_ ),
155  fieldMaps( fieldMaps_ ),
156  options( options_ )
157  {
158  }
159 
160  std::string tableName;
161  std::vector<std::string> sourceTableNames;
162  std::vector<std::map<std::string, std::string> > fieldMaps;
163  std::map<std::string, std::string> options;
164  };
165 }
166 
167 namespace avro
168 {
169  template<> struct codec_traits<gpudb::MergeRecordsRequest>
170  {
171  static void encode(Encoder& e, const gpudb::MergeRecordsRequest& v)
172  {
173  ::avro::encode(e, v.tableName);
174  ::avro::encode(e, v.sourceTableNames);
175  ::avro::encode(e, v.fieldMaps);
176  ::avro::encode(e, v.options);
177  }
178 
179  static void decode(Decoder& d, gpudb::MergeRecordsRequest& v)
180  {
181  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
182  {
183  const std::vector<size_t> fo = rd->fieldOrder();
184 
185  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
186  {
187  switch (*it)
188  {
189  case 0:
190  ::avro::decode(d, v.tableName);
191  break;
192 
193  case 1:
194  ::avro::decode(d, v.sourceTableNames);
195  break;
196 
197  case 2:
198  ::avro::decode(d, v.fieldMaps);
199  break;
200 
201  case 3:
202  ::avro::decode(d, v.options);
203  break;
204 
205  default:
206  break;
207  }
208  }
209  }
210  else
211  {
212  ::avro::decode(d, v.tableName);
213  ::avro::decode(d, v.sourceTableNames);
214  ::avro::decode(d, v.fieldMaps);
215  ::avro::decode(d, v.options);
216  }
217  }
218  };
219 }
220 
221 namespace gpudb
222 {
223 
246  {
247 
253  tableName(std::string()),
254  info(std::map<std::string, std::string>())
255  {
256  }
257 
258  std::string tableName;
259  std::map<std::string, std::string> info;
260  };
261 }
262 
263 namespace avro
264 {
265  template<> struct codec_traits<gpudb::MergeRecordsResponse>
266  {
267  static void encode(Encoder& e, const gpudb::MergeRecordsResponse& v)
268  {
269  ::avro::encode(e, v.tableName);
270  ::avro::encode(e, v.info);
271  }
272 
273  static void decode(Decoder& d, gpudb::MergeRecordsResponse& 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.info);
289  break;
290 
291  default:
292  break;
293  }
294  }
295  }
296  else
297  {
298  ::avro::decode(d, v.tableName);
299  ::avro::decode(d, v.info);
300  }
301  }
302  };
303 }
304 
305 #endif
MergeRecordsRequest(const std::string &tableName_, const std::vector< std::string > &sourceTableNames_, const std::vector< std::map< std::string, std::string > > &fieldMaps_, const std::map< std::string, std::string > &options_)
Constructs a MergeRecordsRequest object with the specified parameters.
std::map< std::string, std::string > options
MergeRecordsRequest()
Constructs a MergeRecordsRequest object with default parameter values.
Definition: merge_records.h:40
A set of output parameters for const.
std::vector< std::string > sourceTableNames
A set of input parameters for const.
Definition: merge_records.h:33
std::vector< std::map< std::string, std::string > > fieldMaps
std::map< std::string, std::string > info
MergeRecordsResponse()
Constructs a MergeRecordsResponse object with default parameter values.