MACE
1.0.0
|
00001 #ifndef _MACE_RPC_HTTP_PATH_HANDLER_HPP_ 00002 #define _MACE_RPC_HTTP_PATH_HANDLER_HPP_ 00003 #include <mace/rpc/http/request.hpp> 00004 #include <mace/rpc/http/reply.hpp> 00005 #include <boost/function.hpp> 00006 #include <map> 00007 #include <string> 00008 00009 namespace mace { namespace rpc { namespace http { 00010 00011 class path_handler { 00012 public: 00013 typedef boost::function<bool(const request&,const std::string&,reply&)> handler_type; 00014 00016 void operator()(const request& req, reply& rep); 00017 00018 void register_handler( const std::string& prefix, const handler_type& h ); 00019 00020 private: 00021 std::map<std::string,handler_type> m_handlers; 00022 }; 00023 00024 }}} // mace::rpc::http 00025 #endif 00026