mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
remove channel::send_for
This commit is contained in:
parent
eae565dfc8
commit
d67a2076ed
@ -103,16 +103,12 @@ public:
|
|||||||
|
|
||||||
std::size_t recv_count() const;
|
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, std::size_t until) const;
|
||||||
bool wait_for_recv(std::size_t r_count) 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(void const * data, std::size_t size);
|
||||||
bool send_for(std::size_t r_count, buff_t const & buff);
|
bool send(buff_t const & buff);
|
||||||
bool send_for(std::size_t r_count, std::string const & str);
|
bool send(std::string const & str);
|
||||||
|
|
||||||
buff_t recv();
|
buff_t recv();
|
||||||
|
|
||||||
|
|||||||
@ -35,12 +35,6 @@ inline bool wait_for_recv(route const & rt, std::size_t r_count, std::size_t unt
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... P>
|
|
||||||
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
|
} // internal-linkage
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
@ -180,18 +174,6 @@ bool channel::send(std::string const & str) {
|
|||||||
return impl(p_)->sender().send(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() {
|
buff_t channel::recv() {
|
||||||
if (!valid()) return {};
|
if (!valid()) return {};
|
||||||
std::array<queue_t*, id_pool::max_count> ques;
|
std::array<queue_t*, id_pool::max_count> ques;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user