GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
create_graph.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 __CREATE_GRAPH_H__
7 #define __CREATE_GRAPH_H__
8 
9 namespace gpudb
10 {
11 
30  {
31 
37  graphName(std::string()),
38  directedGraph(bool()),
39  nodes(std::vector<std::string>()),
40  edges(std::vector<std::string>()),
41  weights(std::vector<std::string>()),
42  restrictions(std::vector<std::string>()),
43  options(std::map<std::string, std::string>())
44  {
45  }
46 
262  CreateGraphRequest(const std::string& graphName_, const bool directedGraph_, const std::vector<std::string>& nodes_, const std::vector<std::string>& edges_, const std::vector<std::string>& weights_, const std::vector<std::string>& restrictions_, const std::map<std::string, std::string>& options_):
263  graphName( graphName_ ),
264  directedGraph( directedGraph_ ),
265  nodes( nodes_ ),
266  edges( edges_ ),
267  weights( weights_ ),
268  restrictions( restrictions_ ),
269  options( options_ )
270  {
271  }
272 
273  std::string graphName;
275  std::vector<std::string> nodes;
276  std::vector<std::string> edges;
277  std::vector<std::string> weights;
278  std::vector<std::string> restrictions;
279  std::map<std::string, std::string> options;
280  };
281 }
282 
283 namespace avro
284 {
285  template<> struct codec_traits<gpudb::CreateGraphRequest>
286  {
287  static void encode(Encoder& e, const gpudb::CreateGraphRequest& v)
288  {
289  ::avro::encode(e, v.graphName);
290  ::avro::encode(e, v.directedGraph);
291  ::avro::encode(e, v.nodes);
292  ::avro::encode(e, v.edges);
293  ::avro::encode(e, v.weights);
294  ::avro::encode(e, v.restrictions);
295  ::avro::encode(e, v.options);
296  }
297 
298  static void decode(Decoder& d, gpudb::CreateGraphRequest& v)
299  {
300  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
301  {
302  const std::vector<size_t> fo = rd->fieldOrder();
303 
304  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
305  {
306  switch (*it)
307  {
308  case 0:
309  ::avro::decode(d, v.graphName);
310  break;
311 
312  case 1:
313  ::avro::decode(d, v.directedGraph);
314  break;
315 
316  case 2:
317  ::avro::decode(d, v.nodes);
318  break;
319 
320  case 3:
321  ::avro::decode(d, v.edges);
322  break;
323 
324  case 4:
325  ::avro::decode(d, v.weights);
326  break;
327 
328  case 5:
329  ::avro::decode(d, v.restrictions);
330  break;
331 
332  case 6:
333  ::avro::decode(d, v.options);
334  break;
335 
336  default:
337  break;
338  }
339  }
340  }
341  else
342  {
343  ::avro::decode(d, v.graphName);
344  ::avro::decode(d, v.directedGraph);
345  ::avro::decode(d, v.nodes);
346  ::avro::decode(d, v.edges);
347  ::avro::decode(d, v.weights);
348  ::avro::decode(d, v.restrictions);
349  ::avro::decode(d, v.options);
350  }
351  }
352  };
353 }
354 
355 namespace gpudb
356 {
357 
376  {
377 
383  result(bool()),
384  numNodes(int64_t()),
385  numEdges(int64_t()),
386  edgesIds(std::vector<int64_t>()),
387  info(std::map<std::string, std::string>())
388  {
389  }
390 
391  bool result;
392  int64_t numNodes;
393  int64_t numEdges;
394  std::vector<int64_t> edgesIds;
395  std::map<std::string, std::string> info;
396  };
397 }
398 
399 namespace avro
400 {
401  template<> struct codec_traits<gpudb::CreateGraphResponse>
402  {
403  static void encode(Encoder& e, const gpudb::CreateGraphResponse& v)
404  {
405  ::avro::encode(e, v.result);
406  ::avro::encode(e, v.numNodes);
407  ::avro::encode(e, v.numEdges);
408  ::avro::encode(e, v.edgesIds);
409  ::avro::encode(e, v.info);
410  }
411 
412  static void decode(Decoder& d, gpudb::CreateGraphResponse& v)
413  {
414  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
415  {
416  const std::vector<size_t> fo = rd->fieldOrder();
417 
418  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
419  {
420  switch (*it)
421  {
422  case 0:
423  ::avro::decode(d, v.result);
424  break;
425 
426  case 1:
427  ::avro::decode(d, v.numNodes);
428  break;
429 
430  case 2:
431  ::avro::decode(d, v.numEdges);
432  break;
433 
434  case 3:
435  ::avro::decode(d, v.edgesIds);
436  break;
437 
438  case 4:
439  ::avro::decode(d, v.info);
440  break;
441 
442  default:
443  break;
444  }
445  }
446  }
447  else
448  {
449  ::avro::decode(d, v.result);
450  ::avro::decode(d, v.numNodes);
451  ::avro::decode(d, v.numEdges);
452  ::avro::decode(d, v.edgesIds);
453  ::avro::decode(d, v.info);
454  }
455  }
456  };
457 }
458 
459 #endif
std::vector< std::string > edges
Definition: create_graph.h:276
CreateGraphResponse()
Constructs a CreateGraphResponse object with default parameter values.
Definition: create_graph.h:382
CreateGraphRequest()
Constructs a CreateGraphRequest object with default parameter values.
Definition: create_graph.h:36
CreateGraphRequest(const std::string &graphName_, const bool directedGraph_, const std::vector< std::string > &nodes_, const std::vector< std::string > &edges_, const std::vector< std::string > &weights_, const std::vector< std::string > &restrictions_, const std::map< std::string, std::string > &options_)
Constructs a CreateGraphRequest object with the specified parameters.
Definition: create_graph.h:262
std::map< std::string, std::string > info
Definition: create_graph.h:395
A set of output parameters for const.
Definition: create_graph.h:375
std::vector< int64_t > edgesIds
Definition: create_graph.h:394
std::map< std::string, std::string > options
Definition: create_graph.h:279
std::vector< std::string > nodes
Definition: create_graph.h:275
std::vector< std::string > weights
Definition: create_graph.h:277
A set of input parameters for const.
Definition: create_graph.h:29
std::vector< std::string > restrictions
Definition: create_graph.h:278