.. _program_listing_file__tmp_ws_src_locator_ros_bridge_bosch_locator_bridge_include_bosch_locator_bridge_sending_interface.hpp: Program Listing for File sending_interface.hpp ============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/locator_ros_bridge/bosch_locator_bridge/include/bosch_locator_bridge/sending_interface.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright (c) 2021 - for information on the respective copyright owner // see the NOTICE file and/or the repository https://github.com/boschglobal/locator_ros_bridge. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef BOSCH_LOCATOR_BRIDGE__SENDING_INTERFACE_HPP_ #define BOSCH_LOCATOR_BRIDGE__SENDING_INTERFACE_HPP_ #include #include #include #include #include #include "rclcpp/node.hpp" class SendingInterface : public Poco::Runnable { public: SendingInterface(uint16_t port, rclcpp::Node::SharedPtr node); void run(); virtual ~SendingInterface(); enum class SendingStatus {SUCCESS, NO_CONNECTIONS, NOT_COMPLETED, RESET_EXCEPTION, IO_EXCEPTION}; SendingStatus sendData(void * data, size_t size); void stop(); private: std::mutex connections_mutex_; Poco::Net::ServerSocket socket_; std::atomic running_; std::vector connections_; rclcpp::Node::SharedPtr node_; }; #endif // BOSCH_LOCATOR_BRIDGE__SENDING_INTERFACE_HPP_