| | |
| | | ~ShmMsgQueue(); |
| | | const MQId &Id() const { return id_; } |
| | | |
| | | bool Recv(BHMsg &msg, const int timeout_ms); |
| | | // bool Recv(MsgI &msg, BHMsgHead &head, const int timeout_ms); |
| | | bool Recv(MsgI &msg, const int timeout_ms) { return Read(msg, timeout_ms); } |
| | | static bool Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms, OnSend const &onsend); |
| | | static bool Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms); |
| | |
| | | { |
| | | return Send(shm(), remote_id, msg, timeout_ms, extra...); |
| | | } |
| | | |
| | | template <class... Extra> |
| | | bool Send(const MQId &remote_id, const BHMsg &data, const int timeout_ms, Extra const &...extra) |
| | | template <class Body, class... Extra> |
| | | bool Send(const MQId &remote_id, const BHMsgHead &head, const Body &body, const int timeout_ms, Extra const &...extra) |
| | | { |
| | | MsgI msg; |
| | | if (msg.Make(shm(), data)) { |
| | | if (msg.Make(shm(), head, body)) { |
| | | if (Send(shm(), remote_id, msg, timeout_ms, extra...)) { |
| | | return true; |
| | | } else { |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | size_t Pending() const { return data()->size(); } |
| | | }; |
| | | |