6 #ifndef __GET_VECTORTILE_H__ 7 #define __GET_VECTORTILE_H__ 12 struct GetVectortileRequest
14 GetVectortileRequest() :
15 tableNames(std::vector<std::string>()),
16 columnNames(std::vector<std::string>()),
17 layers(std::map<std::string, std::vector<std::string> >()),
21 options(std::map<std::string, std::string>())
25 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_):
26 tableNames( tableNames_ ),
27 columnNames( columnNames_ ),
36 std::vector<std::string> tableNames;
37 std::vector<std::string> columnNames;
38 std::map<std::string, std::vector<std::string> > layers;
42 std::map<std::string, std::string> options;
48 template<>
struct codec_traits<
gpudb::GetVectortileRequest>
50 static void encode(Encoder& e,
const gpudb::GetVectortileRequest& v)
52 ::avro::encode(e, v.tableNames);
53 ::avro::encode(e, v.columnNames);
54 ::avro::encode(e, v.layers);
55 ::avro::encode(e, v.tileX);
56 ::avro::encode(e, v.tileY);
57 ::avro::encode(e, v.zoom);
58 ::avro::encode(e, v.options);
61 static void decode(Decoder& d, gpudb::GetVectortileRequest& 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.tableNames);
76 ::avro::decode(d, v.columnNames);
80 ::avro::decode(d, v.layers);
84 ::avro::decode(d, v.tileX);
88 ::avro::decode(d, v.tileY);
92 ::avro::decode(d, v.zoom);
96 ::avro::decode(d, v.options);
106 ::avro::decode(d, v.tableNames);
107 ::avro::decode(d, v.columnNames);
108 ::avro::decode(d, v.layers);
109 ::avro::decode(d, v.tileX);
110 ::avro::decode(d, v.tileY);
111 ::avro::decode(d, v.zoom);
112 ::avro::decode(d, v.options);
121 struct GetVectortileResponse
123 GetVectortileResponse() :
124 encodedData(std::string()),
125 info(std::map<std::string, std::string>())
129 std::string encodedData;
130 std::map<std::string, std::string> info;
136 template<>
struct codec_traits<
gpudb::GetVectortileResponse>
138 static void encode(Encoder& e,
const gpudb::GetVectortileResponse& v)
140 ::avro::encode(e, v.encodedData);
141 ::avro::encode(e, v.info);
144 static void decode(Decoder& d, gpudb::GetVectortileResponse& v)
146 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
148 const std::vector<size_t> fo = rd->fieldOrder();
150 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
155 ::avro::decode(d, v.encodedData);
159 ::avro::decode(d, v.info);
169 ::avro::decode(d, v.encodedData);
170 ::avro::decode(d, v.info);
176 #endif // __GET_VECTORTILE_H__