6 #ifndef __SHOW_GRAPH_GRAMMAR_H__ 7 #define __SHOW_GRAPH_GRAMMAR_H__ 12 struct ShowGraphGrammarRequest
14 ShowGraphGrammarRequest() :
15 options(std::map<std::string, std::string>())
19 ShowGraphGrammarRequest(
const std::map<std::string, std::string>& options_):
24 std::map<std::string, std::string> options;
30 template<>
struct codec_traits<
gpudb::ShowGraphGrammarRequest>
32 static void encode(Encoder& e,
const gpudb::ShowGraphGrammarRequest& v)
34 ::avro::encode(e, v.options);
37 static void decode(Decoder& d, gpudb::ShowGraphGrammarRequest& v)
39 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
41 const std::vector<size_t> fo = rd->fieldOrder();
43 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
48 ::avro::decode(d, v.options);
58 ::avro::decode(d, v.options);
67 struct ShowGraphGrammarResponse
69 ShowGraphGrammarResponse() :
71 componentsJson(std::string()),
72 info(std::map<std::string, std::string>())
77 std::string componentsJson;
78 std::map<std::string, std::string> info;
84 template<>
struct codec_traits<
gpudb::ShowGraphGrammarResponse>
86 static void encode(Encoder& e,
const gpudb::ShowGraphGrammarResponse& v)
88 ::avro::encode(e, v.result);
89 ::avro::encode(e, v.componentsJson);
90 ::avro::encode(e, v.info);
93 static void decode(Decoder& d, gpudb::ShowGraphGrammarResponse& v)
95 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
97 const std::vector<size_t> fo = rd->fieldOrder();
99 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
104 ::avro::decode(d, v.result);
108 ::avro::decode(d, v.componentsJson);
112 ::avro::decode(d, v.info);
122 ::avro::decode(d, v.result);
123 ::avro::decode(d, v.componentsJson);
124 ::avro::decode(d, v.info);
130 #endif // __SHOW_GRAPH_GRAMMAR_H__