123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- #ifndef _FASTDDS_RTPS_READER_STATEFULREADER_H_
- #define _FASTDDS_RTPS_READER_STATEFULREADER_H_
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- #include <fastdds/rtps/reader/RTPSReader.h>
- #include <fastrtps/utils/collections/ResourceLimitedVector.hpp>
- #include <fastdds/rtps/common/CDRMessage_t.h>
- #include <fastdds/rtps/messages/RTPSMessageGroup.h>
- #include <mutex>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class WriterProxy;
- class RTPSMessageSenderInterface;
- class StatefulReader : public RTPSReader
- {
- public:
- friend class RTPSParticipantImpl;
- virtual ~StatefulReader();
- protected:
- StatefulReader(
- RTPSParticipantImpl*,
- const GUID_t& guid,
- const ReaderAttributes& att,
- ReaderHistory* hist,
- ReaderListener* listen = nullptr);
- public:
-
- bool matched_writer_add(const WriterProxyData& wdata) override;
-
- bool matched_writer_remove(const GUID_t& writer_guid) override;
-
- bool matched_writer_is_matched(const GUID_t& writer_guid) override;
-
- bool matched_writer_lookup(
- const GUID_t& writerGUID,
- WriterProxy** WP);
-
- bool processDataMsg(CacheChange_t* change) override;
-
- bool processDataFragMsg(
- CacheChange_t* change,
- uint32_t sampleSize,
- uint32_t fragmentStartingNum,
- uint16_t fragmentsInSubmessage) override;
-
- bool processHeartbeatMsg(
- const GUID_t& writerGUID,
- uint32_t hbCount,
- const SequenceNumber_t& firstSN,
- const SequenceNumber_t& lastSN,
- bool finalFlag,
- bool livelinessFlag) override;
- bool processGapMsg(
- const GUID_t& writerGUID,
- const SequenceNumber_t& gapStart,
- const SequenceNumberSet_t& gapList) override;
-
- bool change_removed_by_history(
- CacheChange_t* change,
- WriterProxy* prox = nullptr) override;
-
- bool change_received(
- CacheChange_t* a_change,
- WriterProxy* prox);
-
- inline RTPSParticipantImpl* getRTPSParticipant() const
- {
- return mp_RTPSParticipant;
- }
-
- bool nextUnreadCache(
- CacheChange_t** change,
- WriterProxy** wpout = nullptr) override;
-
- bool nextUntakenCache(
- CacheChange_t** change,
- WriterProxy** wpout = nullptr) override;
-
- bool updateTimes(const ReaderTimes& times);
-
- inline ReaderTimes& getTimes()
- {
- return times_;
- }
-
- inline size_t getMatchedWritersSize() const
- {
- return matched_writers_.size();
- }
-
- bool isInCleanState() override;
-
- void send_acknack(
- const WriterProxy* writer,
- const SequenceNumberSet_t& sns,
- const RTPSMessageSenderInterface& sender,
- bool is_final);
-
- void send_acknack(
- const WriterProxy* writer,
- const RTPSMessageSenderInterface& sender,
- bool heartbeat_was_final);
-
- bool send_sync_nts(
- CDRMessage_t* message,
- const Locators& locators_begin,
- const Locators& locators_end,
- std::chrono::steady_clock::time_point& max_blocking_time_point);
- private:
- bool acceptMsgFrom(
- const GUID_t& entityGUID,
- WriterProxy** wp) const;
-
- bool findWriterProxy(
- const GUID_t& writerGUID,
- WriterProxy** wp) const;
- void NotifyChanges(WriterProxy* wp);
-
- uint32_t acknack_count_;
-
- uint32_t nackfrag_count_;
-
- ReaderTimes times_;
-
- ResourceLimitedVector<WriterProxy*> matched_writers_;
-
- ResourceLimitedVector<WriterProxy*> matched_writers_pool_;
-
- ResourceLimitedContainerConfig proxy_changes_config_;
-
- bool disable_positive_acks_;
-
- bool is_alive_;
- };
- }
- }
- }
- #endif
- #endif
|