123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- #ifndef _FASTDDS_RTPS_READER_STATELESSREADER_H_
- #define _FASTDDS_RTPS_READER_STATELESSREADER_H_
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- #include <fastdds/rtps/reader/RTPSReader.h>
- #include <fastrtps/utils/collections/ResourceLimitedVector.hpp>
- #include <mutex>
- #include <map>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class StatelessReader : public RTPSReader
- {
- friend class RTPSParticipantImpl;
- public:
- virtual ~StatelessReader();
- protected:
- StatelessReader(
- RTPSParticipantImpl* pimpl,
- 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 change_removed_by_history(
- CacheChange_t* change,
- WriterProxy* prox = nullptr) override;
-
- 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_received(
- CacheChange_t* a_change);
-
- bool nextUnreadCache(
- CacheChange_t** change,
- WriterProxy** wpout = nullptr) override;
-
- bool nextUntakenCache(
- CacheChange_t** change,
- WriterProxy** wpout = nullptr) override;
-
- inline size_t getMatchedWritersSize() const
- {
- return matched_writers_.size();
- }
-
- bool isInCleanState() override
- {
- return true;
- }
-
- inline RTPSParticipantImpl* getRTPSParticipant() const
- {
- return mp_RTPSParticipant;
- }
- private:
- struct RemoteWriterInfo_t
- {
- GUID_t guid;
- GUID_t persistence_guid;
- bool has_manual_topic_liveliness = false;
- CacheChange_t* fragmented_change = nullptr;
- };
- bool acceptMsgFrom(
- const GUID_t& entityId,
- ChangeKind_t change_kind);
- bool thereIsUpperRecordOf(
- const GUID_t& guid,
- const SequenceNumber_t& seq);
-
- void assert_writer_liveliness(
- const GUID_t& guid);
-
- bool writer_has_manual_liveliness(
- const GUID_t& guid);
-
-
- ResourceLimitedVector<RemoteWriterInfo_t> matched_writers_;
- };
- }
- }
- }
- #endif
- #endif
|