6 #ifndef __GET_VECTORTILE_H__
7 #define __GET_VECTORTILE_H__
18 struct GetVectortileRequest
26 GetVectortileRequest() :
27 tableNames(std::vector<std::string>()),
28 columnNames(std::vector<std::string>()),
29 layers(std::map<std::string, std::vector<std::string> >()),
33 options(std::map<std::string, std::string>())
51 GetVectortileRequest(
const std::vector<std::string>& tableNames_,
const std::vector<std::string>& columnNames_,
const std::map<std::string, std::vector<std::string> >& layers_,
const int32_t tileX_,
const int32_t tileY_,
const int32_t zoom_,
const std::map<std::string, std::string>& options_):
52 tableNames( tableNames_ ),
53 columnNames( columnNames_ ),
62 std::vector<std::string> tableNames;
63 std::vector<std::string> columnNames;
64 std::map<std::string, std::vector<std::string> > layers;
68 std::map<std::string, std::string> options;
78 template<>
struct codec_traits<gpudb::GetVectortileRequest>
80 static void encode(Encoder& e,
const gpudb::GetVectortileRequest& v)
82 ::avro::encode(e, v.tableNames);
83 ::avro::encode(e, v.columnNames);
84 ::avro::encode(e, v.layers);
85 ::avro::encode(e, v.tileX);
86 ::avro::encode(e, v.tileY);
87 ::avro::encode(e, v.zoom);
88 ::avro::encode(e, v.options);
91 static void decode(Decoder& d, gpudb::GetVectortileRequest& v)
93 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
95 const std::vector<size_t> fo = rd->fieldOrder();
97 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
102 ::avro::decode(d, v.tableNames);
106 ::avro::decode(d, v.columnNames);
110 ::avro::decode(d, v.layers);
114 ::avro::decode(d, v.tileX);
118 ::avro::decode(d, v.tileY);
122 ::avro::decode(d, v.zoom);
126 ::avro::decode(d, v.options);
136 ::avro::decode(d, v.tableNames);
137 ::avro::decode(d, v.columnNames);
138 ::avro::decode(d, v.layers);
139 ::avro::decode(d, v.tileX);
140 ::avro::decode(d, v.tileY);
141 ::avro::decode(d, v.zoom);
142 ::avro::decode(d, v.options);
157 struct GetVectortileResponse
165 GetVectortileResponse() :
166 encodedData(std::string()),
167 info(std::map<std::string, std::string>())
171 std::string encodedData;
172 std::map<std::string, std::string> info;
182 template<>
struct codec_traits<gpudb::GetVectortileResponse>
184 static void encode(Encoder& e,
const gpudb::GetVectortileResponse& v)
186 ::avro::encode(e, v.encodedData);
187 ::avro::encode(e, v.info);
190 static void decode(Decoder& d, gpudb::GetVectortileResponse& v)
192 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
194 const std::vector<size_t> fo = rd->fieldOrder();
196 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
201 ::avro::decode(d, v.encodedData);
205 ::avro::decode(d, v.info);
215 ::avro::decode(d, v.encodedData);
216 ::avro::decode(d, v.info);