From 72851db66655912cb9c92300a80985fb9797d168 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期二, 01 六月 2021 16:25:23 +0800
Subject: [PATCH] remove AtomicQueue, not used.

---
 box/node_center.h |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/box/node_center.h b/box/node_center.h
index ca16cc5..8bc2cf8 100644
--- a/box/node_center.h
+++ b/box/node_center.h
@@ -51,14 +51,14 @@
 	typedef int64_t Offset;
 
 public:
-	void RecordMsg(const MsgI &msg) { msgs_.emplace(msg.id(), msg.Offset()); }
+	void RecordMsg(const MsgI &msg) { msgs_.emplace(msg.id(), msg); }
 	void FreeMsg(MsgId id);
 	void AutoRemove();
 	size_t size() const { return msgs_.size(); }
 	void DebugPrint() const;
 
 private:
-	std::unordered_map<MsgId, Offset> msgs_;
+	std::unordered_map<MsgId, MsgI> msgs_;
 	int64_t time_to_clean_ = 0;
 };
 
@@ -122,6 +122,8 @@
 	void RecordMsg(const MsgI &msg);
 	bool SendAllocReply(ShmSocket &socket, const MQInfo &dest, const int64_t reply, const MsgI &msg);
 	bool SendAllocMsg(ShmSocket &socket, const MQInfo &dest, const MsgI &msg);
+	bool PassRemoteRequestToLocal(const MQInfo &dest, BHMsgHead &head, const std::string &body_content, ShmSocket::RecvCB &&cb);
+	bool PassRemoteReplyToLocal(const MQInfo &dest, BHMsgHead &head, const std::string &body_content);
 	void OnAlloc(ShmSocket &socket, const int64_t val);
 	void OnFree(ShmSocket &socket, const int64_t val);
 	bool OnCommand(ShmSocket &socket, const int64_t val);
@@ -158,6 +160,14 @@
 	{
 		return HandleMsg<MsgCommonReply, Func>(head, op);
 	}
+	template <class Reply>
+	bool CheckMsg(const BHMsgHead &head, Reply &reply)
+	{
+		bool r = false;
+		auto onOk = [&](Node) { r = true; return MakeReply<Reply>(eSuccess); };
+		reply = HandleMsg<Reply>(head, onOk);
+		return r;
+	}
 
 	MsgCommonReply Unregister(const BHMsgHead &head, MsgUnregister &msg);
 	MsgCommonReply RegisterRPC(const BHMsgHead &head, MsgRegisterRPC &msg);
@@ -183,6 +193,8 @@
 		return node && Valid(*node);
 	}
 	void RemoveNode(Node &node);
+	Node GetNode(const MQId mq);
+
 	std::string id_; // center proc id;
 
 	std::unordered_map<Topic, Clients> service_map_;

--
Gitblit v1.8.0