6 #ifndef __LIST_GRAPH_H__
7 #define __LIST_GRAPH_H__
18 struct ListGraphRequest
26 graphName(std::string()),
27 options(std::map<std::string, std::string>())
39 ListGraphRequest(
const std::string& graphName_,
const std::map<std::string, std::string>& options_):
40 graphName( graphName_ ),
45 std::string graphName;
46 std::map<std::string, std::string> options;
56 template<>
struct codec_traits<gpudb::ListGraphRequest>
58 static void encode(Encoder& e,
const gpudb::ListGraphRequest& v)
60 ::avro::encode(e, v.graphName);
61 ::avro::encode(e, v.options);
64 static void decode(Decoder& d, gpudb::ListGraphRequest& v)
66 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
68 const std::vector<size_t> fo = rd->fieldOrder();
70 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
75 ::avro::decode(d, v.graphName);
79 ::avro::decode(d, v.options);
89 ::avro::decode(d, v.graphName);
90 ::avro::decode(d, v.options);
105 struct ListGraphResponse
112 ListGraphResponse() :
114 graphNames(std::vector<std::string>()),
115 numNodes(std::vector<int64_t>()),
116 numEdges(std::vector<int64_t>()),
117 info(std::map<std::string, std::string>())
122 std::vector<std::string> graphNames;
123 std::vector<int64_t> numNodes;
124 std::vector<int64_t> numEdges;
125 std::map<std::string, std::string> info;
135 template<>
struct codec_traits<gpudb::ListGraphResponse>
137 static void encode(Encoder& e,
const gpudb::ListGraphResponse& v)
139 ::avro::encode(e, v.result);
140 ::avro::encode(e, v.graphNames);
141 ::avro::encode(e, v.numNodes);
142 ::avro::encode(e, v.numEdges);
143 ::avro::encode(e, v.info);
146 static void decode(Decoder& d, gpudb::ListGraphResponse& v)
148 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
150 const std::vector<size_t> fo = rd->fieldOrder();
152 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
157 ::avro::decode(d, v.result);
161 ::avro::decode(d, v.graphNames);
165 ::avro::decode(d, v.numNodes);
169 ::avro::decode(d, v.numEdges);
173 ::avro::decode(d, v.info);
183 ::avro::decode(d, v.result);
184 ::avro::decode(d, v.graphNames);
185 ::avro::decode(d, v.numNodes);
186 ::avro::decode(d, v.numEdges);
187 ::avro::decode(d, v.info);