GPUdb C++ API  Version 7.0.19.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 
325  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_):
326  graphName( graphName_ ),
327  weightsOnEdges( weightsOnEdges_ ),
328  restrictions( restrictions_ ),
329  solverType( solverType_ ),
330  sourceNodes( sourceNodes_ ),
331  destinationNodes( destinationNodes_ ),
332  solutionTable( solutionTable_ ),
333  options( options_ )
334  {
335  }
336 
337  std::string graphName;
338  std::vector<std::string> weightsOnEdges;
339  std::vector<std::string> restrictions;
340  std::string solverType;
341  std::vector<std::string> sourceNodes;
342  std::vector<std::string> destinationNodes;
343  std::string solutionTable;
344  std::map<std::string, std::string> options;
345  };
346 }
347 
348 namespace avro
349 {
350  template<> struct codec_traits<gpudb::SolveGraphRequest>
351  {
352  static void encode(Encoder& e, const gpudb::SolveGraphRequest& v)
353  {
354  ::avro::encode(e, v.graphName);
355  ::avro::encode(e, v.weightsOnEdges);
356  ::avro::encode(e, v.restrictions);
357  ::avro::encode(e, v.solverType);
358  ::avro::encode(e, v.sourceNodes);
359  ::avro::encode(e, v.destinationNodes);
360  ::avro::encode(e, v.solutionTable);
361  ::avro::encode(e, v.options);
362  }
363 
364  static void decode(Decoder& d, gpudb::SolveGraphRequest& v)
365  {
366  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
367  {
368  const std::vector<size_t> fo = rd->fieldOrder();
369 
370  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
371  {
372  switch (*it)
373  {
374  case 0:
375  ::avro::decode(d, v.graphName);
376  break;
377 
378  case 1:
379  ::avro::decode(d, v.weightsOnEdges);
380  break;
381 
382  case 2:
383  ::avro::decode(d, v.restrictions);
384  break;
385 
386  case 3:
387  ::avro::decode(d, v.solverType);
388  break;
389 
390  case 4:
391  ::avro::decode(d, v.sourceNodes);
392  break;
393 
394  case 5:
395  ::avro::decode(d, v.destinationNodes);
396  break;
397 
398  case 6:
399  ::avro::decode(d, v.solutionTable);
400  break;
401 
402  case 7:
403  ::avro::decode(d, v.options);
404  break;
405 
406  default:
407  break;
408  }
409  }
410  }
411  else
412  {
413  ::avro::decode(d, v.graphName);
414  ::avro::decode(d, v.weightsOnEdges);
415  ::avro::decode(d, v.restrictions);
416  ::avro::decode(d, v.solverType);
417  ::avro::decode(d, v.sourceNodes);
418  ::avro::decode(d, v.destinationNodes);
419  ::avro::decode(d, v.solutionTable);
420  ::avro::decode(d, v.options);
421  }
422  }
423  };
424 }
425 
426 namespace gpudb
427 {
428 
450  {
451 
457  result(bool()),
458  resultPerDestinationNode(std::vector<float>()),
459  info(std::map<std::string, std::string>())
460  {
461  }
462 
463  bool result;
464  std::vector<float> resultPerDestinationNode;
465  std::map<std::string, std::string> info;
466  };
467 }
468 
469 namespace avro
470 {
471  template<> struct codec_traits<gpudb::SolveGraphResponse>
472  {
473  static void encode(Encoder& e, const gpudb::SolveGraphResponse& v)
474  {
475  ::avro::encode(e, v.result);
476  ::avro::encode(e, v.resultPerDestinationNode);
477  ::avro::encode(e, v.info);
478  }
479 
480  static void decode(Decoder& d, gpudb::SolveGraphResponse& v)
481  {
482  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
483  {
484  const std::vector<size_t> fo = rd->fieldOrder();
485 
486  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
487  {
488  switch (*it)
489  {
490  case 0:
491  ::avro::decode(d, v.result);
492  break;
493 
494  case 1:
495  ::avro::decode(d, v.resultPerDestinationNode);
496  break;
497 
498  case 2:
499  ::avro::decode(d, v.info);
500  break;
501 
502  default:
503  break;
504  }
505  }
506  }
507  else
508  {
509  ::avro::decode(d, v.result);
510  ::avro::decode(d, v.resultPerDestinationNode);
511  ::avro::decode(d, v.info);
512  }
513  }
514  };
515 }
516 
517 #endif
std::vector< std::string > weightsOnEdges
Definition: solve_graph.h:338
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:465
A set of input parameters for const.
Definition: solve_graph.h:32
std::map< std::string, std::string > options
Definition: solve_graph.h:344
std::vector< float > resultPerDestinationNode
Definition: solve_graph.h:464
SolveGraphResponse()
Constructs a SolveGraphResponse object with default parameter values.
Definition: solve_graph.h:456
std::vector< std::string > restrictions
Definition: solve_graph.h:339
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:325
std::vector< std::string > destinationNodes
Definition: solve_graph.h:342
std::vector< std::string > sourceNodes
Definition: solve_graph.h:341
A set of output parameters for const.
Definition: solve_graph.h:449