| | |
| | | |
| | | using namespace bhome_shm; |
| | | using namespace bhome_msg; |
| | | using namespace bhome::msg; |
| | | typedef BHCenter::MsgHandler Handler; |
| | | |
| | | namespace |
| | |
| | | public: |
| | | typedef std::string ProcId; |
| | | typedef std::string Address; |
| | | typedef bhome::msg::ProcInfo ProcInfo; |
| | | typedef bhome_msg::ProcInfo ProcInfo; |
| | | typedef std::function<void(Address const &)> Cleaner; |
| | | |
| | | private: |
| | |
| | | |
| | | Handler Combine(const Handler &h1, const Handler &h2) |
| | | { |
| | | return [h1, h2](ShmSocket &socket, bhome_msg::MsgI &msg, bhome::msg::BHMsgHead &head) { |
| | | return [h1, h2](ShmSocket &socket, bhome_msg::MsgI &msg, bhome_msg::BHMsgHead &head) { |
| | | return h1(socket, msg, head) || h2(socket, msg, head); |
| | | }; |
| | | } |
| | |
| | | #undef CASE_ON_MSG_TYPE |
| | | |
| | | } // namespace |
| | | |
| | | SharedMemory &BHomeShm() |
| | | { |
| | | static SharedMemory shm("bhome_default_shm_v0", 1024 * 1024 * 512); |
| | | return shm; |
| | | } |
| | | |
| | | BHCenter::CenterRecords &BHCenter::Centers() |
| | | { |