123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- #ifndef _FASTDDS_RTPS_BUILTIN_DATA_READERPROXYDATA_H_
- #define _FASTDDS_RTPS_BUILTIN_DATA_READERPROXYDATA_H_
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- #include <fastrtps/attributes/TopicAttributes.h>
- #include <fastrtps/qos/ReaderQos.h>
- #include <fastdds/rtps/attributes/WriterAttributes.h>
- #include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
- #if HAVE_SECURITY
- #include <fastdds/rtps/security/accesscontrol/EndpointSecurityAttributes.h>
- #endif
- #include <fastdds/rtps/common/RemoteLocators.hpp>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- struct CDRMessage_t;
- class NetworkFactory;
- class ReaderProxyData
- {
- public:
- RTPS_DllAPI ReaderProxyData(
- const size_t max_unicast_locators,
- const size_t max_multicast_locators);
- RTPS_DllAPI ReaderProxyData(
- const size_t max_unicast_locators,
- const size_t max_multicast_locators,
- const VariableLengthDataLimits& data_limits);
- RTPS_DllAPI virtual ~ReaderProxyData();
- RTPS_DllAPI ReaderProxyData(
- const ReaderProxyData& readerInfo);
- RTPS_DllAPI ReaderProxyData& operator =(
- const ReaderProxyData& readerInfo);
- RTPS_DllAPI void guid(
- const GUID_t& guid)
- {
- m_guid = guid;
- }
- RTPS_DllAPI void guid(
- GUID_t&& guid)
- {
- m_guid = std::move(guid);
- }
- RTPS_DllAPI const GUID_t& guid() const
- {
- return m_guid;
- }
- RTPS_DllAPI GUID_t& guid()
- {
- return m_guid;
- }
- RTPS_DllAPI bool has_locators() const
- {
- return !remote_locators_.unicast.empty() || !remote_locators_.multicast.empty();
- }
- RTPS_DllAPI const RemoteLocatorList& remote_locators() const
- {
- return remote_locators_;
- }
- RTPS_DllAPI void add_unicast_locator(
- const Locator_t& locator);
- void set_announced_unicast_locators(
- const LocatorList_t& locators);
- void set_remote_unicast_locators(
- const LocatorList_t& locators,
- const NetworkFactory& network);
- RTPS_DllAPI void add_multicast_locator(
- const Locator_t& locator);
- void set_multicast_locators(
- const LocatorList_t& locators,
- const NetworkFactory& network);
- void set_locators(
- const RemoteLocatorList& locators);
- void set_remote_locators(
- const RemoteLocatorList& locators,
- const NetworkFactory& network,
- bool use_multicast_locators);
- RTPS_DllAPI void key(
- const InstanceHandle_t& key)
- {
- m_key = key;
- }
- RTPS_DllAPI void key(
- InstanceHandle_t&& key)
- {
- m_key = std::move(key);
- }
- RTPS_DllAPI InstanceHandle_t key() const
- {
- return m_key;
- }
- RTPS_DllAPI InstanceHandle_t& key()
- {
- return m_key;
- }
- RTPS_DllAPI void RTPSParticipantKey(
- const InstanceHandle_t& RTPSParticipantKey)
- {
- m_RTPSParticipantKey = RTPSParticipantKey;
- }
- RTPS_DllAPI void RTPSParticipantKey(
- InstanceHandle_t&& RTPSParticipantKey)
- {
- m_RTPSParticipantKey = std::move(RTPSParticipantKey);
- }
- RTPS_DllAPI InstanceHandle_t RTPSParticipantKey() const
- {
- return m_RTPSParticipantKey;
- }
- RTPS_DllAPI InstanceHandle_t& RTPSParticipantKey()
- {
- return m_RTPSParticipantKey;
- }
- RTPS_DllAPI void typeName(
- const string_255& typeName)
- {
- m_typeName = typeName;
- }
- RTPS_DllAPI void typeName(
- string_255&& typeName)
- {
- m_typeName = std::move(typeName);
- }
- RTPS_DllAPI const string_255& typeName() const
- {
- return m_typeName;
- }
- RTPS_DllAPI string_255& typeName()
- {
- return m_typeName;
- }
- RTPS_DllAPI void topicName(
- const string_255& topicName)
- {
- m_topicName = topicName;
- }
- RTPS_DllAPI void topicName(
- string_255&& topicName)
- {
- m_topicName = std::move(topicName);
- }
- RTPS_DllAPI const string_255& topicName() const
- {
- return m_topicName;
- }
- RTPS_DllAPI string_255& topicName()
- {
- return m_topicName;
- }
- RTPS_DllAPI void userDefinedId(
- uint16_t userDefinedId)
- {
- m_userDefinedId = userDefinedId;
- }
- RTPS_DllAPI uint16_t userDefinedId() const
- {
- return m_userDefinedId;
- }
- RTPS_DllAPI uint16_t& userDefinedId()
- {
- return m_userDefinedId;
- }
- RTPS_DllAPI void isAlive(
- bool isAlive)
- {
- m_isAlive = isAlive;
- }
- RTPS_DllAPI bool isAlive() const
- {
- return m_isAlive;
- }
- RTPS_DllAPI bool& isAlive()
- {
- return m_isAlive;
- }
- RTPS_DllAPI void topicKind(
- TopicKind_t topicKind)
- {
- m_topicKind = topicKind;
- }
- RTPS_DllAPI TopicKind_t topicKind() const
- {
- return m_topicKind;
- }
- RTPS_DllAPI TopicKind_t& topicKind()
- {
- return m_topicKind;
- }
- RTPS_DllAPI void type_id(
- const TypeIdV1& other_type_id)
- {
- type_id() = other_type_id;
- }
- RTPS_DllAPI const TypeIdV1& type_id() const
- {
- assert(m_type_id != nullptr);
- return *m_type_id;
- }
- RTPS_DllAPI TypeIdV1& type_id()
- {
- if (m_type_id == nullptr)
- {
- m_type_id = new TypeIdV1();
- }
- return *m_type_id;
- }
- RTPS_DllAPI bool has_type_id() const
- {
- return m_type_id != nullptr;
- }
- RTPS_DllAPI void type(
- const TypeObjectV1& other_type)
- {
- type() = other_type;
- }
- RTPS_DllAPI const TypeObjectV1& type() const
- {
- assert(m_type != nullptr);
- return *m_type;
- }
- RTPS_DllAPI TypeObjectV1& type()
- {
- if (m_type == nullptr)
- {
- m_type = new TypeObjectV1();
- }
- return *m_type;
- }
- RTPS_DllAPI bool has_type() const
- {
- return m_type != nullptr;
- }
- RTPS_DllAPI void type_information(
- const xtypes::TypeInformation& other_type_information)
- {
- type_information() = other_type_information;
- }
- RTPS_DllAPI const xtypes::TypeInformation& type_information() const
- {
- assert(m_type_information != nullptr);
- return *m_type_information;
- }
- RTPS_DllAPI xtypes::TypeInformation& type_information()
- {
- if (m_type_information == nullptr)
- {
- m_type_information = new xtypes::TypeInformation();
- }
- return *m_type_information;
- }
- RTPS_DllAPI bool has_type_information() const
- {
- return m_type_information != nullptr;
- }
- inline bool disable_positive_acks() const
- {
- return m_qos.m_disablePositiveACKs.enabled;
- }
-
- uint32_t get_serialized_size(
- bool include_encapsulation) const;
-
- bool writeToCDRMessage(
- CDRMessage_t* msg,
- bool write_encapsulation) const;
-
- RTPS_DllAPI bool readFromCDRMessage(
- CDRMessage_t* msg,
- const NetworkFactory& network,
- bool is_shm_transport_available);
-
- bool m_expectsInlineQos;
-
- ReaderQos m_qos;
- #if HAVE_SECURITY
-
- security::EndpointSecurityAttributesMask security_attributes_;
-
- security::PluginEndpointSecurityAttributesMask plugin_security_attributes_;
- #endif
-
- void clear();
-
- bool is_update_allowed(
- const ReaderProxyData& rdata) const;
-
- void update(
- ReaderProxyData* rdata);
-
- void copy(
- ReaderProxyData* rdata);
- private:
-
- GUID_t m_guid;
-
- RemoteLocatorList remote_locators_;
-
- InstanceHandle_t m_key;
-
- InstanceHandle_t m_RTPSParticipantKey;
-
- string_255 m_typeName;
-
- string_255 m_topicName;
-
- uint16_t m_userDefinedId;
-
- bool m_isAlive;
-
- TopicKind_t m_topicKind;
-
- TypeIdV1* m_type_id;
-
- TypeObjectV1* m_type;
-
- xtypes::TypeInformation* m_type_information;
- };
- }
- }
- }
- #endif
- #endif
|