00001 #ifndef LUX_DIST_DISPATCHER_H 00002 #define LUX_DIST_DISPATCHER_H 00003 00004 #include "handler.h" 00005 #include "cluster_searcher.h" 00006 00007 namespace Lux { 00008 namespace Dist { 00009 00010 class Dispatcher : public Handler { 00011 public: 00012 Dispatcher(void *p); 00013 virtual ~Dispatcher(void); 00014 00015 private: 00016 #ifdef HAVE_TR1_MEMORY 00017 std::tr1::shared_ptr<ClusterSearcher> s_; 00018 #elif HAVE_BOOST_SHARED_PTR_HPP 00019 boost::shared_ptr<ClusterSearcher> s_; 00020 #endif 00021 00022 virtual bool exec(request_header_t &header, 00023 char *body, uint32_t body_len); 00024 bool exec_dispatch(char *body, uint32_t len); 00025 bool serialize_rs(TmpResultSet &rs, char **data, uint32_t *size); 00026 }; 00027 00028 } 00029 } 00030 00031 #endif