Class LocatorList

Class Documentation

class LocatorList

Class LocatorList, a Locator vector that doesn’t allow duplicates.

Public Types

using value_type = typename std::vector<Locator>::value_type

Public Functions

inline FASTDDS_EXPORTED_API LocatorList()

Constructor.

inline FASTDDS_EXPORTED_API ~LocatorList()

Destructor.

inline FASTDDS_EXPORTED_API LocatorList(const LocatorList &list)

Copy constructor.

inline FASTDDS_EXPORTED_API LocatorList(LocatorList &&list)

Move constructor.

inline FASTDDS_EXPORTED_API LocatorList & operator= (const LocatorList &list)

Copy assignment.

inline FASTDDS_EXPORTED_API LocatorList & operator= (LocatorList &&list)

Move assignment.

inline FASTDDS_EXPORTED_API bool operator== (const LocatorList &locator_list) const

Equal to operator.

inline FASTDDS_EXPORTED_API bool operator!= (const LocatorList &locator_list) const

Not equal to operator.

inline FASTDDS_EXPORTED_API LocatorListIterator begin ()

Return an iterator to the beginning.

Returns:

LocatorListIterator iterator to the first locator.

inline FASTDDS_EXPORTED_API LocatorListIterator end ()

Return an iterator to the end.

Returns:

LocatorListIterator iterator to the element following the last element.

inline FASTDDS_EXPORTED_API LocatorListConstIterator begin () const

Return a constant iterator to the beginning.

Returns:

LocatorListConstIterator iterator to the first locator.

inline FASTDDS_EXPORTED_API LocatorListConstIterator end () const

Return a constant iterator to the end.

Returns:

LocatorListConstIterator iterator to the element following the last element.

inline FASTDDS_EXPORTED_API size_t size () const

Return the number of locators.

Returns:

size_t The number of locators in the container.

inline FASTDDS_EXPORTED_API LocatorList & assign (const LocatorList &list)

Replace the contents of the container.

Parameters:

list – New content to be saved into the container.

Returns:

LocatorList& reference to the container with the replaced content.

inline FASTDDS_EXPORTED_API void clear ()

Erase all locators from the container.

inline FASTDDS_EXPORTED_API void reserve (size_t num)

Reserve storage increasing the capacity of the vector.

Parameters:

num – new capacity of the vector, in number of elements.

inline FASTDDS_EXPORTED_API void resize (size_t num)

Resize the container to contain num locators. If the current size is greater than num, the container is reduced to its first num locators. If the current size is less than count, additional default-inserted locators are appended.

Parameters:

num – new size of the container.

inline FASTDDS_EXPORTED_API void push_back (const Locator &loc)

Add locator to the end if not found within the list.

Parameters:

loc – locator to be appended.

inline FASTDDS_EXPORTED_API void push_back (const LocatorList &locList)

Add several locators to the end if not already present within the list.

Parameters:

locListLocatorList with the locators to be appended.

inline FASTDDS_EXPORTED_API bool empty () const

Check that the container has no locators.

Returns:

true if the container is empty. False otherwise.

inline FASTDDS_EXPORTED_API void erase (const Locator &loc)

Erase the specified locator from the container.

Parameters:

loc – Locator to be removed.

inline FASTDDS_EXPORTED_API bool isValid () const

Check that every locator contained in the list is not LOCATOR_KIND_INVALID.

Returns:

true if all locators are valid. False otherwise.

inline FASTDDS_EXPORTED_API void swap (LocatorList &locatorList)

exchange the content of the container.

Parameters:

locatorList – container to exchange the contents with.

template<int kind>
inline bool has_kind() const
inline FASTDDS_EXPORTED_API void copy_to (eprosima::fastdds::ResourceLimitedVector< Locator > &locator_list) const