.. _program_listing_file__tmp_ws_src_fastrtps_include_fastdds_rtps_network_SenderResource.h: Program Listing for File SenderResource.h ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/fastrtps/include/fastdds/rtps/network/SenderResource.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // 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 _FASTDDS_RTPS_SENDER_RESOURCE_H #define _FASTDDS_RTPS_SENDER_RESOURCE_H #include #include #include #include #include namespace eprosima { namespace fastrtps { namespace rtps { class RTPSParticipantImpl; class MessageReceiver; class SenderResource { public: bool send( const octet* data, uint32_t dataLength, LocatorsIterator* destination_locators_begin, LocatorsIterator* destination_locators_end, const std::chrono::steady_clock::time_point& max_blocking_time_point) { bool returned_value = false; if (send_lambda_) { returned_value = send_lambda_(data, dataLength, destination_locators_begin, destination_locators_end, max_blocking_time_point); } return returned_value; } SenderResource( SenderResource&& rValueResource) { clean_up.swap(rValueResource.clean_up); send_lambda_.swap(rValueResource.send_lambda_); } virtual ~SenderResource() = default; int32_t kind() const { return transport_kind_; } virtual void add_locators_to_list( LocatorList_t& locators) const { (void)locators; } protected: SenderResource( int32_t transport_kind) : transport_kind_(transport_kind) { } int32_t transport_kind_; std::function clean_up; std::function send_lambda_; private: SenderResource() = delete; SenderResource( const SenderResource&) = delete; SenderResource& operator =( const SenderResource&) = delete; }; } // namespace rtps } // namespace fastrtps } // namespace eprosima #endif /* _FASTDDS_RTPS_SENDER_RESOURCE_H */