GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solve_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 __SOLVE_GRAPH_H__
7 #define __SOLVE_GRAPH_H__
8 
9 namespace gpudb
10 {
11 
33  {
34 
39  graphName(std::string()),
40  weightsOnEdges(std::vector<std::string>()),
41  restrictions(std::vector<std::string>()),
42  solverType(std::string()),
43  sourceNodes(std::vector<std::string>()),
44  destinationNodes(std::vector<std::string>()),
45  solutionTable(std::string()),
46  options(std::map<std::string, std::string>())
47  {
48  }
49 
350  SolveGraphRequest(const std::string& graphName_, const std::vector<std::string>& weightsOnEdges_, const std::vector<std::string>& restrictions_, const std::string& solverType_, const std::vector<std::string>& sourceNodes_, const std::vector<std::string>& destinationNodes_, const std::string& solutionTable_, const std::map<std::string, std::string>& options_):
351  graphName( graphName_ ),
352  weightsOnEdges( weightsOnEdges_ ),
353  restrictions( restrictions_ ),
354  solverType( solverType_ ),
355  sourceNodes( sourceNodes_ ),
356  destinationNodes( destinationNodes_ ),
357  solutionTable( solutionTable_ ),
358  options( options_ )
359  {
360  }
361 
362  std::string graphName;
363  std::vector<std::string> weightsOnEdges;
364  std::vector<std::string> restrictions;
365  std::string solverType;
366  std::vector<std::string> sourceNodes;
367  std::vector<std::string> destinationNodes;
368  std::string solutionTable;
369  std::map<std::string, std::string> options;
370  };
371 }
372 
373 namespace avro
374 {
375  template<> struct codec_traits<gpudb::SolveGraphRequest>
376  {
377  static void encode(Encoder& e, const gpudb::SolveGraphRequest& v)
378  {
379  ::avro::encode(e, v.graphName);
380  ::avro::encode(e, v.weightsOnEdges);
381  ::avro::encode(e, v.restrictions);
382  ::avro::encode(e, v.solverType);
383  ::avro::encode(e, v.sourceNodes);
384  ::avro::encode(e, v.destinationNodes);
385  ::avro::encode(e, v.solutionTable);
386  ::avro::encode(e, v.options);
387  }
388 
389  static void decode(Decoder& d, gpudb::SolveGraphRequest& v)
390  {
391  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
392  {
393  const std::vector<size_t> fo = rd->fieldOrder();
394 
395  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
396  {
397  switch (*it)
398  {
399  case 0:
400  ::avro::decode(d, v.graphName);
401  break;
402 
403  case 1:
404  ::avro::decode(d, v.weightsOnEdges);
405  break;
406 
407  case 2:
408  ::avro::decode(d, v.restrictions);
409  break;
410 
411  case 3:
412  ::avro::decode(d, v.solverType);
413  break;
414 
415  case 4:
416  ::avro::decode(d, v.sourceNodes);
417  break;
418 
419  case 5:
420  ::avro::decode(d, v.destinationNodes);
421  break;
422 
423  case 6:
424  ::avro::decode(d, v.solutionTable);
425  break;
426 
427  case 7:
428  ::avro::decode(d, v.options);
429  break;
430 
431  default:
432  break;
433  }
434  }
435  }
436  else
437  {
438  ::avro::decode(d, v.graphName);
439  ::avro::decode(d, v.weightsOnEdges);
440  ::avro::decode(d, v.restrictions);
441  ::avro::decode(d, v.solverType);
442  ::avro::decode(d, v.sourceNodes);
443  ::avro::decode(d, v.destinationNodes);
444  ::avro::decode(d, v.solutionTable);
445  ::avro::decode(d, v.options);
446  }
447  }
448  };
449 }
450 
451 namespace gpudb
452 {
453 
475  {
476 
482  result(bool()),
483  resultPerDestinationNode(std::vector<float>()),
484  info(std::map<std::string, std::string>())
485  {
486  }
487 
488  bool result;
489  std::vector<float> resultPerDestinationNode;
490  std::map<std::string, std::string> info;
491  };
492 }
493 
494 namespace avro
495 {
496  template<> struct codec_traits<gpudb::SolveGraphResponse>
497  {
498  static void encode(Encoder& e, const gpudb::SolveGraphResponse& v)
499  {
500  ::avro::encode(e, v.result);
501  ::avro::encode(e, v.resultPerDestinationNode);
502  ::avro::encode(e, v.info);
503  }
504 
505  static void decode(Decoder& d, gpudb::SolveGraphResponse& v)
506  {
507  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
508  {
509  const std::vector<size_t> fo = rd->fieldOrder();
510 
511  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
512  {
513  switch (*it)
514  {
515  case 0:
516  ::avro::decode(d, v.result);
517  break;
518 
519  case 1:
520  ::avro::decode(d, v.resultPerDestinationNode);
521  break;
522 
523  case 2:
524  ::avro::decode(d, v.info);
525  break;
526 
527  default:
528  break;
529  }
530  }
531  }
532  else
533  {
534  ::avro::decode(d, v.result);
535  ::avro::decode(d, v.resultPerDestinationNode);
536  ::avro::decode(d, v.info);
537  }
538  }
539  };
540 }
541 
542 #endif
std::vector< std::string > weightsOnEdges
Definition: solve_graph.h:363
SolveGraphRequest()
Constructs a SolveGraphRequest object with default parameter values.
Definition: solve_graph.h:38
std::map< std::string, std::string > info
Definition: solve_graph.h:490
A set of input parameters for const.
Definition: solve_graph.h:32
std::map< std::string, std::string > options
Definition: solve_graph.h:369
std::vector< float > resultPerDestinationNode
Definition: solve_graph.h:489
SolveGraphResponse()
Constructs a SolveGraphResponse object with default parameter values.
Definition: solve_graph.h:481
std::vector< std::string > restrictions
Definition: solve_graph.h:364
SolveGraphRequest(const std::string &graphName_, const std::vector< std::string > &weightsOnEdges_, const std::vector< std::string > &restrictions_, const std::string &solverType_, const std::vector< std::string > &sourceNodes_, const std::vector< std::string > &destinationNodes_, const std::string &solutionTable_, const std::map< std::string, std::string > &options_)
Constructs a SolveGraphRequest object with the specified parameters.
Definition: solve_graph.h:350
std::vector< std::string > destinationNodes
Definition: solve_graph.h:367
std::vector< std::string > sourceNodes
Definition: solve_graph.h:366
A set of output parameters for const.
Definition: solve_graph.h:474