6 #ifndef __LIST_GRAPH_H__ 7 #define __LIST_GRAPH_H__ 12 struct ListGraphRequest
15 graphName(std::string()),
16 options(std::map<std::string, std::string>())
20 ListGraphRequest(
const std::string& graphName_,
const std::map<std::string, std::string>& options_):
21 graphName( graphName_ ),
26 std::string graphName;
27 std::map<std::string, std::string> options;
33 template<>
struct codec_traits<
gpudb::ListGraphRequest>
35 static void encode(Encoder& e,
const gpudb::ListGraphRequest& v)
37 ::avro::encode(e, v.graphName);
38 ::avro::encode(e, v.options);
41 static void decode(Decoder& d, gpudb::ListGraphRequest& v)
43 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
45 const std::vector<size_t> fo = rd->fieldOrder();
47 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
52 ::avro::decode(d, v.graphName);
56 ::avro::decode(d, v.options);
66 ::avro::decode(d, v.graphName);
67 ::avro::decode(d, v.options);
76 struct ListGraphResponse
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>())
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;
97 template<>
struct codec_traits<
gpudb::ListGraphResponse>
99 static void encode(Encoder& e,
const gpudb::ListGraphResponse& v)
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);
108 static void decode(Decoder& d, gpudb::ListGraphResponse& v)
110 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
112 const std::vector<size_t> fo = rd->fieldOrder();
114 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
119 ::avro::decode(d, v.result);
123 ::avro::decode(d, v.graphNames);
127 ::avro::decode(d, v.numNodes);
131 ::avro::decode(d, v.numEdges);
135 ::avro::decode(d, v.info);
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);
155 #endif // __LIST_GRAPH_H__