123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #ifndef _FASTDDS_RTPS_COMMON_LOCATORSELECTORENTRY_HPP_
- #define _FASTDDS_RTPS_COMMON_LOCATORSELECTORENTRY_HPP_
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
- #include <fastdds/rtps/common/Guid.h>
- #include <fastdds/rtps/common/Locator.h>
- #include <fastrtps/utils/collections/ResourceLimitedVector.hpp>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- struct LocatorSelectorEntry
- {
-
- struct EntryState
- {
-
- EntryState(
- size_t max_unicast_locators,
- size_t max_multicast_locators)
- : unicast(ResourceLimitedContainerConfig::fixed_size_configuration(max_unicast_locators))
- , multicast(ResourceLimitedContainerConfig::fixed_size_configuration(max_multicast_locators))
- {
- }
-
- ResourceLimitedVector<size_t> unicast;
-
- ResourceLimitedVector<size_t> multicast;
- };
-
- LocatorSelectorEntry(
- size_t max_unicast_locators,
- size_t max_multicast_locators)
- : remote_guid(c_Guid_Unknown)
- , unicast(ResourceLimitedContainerConfig::fixed_size_configuration(max_unicast_locators))
- , multicast(ResourceLimitedContainerConfig::fixed_size_configuration(max_multicast_locators))
- , state(max_unicast_locators, max_multicast_locators)
- , enabled(false)
- , transport_should_process(false)
- {
- }
-
- void enable(bool should_enable)
- {
- enabled = should_enable && remote_guid != c_Guid_Unknown;
- }
-
- void reset()
- {
- state.unicast.clear();
- state.multicast.clear();
- }
-
- GUID_t remote_guid;
-
- ResourceLimitedVector<Locator_t> unicast;
-
- ResourceLimitedVector<Locator_t> multicast;
-
- EntryState state;
-
- bool enabled;
-
- bool transport_should_process;
- };
- }
- }
- }
- #endif
- #endif
|