From 60b9594fa3ea5c96e3d90a138ac3854705e1a74e Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期二, 18 五月 2021 11:20:37 +0800 Subject: [PATCH] trivial. --- src/defs.cpp | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/defs.cpp b/src/defs.cpp index b812b65..43e7b7f 100644 --- a/src/defs.cpp +++ b/src/defs.cpp @@ -132,7 +132,6 @@ InitMQ(info.mq_sender_, NextId()); InitMQ(info.mq_center_, NextId()); InitMQ(info.mq_bus_, NextId()); - InitMQ(info.mq_init_, NextId()); pmeta->tag_ = kCenterInfoTag; return true; @@ -141,10 +140,17 @@ return false; } -uint64_t BHGlobalSenderAddress() { return GetCenterInfo(BHomeShm())->mq_sender_.id_; } -uint64_t BHTopicCenterAddress() { return GetCenterInfo(BHomeShm())->mq_center_.id_; } -uint64_t BHTopicBusAddress() { return GetCenterInfo(BHomeShm())->mq_bus_.id_; } -uint64_t BHCenterReplyAddress() { return GetCenterInfo(BHomeShm())->mq_init_.id_; } +const MQInfo &BHGlobalSenderAddress() { return GetCenterInfo(BHomeShm())->mq_sender_; } +const MQInfo &BHTopicCenterAddress() { return GetCenterInfo(BHomeShm())->mq_center_; } +const MQInfo &BHTopicBusAddress() { return GetCenterInfo(BHomeShm())->mq_bus_; } +bool BHNodeInit(const int64_t request, int64_t &reply) +{ + return GetCenterInfo(BHomeShm())->init_rr_.ClientRequest(request, reply); +} +void BHCenterHandleInit(std::function<int64_t(const int64_t)> const &onReq) +{ + GetCenterInfo(BHomeShm())->init_rr_.ServerProcess(onReq); +} int64_t CalcAllocIndex(int64_t size) { -- Gitblit v1.8.0