From 6eefba812ede29549af3633c490f2e85a4805524 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期三, 31 三月 2021 11:24:20 +0800 Subject: [PATCH] format code style. --- src/pubsub.h | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/pubsub.h b/src/pubsub.h index 11fa4e4..dc3fced 100644 --- a/src/pubsub.h +++ b/src/pubsub.h @@ -19,35 +19,36 @@ #define PUBSUB_4KGRA997 #include "shm_queue.h" -#include <thread> #include <atomic> #include <mutex> -#include <vector> -#include <unordered_map> #include <set> +#include <thread> +#include <unordered_map> +#include <vector> -namespace bhome_shm { +namespace bhome_shm +{ // publish/subcribe manager. class BusManager { - SharedMemory &shm_; - ShmMsgQueue busq_; - std::atomic<bool> run_; - std::vector<std::thread> workers_; - std::mutex mutex_; - typedef std::set<MQId> Clients; - std::unordered_map<std::string, Clients> records_; + SharedMemory &shm_; + ShmMsgQueue busq_; + std::atomic<bool> run_; + std::vector<std::thread> workers_; + std::mutex mutex_; + typedef std::set<MQId> Clients; + std::unordered_map<std::string, Clients> records_; - bool StopNoLock(); - void OnMsg(MsgI &msg); + bool StopNoLock(); + void OnMsg(MsgI &msg); + public: - BusManager(SharedMemory &shm); - ~BusManager(); - bool Start(const int nworker = 2); - bool Stop(); + BusManager(SharedMemory &shm); + ~BusManager(); + bool Start(const int nworker = 2); + bool Stop(); }; - } // namespace bhome_shm -- Gitblit v1.8.0