6 #ifndef SRC_BGP_BGP_SHOW_HANDLER_H__
7 #define SRC_BGP_BGP_SHOW_HANDLER_H__
11 #include <sandesh/request_pipeline.h>
37 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
64 static void FillShowList(RespT *resp,
const std::vector<ShowT> &show_list);
77 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
79 const ReqT *req,
Data *data) {
91 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
93 const ReqIterateT *req_iterate,
Data *data) {
100 std::string iterate_info = req_iterate->get_iterate_info();
104 if (pos1 == std::string::npos)
107 data->
next_entry = iterate_info.substr(0, pos1);
118 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
120 const std::string &next_entry,
bool done,
Data *data) {
131 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
133 RespT *resp,
const std::vector<ShowT> &show_list) {
146 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
159 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
163 Data *mydata =
static_cast<Data *
>(data);
164 const ReqT *req =
static_cast<const ReqT *
>(ps.
snhRequest_.get());
169 ConvertReqToData(req, mydata);
173 if (!CallbackCommon(bsc, mydata))
177 RespT *resp =
new RespT;
178 resp->set_context(req->context());
195 template <
typename ReqT,
typename ReqIterateT,
typename RespT,
typename ShowT>
199 Data *mydata =
static_cast<Data *
>(data);
200 const ReqIterateT *req_iterate =
201 static_cast<const ReqIterateT *
>(ps.
snhRequest_.get());
206 if (!ConvertReqIterateToData(req_iterate, mydata)) {
207 RespT *resp =
new RespT;
208 resp->set_context(req_iterate->context());
215 if (!CallbackCommon(bsc, mydata))
219 RespT *resp =
new RespT;
220 resp->set_context(req_iterate->context());
static char kIterSeparator[]
static RequestPipeline::InstData * CreateData(int stage)
static const uint32_t kIterLimit
static void ConvertReqToData(const ReqT *req, Data *data)
static bool ConvertReqIterateToData(const ReqIterateT *req_iterate, Data *data)
static bool CallbackCommon(const BgpSandeshContext *bsc, Data *data)
static bool CallbackIterate(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
static const uint32_t kPageLimit
static void SaveContextToData(const std::string &next_entry, bool done, Data *data)
static void FillShowList(RespT *resp, const std::vector< ShowT > &show_list)
static bool Callback(const Sandesh *sr, const RequestPipeline::PipeSpec ps, int stage, int instNum, RequestPipeline::InstData *data)
std::string search_string
std::vector< ShowT > show_list
boost::shared_ptr< const SandeshRequest > snhRequest_