123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- #ifndef _FASTDDS_RTPS_MESSAGERECEIVER_H_
- #define _FASTDDS_RTPS_MESSAGERECEIVER_H_
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- #include <fastdds/rtps/common/all_common.h>
- #include <unordered_map>
- #include <mutex>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class RTPSParticipantImpl;
- class Endpoint;
- class RTPSWriter;
- class RTPSReader;
- struct SubmessageHeader_t;
- class MessageReceiver
- {
- public:
-
- MessageReceiver(
- RTPSParticipantImpl* participant,
- uint32_t rec_buffer_size);
- virtual ~MessageReceiver();
-
- void processCDRMsg(
- const Locator_t& loc,
- CDRMessage_t* msg);
-
- void associateEndpoint(
- Endpoint* to_add);
- void removeEndpoint(
- Endpoint* to_remove);
- private:
- std::mutex mtx_;
- std::vector<RTPSWriter*> associated_writers_;
- std::unordered_map<EntityId_t, std::vector<RTPSReader*> > associated_readers_;
- RTPSParticipantImpl* participant_;
-
- ProtocolVersion_t source_version_;
-
- VendorId_t source_vendor_id_;
-
- GuidPrefix_t source_guid_prefix_;
-
- GuidPrefix_t dest_guid_prefix_;
-
- bool have_timestamp_;
-
- Time_t timestamp_;
- #if HAVE_SECURITY
- CDRMessage_t crypto_msg_;
- #endif
-
- void reset();
-
- bool checkRTPSHeader(
- CDRMessage_t* msg);
-
- bool readSubmessageHeader(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
-
- bool willAReaderAcceptMsgDirectedTo(
- const EntityId_t& readerID);
-
- template<typename Functor>
- void findAllReaders(
- const EntityId_t& readerID,
- const Functor& callback);
-
-
-
- bool proc_Submsg_Data(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_DataFrag(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_Acknack(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_Heartbeat(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_Gap(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_InfoTS(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_InfoDST(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_InfoSRC(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_NackFrag(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
- bool proc_Submsg_HeartbeatFrag(
- CDRMessage_t* msg,
- SubmessageHeader_t* smh);
-
- };
- }
- }
- }
- #endif
- #endif
|