GPUdb C++ API  Version 7.2.2.4
list_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 __LIST_GRAPH_H__
7 #define __LIST_GRAPH_H__
8 
9 namespace gpudb
10 {
12  struct ListGraphRequest
13  {
14  ListGraphRequest() :
15  graphName(std::string()),
16  options(std::map<std::string, std::string>())
17  {
18  }
19 
20  ListGraphRequest(const std::string& graphName_, const std::map<std::string, std::string>& options_):
21  graphName( graphName_ ),
22  options( options_ )
23  {
24  }
25 
26  std::string graphName;
27  std::map<std::string, std::string> options;
28  };
29 } // end namespace gpudb
30 
31 namespace avro
32 {
33  template<> struct codec_traits<gpudb::ListGraphRequest>
34  {
35  static void encode(Encoder& e, const gpudb::ListGraphRequest& v)
36  {
37  ::avro::encode(e, v.graphName);
38  ::avro::encode(e, v.options);
39  }
40 
41  static void decode(Decoder& d, gpudb::ListGraphRequest& v)
42  {
43  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
44  {
45  const std::vector<size_t> fo = rd->fieldOrder();
46 
47  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
48  {
49  switch (*it)
50  {
51  case 0:
52  ::avro::decode(d, v.graphName);
53  break;
54 
55  case 1:
56  ::avro::decode(d, v.options);
57  break;
58 
59  default:
60  break;
61  }
62  }
63  }
64  else
65  {
66  ::avro::decode(d, v.graphName);
67  ::avro::decode(d, v.options);
68  }
69  }
70  };
71 } // end namespace avro
72 
73 namespace gpudb
74 {
76  struct ListGraphResponse
77  {
78  ListGraphResponse() :
79  result(bool()),
80  graphNames(std::vector<std::string>()),
81  numNodes(std::vector<int64_t>()),
82  numEdges(std::vector<int64_t>()),
83  info(std::map<std::string, std::string>())
84  {
85  }
86 
87  bool result;
88  std::vector<std::string> graphNames;
89  std::vector<int64_t> numNodes;
90  std::vector<int64_t> numEdges;
91  std::map<std::string, std::string> info;
92  };
93 } // end namespace gpudb
94 
95 namespace avro
96 {
97  template<> struct codec_traits<gpudb::ListGraphResponse>
98  {
99  static void encode(Encoder& e, const gpudb::ListGraphResponse& v)
100  {
101  ::avro::encode(e, v.result);
102  ::avro::encode(e, v.graphNames);
103  ::avro::encode(e, v.numNodes);
104  ::avro::encode(e, v.numEdges);
105  ::avro::encode(e, v.info);
106  }
107 
108  static void decode(Decoder& d, gpudb::ListGraphResponse& v)
109  {
110  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
111  {
112  const std::vector<size_t> fo = rd->fieldOrder();
113 
114  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
115  {
116  switch (*it)
117  {
118  case 0:
119  ::avro::decode(d, v.result);
120  break;
121 
122  case 1:
123  ::avro::decode(d, v.graphNames);
124  break;
125 
126  case 2:
127  ::avro::decode(d, v.numNodes);
128  break;
129 
130  case 3:
131  ::avro::decode(d, v.numEdges);
132  break;
133 
134  case 4:
135  ::avro::decode(d, v.info);
136  break;
137 
138  default:
139  break;
140  }
141  }
142  }
143  else
144  {
145  ::avro::decode(d, v.result);
146  ::avro::decode(d, v.graphNames);
147  ::avro::decode(d, v.numNodes);
148  ::avro::decode(d, v.numEdges);
149  ::avro::decode(d, v.info);
150  }
151  }
152  };
153 } // end namespace avro
154 
155 #endif // __LIST_GRAPH_H__