From d67a2076ed4b7b27eefd211da238bcbd4e48d257 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Wed, 2 Jan 2019 16:37:41 +0800 Subject: [PATCH] remove channel::send_for --- include/ipc.h | 10 +++------- src/channel.inc | 18 ------------------ 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/include/ipc.h b/include/ipc.h index 43b189c..6947cfd 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -103,16 +103,12 @@ public: std::size_t recv_count() const; - bool send(void const * data, std::size_t size); - bool send(buff_t const & buff); - bool send(std::string const & str); - bool wait_for_recv(std::size_t r_count, std::size_t until) const; bool wait_for_recv(std::size_t r_count) const; - bool send_for(std::size_t r_count, void const * data, std::size_t size); - bool send_for(std::size_t r_count, buff_t const & buff); - bool send_for(std::size_t r_count, std::string const & str); + bool send(void const * data, std::size_t size); + bool send(buff_t const & buff); + bool send(std::string const & str); buff_t recv(); diff --git a/src/channel.inc b/src/channel.inc index 439e2e0..785d982 100644 --- a/src/channel.inc +++ b/src/channel.inc @@ -35,12 +35,6 @@ inline bool wait_for_recv(route const & rt, std::size_t r_count, std::size_t unt return true; } -template -inline bool channel_send(route& rt, std::size_t r_count, P&&... params) { - if (!wait_for_recv(rt, r_count, 1024)) return false; - return rt.send(params...); // no need std::forward -} - } // internal-linkage //////////////////////////////////////////////////////////////// @@ -180,18 +174,6 @@ bool channel::send(std::string const & str) { return impl(p_)->sender().send(str); } -bool channel::send_for(std::size_t r_count, void const * data, std::size_t size) { - return ::channel_send(impl(p_)->sender(), r_count, data, size); -} - -bool channel::send_for(std::size_t r_count, buff_t const & buff) { - return ::channel_send(impl(p_)->sender(), r_count, buff); -} - -bool channel::send_for(std::size_t r_count, std::string const & str) { - return ::channel_send(impl(p_)->sender(), r_count, str); -} - buff_t channel::recv() { if (!valid()) return {}; std::array ques;