.. _program_listing_file__tmp_ws_src_fastrtps_include_fastdds_rtps_writer_ReaderLocator.h: Program Listing for File ReaderLocator.h ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/fastrtps/include/fastdds/rtps/writer/ReaderLocator.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_READERLOCATOR_H_ #define _FASTDDS_RTPS_READERLOCATOR_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include #include #include #include #include #include namespace eprosima { namespace fastrtps { namespace rtps { class RTPSParticipantImpl; class RTPSWriter; class RTPSReader; class IDataSharingNotifier; class ReaderLocator : public RTPSMessageSenderInterface { public: virtual ~ReaderLocator(); ReaderLocator( RTPSWriter* owner, size_t max_unicast_locators, size_t max_multicast_locators); bool expects_inline_qos() const { return expects_inline_qos_; } bool is_local_reader() const { return is_local_reader_; } RTPSReader* local_reader(); void local_reader( RTPSReader* local_reader) { local_reader_ = local_reader; } const GUID_t& remote_guid() const { return general_locator_info_.remote_guid; } LocatorSelectorEntry* general_locator_selector_entry() { return &general_locator_info_; } LocatorSelectorEntry* async_locator_selector_entry() { return &async_locator_info_; } bool start( const GUID_t& remote_guid, const ResourceLimitedVector& unicast_locators, const ResourceLimitedVector& multicast_locators, bool expects_inline_qos, bool is_datasharing = false); bool update( const ResourceLimitedVector& unicast_locators, const ResourceLimitedVector& multicast_locators, bool expects_inline_qos); bool stop( const GUID_t& remote_guid); void stop(); bool destinations_have_changed() const override { return false; } GuidPrefix_t destination_guid_prefix() const override { return general_locator_info_.remote_guid.guidPrefix; } const std::vector& remote_participants() const override { return guid_prefix_as_vector_; } const std::vector& remote_guids() const override { return guid_as_vector_; } bool send( CDRMessage_t* message, std::chrono::steady_clock::time_point max_blocking_time_point) const override; bool is_datasharing_reader() const; IDataSharingNotifier* datasharing_notifier() { return datasharing_notifier_; } const IDataSharingNotifier* datasharing_notifier() const { return datasharing_notifier_; } void datasharing_notify(); size_t locators_size() const { if (general_locator_info_.remote_guid != c_Guid_Unknown && !is_local_reader_) { if (general_locator_info_.unicast.size() > 0) { return general_locator_info_.unicast.size(); } else { return general_locator_info_.multicast.size(); } } return 0; } /* * Do nothing. * This object always is protected by writer's mutex. */ void lock() override { } /* * Do nothing. * This object always is protected by writer's mutex. */ void unlock() override { } private: RTPSWriter* owner_; RTPSParticipantImpl* participant_owner_; LocatorSelectorEntry general_locator_info_; LocatorSelectorEntry async_locator_info_; bool expects_inline_qos_; bool is_local_reader_; RTPSReader* local_reader_; std::vector guid_prefix_as_vector_; std::vector guid_as_vector_; IDataSharingNotifier* datasharing_notifier_; }; } /* namespace rtps */ } /* namespace fastrtps */ } /* namespace eprosima */ #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #endif /* _FASTDDS_RTPS_READERLOCATOR_H_ */