OpenHiva::Node
OpenHiva::Node is used to create publisher, subscriber, server (ServiceServer), and client (ServiceClient) objects. The Node class interface is defined as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | namespace OpenHiva { using RemappingsString = std::unordered_map<std::string, std::string>; class Node { public: Node(const std::string &name, const std::string &ns = std::string(), const RemappingsString& remappingsStr = RemappingsString()); ~ Node(); template <typename M> std::shared_ptr<Publisher> CreatePublisher(const std::string &topicName, const TopicOptions &topicOptions = TopicOptions()); template <typename M> std::shared_ptr<Subscriber> CreateSubscriber(const std::string &topicName, const std::function<void(M)> &callback, const TopicOptions & topicOptions = TopicOptions()); template <typename ReqType, typename ResType> std::shared_ptr<ServiceServer> CreateServer(const std::string &serviceName, const ServiceOptions &serviceOptions, const std::function<bool(ReqType, ResType)> &serviceCallback); template <typename ReqType, typename ResType> std::shared_ptr<ServiceClient> CreateClient(const std::string &serviceName, const ServiceOptions &serverOptions); std::vector<std::shared_ptr<Subscriber>> GetSubscribers(); bool Ready(); const std::string &GetName(); const std::string &GetNameSpace(); private: void Shutdown(); std::shared_ptr<TopicManager> topicManagerPtr_; std::shared_ptr<NodeUri> nodeUriPtr_; }; } |
Parent topic: OpenHiva FAQs