| | |
| | | #define UTIL_W8A0OA5U |
| | | |
| | | #include "bh_util.h" |
| | | #include "msg.h" |
| | | #include "shm.h" |
| | | #include "shm_queue.h" |
| | | #include "topic_node.h" |
| | | #include <boost/date_time/posix_time/posix_time.hpp> |
| | | #include <boost/noncopyable.hpp> |
| | | #include <boost/test/unit_test.hpp> |
| | |
| | | ~ShmRemover() { SharedMemory::Remove(name_); } |
| | | }; |
| | | |
| | | class DemoNode : public TopicNode |
| | | { |
| | | std::string id_; |
| | | |
| | | public: |
| | | DemoNode(const std::string &id, SharedMemory &shm) : |
| | | TopicNode(shm), id_(id) { Init(); } |
| | | void Init() |
| | | { |
| | | MsgRegister reg; |
| | | reg.mutable_proc()->set_proc_id(id_); |
| | | MsgCommonReply reply_body; |
| | | |
| | | if (!Register(reg, reply_body, 1000)) { |
| | | printf("node %s register failed\n", id_.c_str()); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | #endif // end of include guard: UTIL_W8A0OA5U |