GPUdb C++ API  Version 7.0.19.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 
305  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_):
306  graphName( graphName_ ),
307  directedGraph( directedGraph_ ),
308  nodes( nodes_ ),
309  edges( edges_ ),
310  weights( weights_ ),
311  restrictions( restrictions_ ),
312  options( options_ )
313  {
314  }
315 
316  std::string graphName;
318  std::vector<std::string> nodes;
319  std::vector<std::string> edges;
320  std::vector<std::string> weights;
321  std::vector<std::string> restrictions;
322  std::map<std::string, std::string> options;
323  };
324 }
325 
326 namespace avro
327 {
328  template<> struct codec_traits<gpudb::CreateGraphRequest>
329  {
330  static void encode(Encoder& e, const gpudb::CreateGraphRequest& v)
331  {
332  ::avro::encode(e, v.graphName);
333  ::avro::encode(e, v.directedGraph);
334  ::avro::encode(e, v.nodes);
335  ::avro::encode(e, v.edges);
336  ::avro::encode(e, v.weights);
337  ::avro::encode(e, v.restrictions);
338  ::avro::encode(e, v.options);
339  }
340 
341  static void decode(Decoder& d, gpudb::CreateGraphRequest& v)
342  {
343  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
344  {
345  const std::vector<size_t> fo = rd->fieldOrder();
346 
347  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
348  {
349  switch (*it)
350  {
351  case 0:
352  ::avro::decode(d, v.graphName);
353  break;
354 
355  case 1:
356  ::avro::decode(d, v.directedGraph);
357  break;
358 
359  case 2:
360  ::avro::decode(d, v.nodes);
361  break;
362 
363  case 3:
364  ::avro::decode(d, v.edges);
365  break;
366 
367  case 4:
368  ::avro::decode(d, v.weights);
369  break;
370 
371  case 5:
372  ::avro::decode(d, v.restrictions);
373  break;
374 
375  case 6:
376  ::avro::decode(d, v.options);
377  break;
378 
379  default:
380  break;
381  }
382  }
383  }
384  else
385  {
386  ::avro::decode(d, v.graphName);
387  ::avro::decode(d, v.directedGraph);
388  ::avro::decode(d, v.nodes);
389  ::avro::decode(d, v.edges);
390  ::avro::decode(d, v.weights);
391  ::avro::decode(d, v.restrictions);
392  ::avro::decode(d, v.options);
393  }
394  }
395  };
396 }
397 
398 namespace gpudb
399 {
400 
419  {
420 
426  numNodes(int64_t()),
427  numEdges(int64_t()),
428  edgesIds(std::vector<int64_t>()),
429  info(std::map<std::string, std::string>())
430  {
431  }
432 
433  int64_t numNodes;
434  int64_t numEdges;
435  std::vector<int64_t> edgesIds;
436  std::map<std::string, std::string> info;
437  };
438 }
439 
440 namespace avro
441 {
442  template<> struct codec_traits<gpudb::CreateGraphResponse>
443  {
444  static void encode(Encoder& e, const gpudb::CreateGraphResponse& v)
445  {
446  ::avro::encode(e, v.numNodes);
447  ::avro::encode(e, v.numEdges);
448  ::avro::encode(e, v.edgesIds);
449  ::avro::encode(e, v.info);
450  }
451 
452  static void decode(Decoder& d, gpudb::CreateGraphResponse& v)
453  {
454  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
455  {
456  const std::vector<size_t> fo = rd->fieldOrder();
457 
458  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
459  {
460  switch (*it)
461  {
462  case 0:
463  ::avro::decode(d, v.numNodes);
464  break;
465 
466  case 1:
467  ::avro::decode(d, v.numEdges);
468  break;
469 
470  case 2:
471  ::avro::decode(d, v.edgesIds);
472  break;
473 
474  case 3:
475  ::avro::decode(d, v.info);
476  break;
477 
478  default:
479  break;
480  }
481  }
482  }
483  else
484  {
485  ::avro::decode(d, v.numNodes);
486  ::avro::decode(d, v.numEdges);
487  ::avro::decode(d, v.edgesIds);
488  ::avro::decode(d, v.info);
489  }
490  }
491  };
492 }
493 
494 #endif
std::vector< std::string > edges
Definition: create_graph.h:319
CreateGraphResponse()
Constructs a CreateGraphResponse object with default parameter values.
Definition: create_graph.h:425
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:305
std::map< std::string, std::string > info
Definition: create_graph.h:436
A set of output parameters for const.
Definition: create_graph.h:418
std::vector< int64_t > edgesIds
Definition: create_graph.h:435
std::map< std::string, std::string > options
Definition: create_graph.h:322
std::vector< std::string > nodes
Definition: create_graph.h:318
std::vector< std::string > weights
Definition: create_graph.h:320
A set of input parameters for const.
Definition: create_graph.h:29
std::vector< std::string > restrictions
Definition: create_graph.h:321