| | |
| | | #ifndef PUBSUB_CENTER_MFSUZJU7 |
| | | #define PUBSUB_CENTER_MFSUZJU7 |
| | | |
| | | #include "center.h" |
| | | #include "defs.h" |
| | | #include "socket.h" |
| | | #include <mutex> |
| | | #include <set> |
| | | #include <unordered_map> |
| | | |
| | | BHCenter::MsgHandler MakeBusCenter(); |
| | | |
| | | // publish/subcribe manager. |
| | | class PubSubCenter |
| | | { |
| | | class SocketBus : public ShmSocket |
| | | { |
| | | public: |
| | | SocketBus(ShmSocket::Shm &shm) : |
| | | ShmSocket(shm, &kBHTopicBus, 1000) {} |
| | | using ShmSocket::shm; |
| | | }; |
| | | SocketBus socket_; |
| | | ShmSocket::Shm &shm() { return socket_.shm(); } |
| | | ShmSocket socket_; |
| | | |
| | | public: |
| | | PubSubCenter(ShmSocket::Shm &shm) : |
| | | socket_(shm) {} |
| | | socket_(shm, &kBHTopicBus, 1000) {} |
| | | PubSubCenter() : |
| | | PubSubCenter(BHomeShm()) {} |
| | | ~PubSubCenter() { Stop(); } |