提交 077fb538 编写于 作者: Y youngwolf

Add some default implementations for i_matrix interface, which is useful for a dummy matrix.

上级 e1076eb5
......@@ -71,9 +71,10 @@ public:
virtual service_pump& get_service_pump() = 0;
virtual const service_pump& get_service_pump() const = 0;
virtual bool socket_exist(uint_fast64_t id) = 0;
virtual std::shared_ptr<tracked_executor> find_socket(uint_fast64_t id) = 0;
virtual bool del_socket(uint_fast64_t id) = 0;
//following implementation is useful for a dummy matrix, for example, in a proxy server, each server_socket (dummy matrix) contains a client_socket
virtual bool socket_exist(uint_fast64_t id) {return false;}
virtual std::shared_ptr<tracked_executor> find_socket(uint_fast64_t id) {return std::shared_ptr<tracked_executor>();}
virtual bool del_socket(uint_fast64_t id) {return false;}
};
namespace tcp
......@@ -81,7 +82,7 @@ namespace tcp
class i_server : public i_matrix
{
private:
virtual bool del_socket(uint_fast64_t id) {return false;} //implement and hide i_matrix::del_socket
using i_matrix::del_socket; //hide i_matrix::del_socket
public:
virtual bool del_socket(const std::shared_ptr<tracked_executor>& socket_ptr) = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册