6 #ifndef __SHOW_GRAPH_GRAMMAR_H__
7 #define __SHOW_GRAPH_GRAMMAR_H__
18 struct ShowGraphGrammarRequest
26 ShowGraphGrammarRequest() :
27 options(std::map<std::string, std::string>())
39 ShowGraphGrammarRequest(
const std::map<std::string, std::string>& options_):
44 std::map<std::string, std::string> options;
54 template<>
struct codec_traits<gpudb::ShowGraphGrammarRequest>
56 static void encode(Encoder& e,
const gpudb::ShowGraphGrammarRequest& v)
58 ::avro::encode(e, v.options);
61 static void decode(Decoder& d, gpudb::ShowGraphGrammarRequest& v)
63 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
65 const std::vector<size_t> fo = rd->fieldOrder();
67 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
72 ::avro::decode(d, v.options);
82 ::avro::decode(d, v.options);
97 struct ShowGraphGrammarResponse
105 ShowGraphGrammarResponse() :
107 componentsJson(std::string()),
108 info(std::map<std::string, std::string>())
113 std::string componentsJson;
114 std::map<std::string, std::string> info;
124 template<>
struct codec_traits<gpudb::ShowGraphGrammarResponse>
126 static void encode(Encoder& e,
const gpudb::ShowGraphGrammarResponse& v)
128 ::avro::encode(e, v.result);
129 ::avro::encode(e, v.componentsJson);
130 ::avro::encode(e, v.info);
133 static void decode(Decoder& d, gpudb::ShowGraphGrammarResponse& v)
135 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
137 const std::vector<size_t> fo = rd->fieldOrder();
139 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
144 ::avro::decode(d, v.result);
148 ::avro::decode(d, v.componentsJson);
152 ::avro::decode(d, v.info);
162 ::avro::decode(d, v.result);
163 ::avro::decode(d, v.componentsJson);
164 ::avro::decode(d, v.info);