GPUdb C++ API  Version 7.2.2.4
query_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 __QUERY_GRAPH_H__
7 #define __QUERY_GRAPH_H__
8 
9 namespace gpudb
10 {
39  {
44  graphName(std::string()),
45  queries(std::vector<std::string>()),
46  restrictions(std::vector<std::string>()),
47  adjacencyTable(std::string()),
48  rings(int32_t()),
49  options(std::map<std::string, std::string>())
50  {
51  }
52 
222  QueryGraphRequest(const std::string& graphName_, const std::vector<std::string>& queries_, const std::vector<std::string>& restrictions_, const std::string& adjacencyTable_, const int32_t rings_, const std::map<std::string, std::string>& options_):
223  graphName( graphName_ ),
224  queries( queries_ ),
225  restrictions( restrictions_ ),
226  adjacencyTable( adjacencyTable_ ),
227  rings( rings_ ),
228  options( options_ )
229  {
230  }
231 
235  std::string graphName;
236 
248  std::vector<std::string> queries;
249 
264  std::vector<std::string> restrictions;
265 
282  std::string adjacencyTable;
283 
296  int32_t rings;
297 
371  std::map<std::string, std::string> options;
372  };
373 } // end namespace gpudb
374 
375 namespace avro
376 {
377  template<> struct codec_traits<gpudb::QueryGraphRequest>
378  {
379  static void encode(Encoder& e, const gpudb::QueryGraphRequest& v)
380  {
381  ::avro::encode(e, v.graphName);
382  ::avro::encode(e, v.queries);
383  ::avro::encode(e, v.restrictions);
384  ::avro::encode(e, v.adjacencyTable);
385  ::avro::encode(e, v.rings);
386  ::avro::encode(e, v.options);
387  }
388 
389  static void decode(Decoder& d, gpudb::QueryGraphRequest& 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.queries);
405  break;
406 
407  case 2:
408  ::avro::decode(d, v.restrictions);
409  break;
410 
411  case 3:
412  ::avro::decode(d, v.adjacencyTable);
413  break;
414 
415  case 4:
416  ::avro::decode(d, v.rings);
417  break;
418 
419  case 5:
420  ::avro::decode(d, v.options);
421  break;
422 
423  default:
424  break;
425  }
426  }
427  }
428  else
429  {
430  ::avro::decode(d, v.graphName);
431  ::avro::decode(d, v.queries);
432  ::avro::decode(d, v.restrictions);
433  ::avro::decode(d, v.adjacencyTable);
434  ::avro::decode(d, v.rings);
435  ::avro::decode(d, v.options);
436  }
437  }
438  };
439 } // end namespace avro
440 
441 namespace gpudb
442 {
448  {
453  result(bool()),
454  adjacencyListIntArray(std::vector<int64_t>()),
455  adjacencyListStringArray(std::vector<std::string>()),
456  adjacencyListWktArray(std::vector<std::string>()),
457  info(std::map<std::string, std::string>())
458  {
459  }
460 
464  bool result;
465 
472  std::vector<int64_t> adjacencyListIntArray;
473 
480  std::vector<std::string> adjacencyListStringArray;
481 
488  std::vector<std::string> adjacencyListWktArray;
489 
493  std::map<std::string, std::string> info;
494  };
495 } // end namespace gpudb
496 
497 namespace avro
498 {
499  template<> struct codec_traits<gpudb::QueryGraphResponse>
500  {
501  static void encode(Encoder& e, const gpudb::QueryGraphResponse& v)
502  {
503  ::avro::encode(e, v.result);
504  ::avro::encode(e, v.adjacencyListIntArray);
505  ::avro::encode(e, v.adjacencyListStringArray);
506  ::avro::encode(e, v.adjacencyListWktArray);
507  ::avro::encode(e, v.info);
508  }
509 
510  static void decode(Decoder& d, gpudb::QueryGraphResponse& v)
511  {
512  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
513  {
514  const std::vector<size_t> fo = rd->fieldOrder();
515 
516  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
517  {
518  switch (*it)
519  {
520  case 0:
521  ::avro::decode(d, v.result);
522  break;
523 
524  case 1:
525  ::avro::decode(d, v.adjacencyListIntArray);
526  break;
527 
528  case 2:
529  ::avro::decode(d, v.adjacencyListStringArray);
530  break;
531 
532  case 3:
533  ::avro::decode(d, v.adjacencyListWktArray);
534  break;
535 
536  case 4:
537  ::avro::decode(d, v.info);
538  break;
539 
540  default:
541  break;
542  }
543  }
544  }
545  else
546  {
547  ::avro::decode(d, v.result);
548  ::avro::decode(d, v.adjacencyListIntArray);
549  ::avro::decode(d, v.adjacencyListStringArray);
550  ::avro::decode(d, v.adjacencyListWktArray);
551  ::avro::decode(d, v.info);
552  }
553  }
554  };
555 } // end namespace avro
556 
557 #endif // __QUERY_GRAPH_H__
QueryGraphResponse()
Constructs a QueryGraphResponse object with default parameters.
Definition: query_graph.h:452
std::vector< std::string > restrictions
Additional restrictions to apply to the nodes/edges of an existing graph.
Definition: query_graph.h:264
std::vector< std::string > adjacencyListWktArray
The adjacency entity WKTPOINT or WKTLINE ID: either edge IDs per node requested (if using QUERY_EDGE_...
Definition: query_graph.h:488
std::vector< std::string > queries
Nodes or edges to be queried specified using query identifiers.
Definition: query_graph.h:248
std::vector< std::string > adjacencyListStringArray
The adjacency entity string ID: either edge IDs per node requested (if using QUERY_EDGE_NAME or QUERY...
Definition: query_graph.h:480
QueryGraphRequest()
Constructs a QueryGraphRequest object with default parameters.
Definition: query_graph.h:43
std::string adjacencyTable
Name of the table to store the resulting adjacencies, in [ schema_name. ]table_name format,...
Definition: query_graph.h:282
std::map< std::string, std::string > info
Additional information.
Definition: query_graph.h:493
A set of results returned by GPUdb::queryGraph.
Definition: query_graph.h:447
QueryGraphRequest(const std::string &graphName_, const std::vector< std::string > &queries_, const std::vector< std::string > &restrictions_, const std::string &adjacencyTable_, const int32_t rings_, const std::map< std::string, std::string > &options_)
Constructs a QueryGraphRequest object with the specified parameters.
Definition: query_graph.h:222
int32_t rings
Sets the number of rings around the node to query for adjacency, with '1' being the edges directly at...
Definition: query_graph.h:296
std::string graphName
Name of the graph resource to query.
Definition: query_graph.h:235
std::map< std::string, std::string > options
Additional parameters.
Definition: query_graph.h:371
A set of parameters for GPUdb::queryGraph.
Definition: query_graph.h:38
bool result
Indicates a successful query.
Definition: query_graph.h:464
std::vector< int64_t > adjacencyListIntArray
The adjacency entity integer ID: either edge IDs per node requested (if using QUERY_EDGE_ID or QUERY_...
Definition: query_graph.h:472