GPUdb C++ API  Version 7.2.2.4
create_graph.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __CREATE_GRAPH_H__
7 #define __CREATE_GRAPH_H__
8 
9 namespace gpudb
10 {
27  {
32  graphName(std::string()),
33  directedGraph(bool()),
34  nodes(std::vector<std::string>()),
35  edges(std::vector<std::string>()),
36  weights(std::vector<std::string>()),
37  restrictions(std::vector<std::string>()),
38  options(std::map<std::string, std::string>())
39  {
40  }
41 
309  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_):
310  graphName( graphName_ ),
311  directedGraph( directedGraph_ ),
312  nodes( nodes_ ),
313  edges( edges_ ),
314  weights( weights_ ),
315  restrictions( restrictions_ ),
316  options( options_ )
317  {
318  }
319 
323  std::string graphName;
324 
339 
353  std::vector<std::string> nodes;
354 
368  std::vector<std::string> edges;
369 
384  std::vector<std::string> weights;
385 
400  std::vector<std::string> restrictions;
401 
527  std::map<std::string, std::string> options;
528  };
529 } // end namespace gpudb
530 
531 namespace avro
532 {
533  template<> struct codec_traits<gpudb::CreateGraphRequest>
534  {
535  static void encode(Encoder& e, const gpudb::CreateGraphRequest& v)
536  {
537  ::avro::encode(e, v.graphName);
538  ::avro::encode(e, v.directedGraph);
539  ::avro::encode(e, v.nodes);
540  ::avro::encode(e, v.edges);
541  ::avro::encode(e, v.weights);
542  ::avro::encode(e, v.restrictions);
543  ::avro::encode(e, v.options);
544  }
545 
546  static void decode(Decoder& d, gpudb::CreateGraphRequest& v)
547  {
548  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
549  {
550  const std::vector<size_t> fo = rd->fieldOrder();
551 
552  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
553  {
554  switch (*it)
555  {
556  case 0:
557  ::avro::decode(d, v.graphName);
558  break;
559 
560  case 1:
561  ::avro::decode(d, v.directedGraph);
562  break;
563 
564  case 2:
565  ::avro::decode(d, v.nodes);
566  break;
567 
568  case 3:
569  ::avro::decode(d, v.edges);
570  break;
571 
572  case 4:
573  ::avro::decode(d, v.weights);
574  break;
575 
576  case 5:
577  ::avro::decode(d, v.restrictions);
578  break;
579 
580  case 6:
581  ::avro::decode(d, v.options);
582  break;
583 
584  default:
585  break;
586  }
587  }
588  }
589  else
590  {
591  ::avro::decode(d, v.graphName);
592  ::avro::decode(d, v.directedGraph);
593  ::avro::decode(d, v.nodes);
594  ::avro::decode(d, v.edges);
595  ::avro::decode(d, v.weights);
596  ::avro::decode(d, v.restrictions);
597  ::avro::decode(d, v.options);
598  }
599  }
600  };
601 } // end namespace avro
602 
603 namespace gpudb
604 {
611  {
616  result(bool()),
617  numNodes(int64_t()),
618  numEdges(int64_t()),
619  edgesIds(std::vector<int64_t>()),
620  info(std::map<std::string, std::string>())
621  {
622  }
623 
627  bool result;
628 
632  int64_t numNodes;
633 
637  int64_t numEdges;
638 
643  std::vector<int64_t> edgesIds;
644 
648  std::map<std::string, std::string> info;
649  };
650 } // end namespace gpudb
651 
652 namespace avro
653 {
654  template<> struct codec_traits<gpudb::CreateGraphResponse>
655  {
656  static void encode(Encoder& e, const gpudb::CreateGraphResponse& v)
657  {
658  ::avro::encode(e, v.result);
659  ::avro::encode(e, v.numNodes);
660  ::avro::encode(e, v.numEdges);
661  ::avro::encode(e, v.edgesIds);
662  ::avro::encode(e, v.info);
663  }
664 
665  static void decode(Decoder& d, gpudb::CreateGraphResponse& v)
666  {
667  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
668  {
669  const std::vector<size_t> fo = rd->fieldOrder();
670 
671  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
672  {
673  switch (*it)
674  {
675  case 0:
676  ::avro::decode(d, v.result);
677  break;
678 
679  case 1:
680  ::avro::decode(d, v.numNodes);
681  break;
682 
683  case 2:
684  ::avro::decode(d, v.numEdges);
685  break;
686 
687  case 3:
688  ::avro::decode(d, v.edgesIds);
689  break;
690 
691  case 4:
692  ::avro::decode(d, v.info);
693  break;
694 
695  default:
696  break;
697  }
698  }
699  }
700  else
701  {
702  ::avro::decode(d, v.result);
703  ::avro::decode(d, v.numNodes);
704  ::avro::decode(d, v.numEdges);
705  ::avro::decode(d, v.edgesIds);
706  ::avro::decode(d, v.info);
707  }
708  }
709  };
710 } // end namespace avro
711 
712 #endif // __CREATE_GRAPH_H__
std::vector< std::string > edges
Edges represent the required fundamental topological unit of a graph that typically connect nodes.
Definition: create_graph.h:368
CreateGraphResponse()
Constructs a CreateGraphResponse object with default parameters.
Definition: create_graph.h:615
int64_t numNodes
Total number of nodes created.
Definition: create_graph.h:632
std::string graphName
Name of the graph resource to generate.
Definition: create_graph.h:323
bool result
Indicates a successful creation on all servers.
Definition: create_graph.h:627
CreateGraphRequest()
Constructs a CreateGraphRequest object with default parameters.
Definition: create_graph.h:31
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:309
std::map< std::string, std::string > info
Additional information.
Definition: create_graph.h:648
A set of results returned by GPUdb::createGraph.
Definition: create_graph.h:610
std::vector< int64_t > edgesIds
[Deprecated] Edges given as pairs of node indices.
Definition: create_graph.h:643
std::map< std::string, std::string > options
Optional parameters.
Definition: create_graph.h:527
std::vector< std::string > nodes
Nodes represent fundamental topological units of a graph.
Definition: create_graph.h:353
std::vector< std::string > weights
Weights represent a method of informing the graph solver of the cost of including a given edge in a s...
Definition: create_graph.h:384
A set of parameters for GPUdb::createGraph.
Definition: create_graph.h:26
bool directedGraph
If set to true, the graph will be directed.
Definition: create_graph.h:338
int64_t numEdges
Total number of edges created.
Definition: create_graph.h:637
std::vector< std::string > restrictions
Restrictions represent a method of informing the graph solver which edges and/or nodes should be igno...
Definition: create_graph.h:400