From 330f78f3334bcdcdb4cc2ab2dbf66604e0224d71 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 16:21:45 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/valib/bhshmq
---
box/center.h | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/box/center.h b/box/center.h
index 4d71bc9..6610277 100644
--- a/box/center.h
+++ b/box/center.h
@@ -18,10 +18,11 @@
#ifndef CENTER_TM9OUQTG
#define CENTER_TM9OUQTG
-#include "socket.h"
+#include "shm_socket.h"
#include <functional>
#include <map>
#include <memory>
+class CenterTopicNode;
class BHCenter
{
@@ -29,13 +30,12 @@
public:
typedef Socket::PartialRecvCB MsgHandler;
- typedef Socket::RawRecvCB MsgIHandler;
+ typedef Socket::RawRecvCB RawHandler;
typedef Socket::IdleCB IdleHandler;
- static bool Install(const std::string &name, MsgHandler handler, IdleHandler idle, const MQId mqid, const int mq_len);
- static bool Install(const std::string &name, MsgIHandler handler, IdleHandler idle, const MQId mqid, const int mq_len);
+ static bool Install(const std::string &name, MsgHandler handler, RawHandler raw_handler, IdleHandler idle, const MQInfo &mq, const int mq_len);
BHCenter(Socket::Shm &shm);
- ~BHCenter() { Stop(); }
+ ~BHCenter();
bool Start();
bool Stop();
@@ -43,15 +43,16 @@
struct CenterInfo {
std::string name_;
MsgHandler handler_;
- MsgIHandler raw_handler_;
+ RawHandler raw_handler_;
IdleHandler idle_;
- MQId mqid_;
+ MQInfo mq_;
int mq_len_ = 0;
};
typedef std::map<std::string, CenterInfo> CenterRecords;
static CenterRecords &Centers();
std::map<std::string, std::shared_ptr<ShmSocket>> sockets_;
+ std::unique_ptr<CenterTopicNode> topic_node_;
};
#endif // end of include guard: CENTER_TM9OUQTG
--
Gitblit v1.8.0