Browse Source

add thirdpartilib/Fastrtps. because it's very important.

yuchuli 3 years ago
parent
commit
de86f35a85
100 changed files with 27479 additions and 0 deletions
  1. 3 0
      src1/common/modulecomm/fastrtps/modulecomm_fastrtps.pri
  2. 2939 0
      thirdpartylib/FastRTPS/include/fastcdr/Cdr.h
  3. 312 0
      thirdpartylib/FastRTPS/include/fastcdr/FastBuffer.h
  4. 1756 0
      thirdpartylib/FastRTPS/include/fastcdr/FastCdr.h
  5. 53 0
      thirdpartylib/FastRTPS/include/fastcdr/config.h
  6. 53 0
      thirdpartylib/FastRTPS/include/fastcdr/config.h.in
  7. 66 0
      thirdpartylib/FastRTPS/include/fastcdr/eProsima_auto_link.h
  8. 85 0
      thirdpartylib/FastRTPS/include/fastcdr/exceptions/BadParamException.h
  9. 98 0
      thirdpartylib/FastRTPS/include/fastcdr/exceptions/Exception.h
  10. 85 0
      thirdpartylib/FastRTPS/include/fastcdr/exceptions/NotEnoughMemoryException.h
  11. 69 0
      thirdpartylib/FastRTPS/include/fastcdr/fastcdr_dll.h
  12. 63 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/ReplyHeader.hpp
  13. 63 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/RequestHeader.hpp
  14. 46 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/Types.hpp
  15. 292 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp
  16. 89 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp
  17. 90 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp
  18. 425 0
      thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp
  19. 149 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/Entity.hpp
  20. 1582 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/ParameterTypes.hpp
  21. 2704 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/QosPolicies.hpp
  22. 88 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp
  23. 70 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp
  24. 56 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/BaseStatus.hpp
  25. 65 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/DeadlineMissedStatus.hpp
  26. 83 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp
  27. 59 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/LivelinessChangedStatus.hpp
  28. 55 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/MatchedStatus.hpp
  29. 41 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/PublicationMatchedStatus.hpp
  30. 71 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/SampleRejectedStatus.hpp
  31. 254 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/StatusMask.hpp
  32. 42 0
      thirdpartylib/FastRTPS/include/fastdds/dds/core/status/SubscriptionMatchedStatus.hpp
  33. 612 0
      thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipant.hpp
  34. 233 0
      thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipantFactory.hpp
  35. 169 0
      thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipantListener.hpp
  36. 97 0
      thirdpartylib/FastRTPS/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp
  37. 293 0
      thirdpartylib/FastRTPS/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp
  38. 60 0
      thirdpartylib/FastRTPS/include/fastdds/dds/log/Colors.hpp
  39. 77 0
      thirdpartylib/FastRTPS/include/fastdds/dds/log/FileConsumer.hpp
  40. 321 0
      thirdpartylib/FastRTPS/include/fastdds/dds/log/Log.hpp
  41. 46 0
      thirdpartylib/FastRTPS/include/fastdds/dds/log/StdoutConsumer.hpp
  42. 309 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/DataWriter.hpp
  43. 114 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/DataWriterListener.hpp
  44. 303 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/Publisher.hpp
  45. 62 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/PublisherListener.hpp
  46. 810 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/DataWriterQos.hpp
  47. 197 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/PublisherQos.hpp
  48. 151 0
      thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/WriterQos.hpp
  49. 305 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/DataReader.hpp
  50. 152 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/DataReaderListener.hpp
  51. 109 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/SampleInfo.hpp
  52. 307 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/Subscriber.hpp
  53. 74 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/SubscriberListener.hpp
  54. 819 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp
  55. 155 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/ReaderQos.hpp
  56. 198 0
      thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp
  57. 155 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/Topic.hpp
  58. 299 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicDataType.hpp
  59. 105 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicDescription.hpp
  60. 73 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicListener.hpp
  61. 224 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/TypeSupport.hpp
  62. 509 0
      thirdpartylib/FastRTPS/include/fastdds/dds/topic/qos/TopicQos.hpp
  63. 115 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/Endpoint.h
  64. 202 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/RTPSDomain.h
  65. 124 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/EndpointAttributes.h
  66. 90 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/HistoryAttributes.h
  67. 124 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/PropertyPolicy.h
  68. 178 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp
  69. 471 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h
  70. 111 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/ReaderAttributes.h
  71. 82 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/ServerAttributes.h
  72. 147 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/WriterAttributes.h
  73. 189 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/BuiltinProtocols.h
  74. 229 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/ParticipantProxyData.h
  75. 446 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/ReaderProxyData.h
  76. 466 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/WriterProxyData.h
  77. 348 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDP.h
  78. 90 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPClient.h
  79. 197 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPServer.h
  80. 258 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h
  81. 170 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPStatic.h
  82. 432 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDP.h
  83. 140 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPClient.h
  84. 86 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPListener.h
  85. 283 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPServer.h
  86. 66 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPServerListener.h
  87. 134 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPSimple.h
  88. 63 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/timedevent/DSClientEvent.h
  89. 65 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/timedevent/DServerEvent.h
  90. 306 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/liveliness/WLP.h
  91. 94 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/liveliness/WLPListener.h
  92. 182 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/BinaryProperty.h
  93. 242 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/CDRMessage_t.h
  94. 596 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/CacheChange.h
  95. 340 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/EntityId_t.hpp
  96. 55 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/FragmentNumber.h
  97. 264 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/Guid.h
  98. 142 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/GuidPrefix_t.hpp
  99. 243 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/InstanceHandle.h
  100. 465 0
      thirdpartylib/FastRTPS/include/fastdds/rtps/common/Locator.h

+ 3 - 0
src1/common/modulecomm/fastrtps/modulecomm_fastrtps.pri

@@ -17,3 +17,6 @@ SOURCES += \
     $$PWD/modulecomm_fastrtps_tcp.cpp \
     $$PWD/modulecomm_impl_shm.cpp \
     $$PWD/modulecomm_impl_tcp.cpp
+
+INCLUDEPATH += $$PWD/../../../../thirdpartylib/FastRTPS/include
+LIBS += -L$$PWD/../../../../thirdpartylib/FastRTPS/lib

+ 2939 - 0
thirdpartylib/FastRTPS/include/fastcdr/Cdr.h

@@ -0,0 +1,2939 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_CDR_H_
+#define _FASTCDR_CDR_H_
+
+#include "fastcdr_dll.h"
+#include "FastBuffer.h"
+#include "exceptions/NotEnoughMemoryException.h"
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include <map>
+#include <iostream>
+
+#if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__
+#include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
+
+#if HAVE_CXX0X
+#include <array>
+#endif
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        /*!
+         * @brief This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an eprosima::fastcdr::FastBuffer.
+         * @ingroup FASTCDRAPIREFERENCE
+         */
+        class Cdr_DllAPI Cdr
+        {
+            public:
+
+                //! @brief This enumeration represents the two kinds of CDR serialization supported by eprosima::fastcdr::CDR.
+                typedef enum
+                {
+                    //! @brief Common CORBA CDR serialization.
+                    CORBA_CDR,
+                    //! @brief DDS CDR serialization.
+                    DDS_CDR
+                } CdrType;
+
+                //! @brief This enumeration represents the two posible values of the flag that points if the content is a parameter list (only in DDS CDR).
+                typedef enum
+#ifdef HAVE_CXX0X
+                    : uint8_t
+#endif
+                    {
+                        //! @brief Specifies that the content is not a parameter list.
+                        DDS_CDR_WITHOUT_PL = 0x0,
+                        //! @brief Specifies that the content is a parameter list.
+                        DDS_CDR_WITH_PL = 0x2
+                    } DDSCdrPlFlag;
+
+                /*!
+                 * @brief This enumeration represents endianness types.
+                 */
+                typedef enum
+#ifdef HAVE_CXX0X
+                    : uint8_t
+#endif
+                    {
+                        //! @brief Big endianness.
+                        BIG_ENDIANNESS = 0x0,
+                        //! @brief Little endianness.
+                        LITTLE_ENDIANNESS = 0x1
+                    } Endianness;
+
+                //! @brief Default endiness in the system.
+                static const Endianness DEFAULT_ENDIAN;
+
+                /*!
+                 * @brief This class stores the current state of a CDR serialization.
+                 */
+                class Cdr_DllAPI state
+                {
+                    friend class Cdr;
+                    public:
+
+                    /*!
+                     * @brief Default constructor.
+                     */
+                    state(const Cdr &cdr);
+
+                    /*!
+                     * @brief Copy constructor.
+                     */
+                    state(const state&);
+
+                    private:
+
+                    state& operator=(const state&) = delete;
+
+                    //! @brief The position in the buffer when the state was created.
+                    const FastBuffer::iterator m_currentPosition;
+
+                    //! @brief The position from the aligment is calculated,  when the state was created..
+                    const FastBuffer::iterator m_alignPosition;
+
+                    //! @brief This attribute specified if it is needed to swap the bytes when the state was created..
+                    bool m_swapBytes;
+
+                    //! @brief Stores the last datasize serialized/deserialized when the state was created.
+                    size_t m_lastDataSize;
+                };
+
+                /*!
+                 * @brief This constructor creates an eprosima::fastcdr::Cdr object that can serialize/deserialize
+                 * the assigned buffer.
+                 *
+                 * @param cdrBuffer A reference to the buffer that contains (or will contain) the CDR representation.
+                 * @param endianness The initial endianness that will be used. The default value is the endianness of the system.
+                 * @param cdrType Represents the type of CDR that will be used in serialization/deserialization. The default value is CORBA CDR.
+                 */
+                Cdr(FastBuffer &cdrBuffer, const Endianness endianness = DEFAULT_ENDIAN, const CdrType cdrType = CORBA_CDR);
+
+                /*!
+                 * @brief This function reads the encapsulation of the CDR stream.
+                 *        If the CDR stream contains an encapsulation, then this function should be called before starting to deserialize.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                Cdr& read_encapsulation();
+
+                /*!
+                 * @brief This function writes the encapsulation of the CDR stream.
+                 *        If the CDR stream should contain an encapsulation, then this function should be called before starting to serialize.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize_encapsulation();
+
+                /*!
+                 * @brief This function returns the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR.
+                 * @return The flag that specifies if the content is a parameter list.
+                 */
+                DDSCdrPlFlag getDDSCdrPlFlag() const;
+
+                /*!
+                * @brief This function sets the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR.
+                * @param plFlag New value for the flag that specifies if the content is a parameter list.
+                */
+                void setDDSCdrPlFlag(DDSCdrPlFlag plFlag);
+
+                /*!
+                 * @brief This function returns the option flags when the CDR type is eprosima::fastcdr::DDS_CDR.
+                 * @return The option flags.
+                 */
+                uint16_t getDDSCdrOptions() const;
+
+                /*!
+                * @brief This function sets the option flags when the CDR type is eprosima::fastcdr::DDS_CDR.
+                * @param options New value for the option flags.
+                */
+                void setDDSCdrOptions(uint16_t options);
+
+                /*!
+                * @brief This function sets the current endianness used by the CDR type.
+                * @param endianness The new endianness value.
+                */
+                void changeEndianness(Endianness endianness);
+
+                /*!
+                 * @brief This function returns the current endianness used by the CDR type.
+                 * @return The endianness.
+                 */
+                Endianness endianness() const { return static_cast<Endianness>(m_endianness); }
+
+                /*!
+                 * @brief This function skips a number of bytes in the CDR stream buffer.
+                 * @param numBytes The number of bytes that will be jumped.
+                 * @return True is returned when it works successfully. Otherwise, false is returned.
+                 */
+                bool jump(size_t numBytes);
+
+                /*!
+                 * @brief This function resets the current position in the buffer to the beginning.
+                 */
+                void reset();
+
+                /*!
+                 * @brief This function returns the pointer to the current used buffer.
+                 * @return Pointer to the starting position of the buffer.
+                 */
+                char* getBufferPointer();
+
+                /*!
+                 * @brief This function returns the current position in the CDR stream.
+                 * @return Pointer to the current position in the buffer.
+                 */
+                char* getCurrentPosition();
+
+                /*!
+                 * @brief This function returns the length of the serialized data inside the stream.
+                 * @return The length of the serialized data.
+                 */
+                inline size_t getSerializedDataLength() const { return m_currentPosition - m_cdrBuffer.begin();}
+
+                /*!
+                 * @brief Get the number of bytes needed to align a position to certain data size.
+                 * @param current_alignment Position to be aligned.
+                 * @param dataSize Size of next data to process (should be power of two).
+                 * @return Number of required alignment bytes.
+                 */
+                inline static size_t alignment(size_t current_alignment, size_t dataSize) { return (dataSize - (current_alignment % dataSize)) & (dataSize-1);}
+
+                /*!
+                 * @brief This function returns the current state of the CDR serialization process.
+                 * @return The current state of the CDR serialization process.
+                 */
+                state getState();
+
+                /*!
+                 * @brief This function sets a previous state of the CDR serialization process;
+                 * @param state Previous state that will be set.
+                 */
+                void setState(state &state);
+
+                /*!
+                 * @brief This function moves the alignment forward.
+                 * @param numBytes The number of bytes the alignment should advance.
+                 * @return True If alignment was moved successfully.
+                 */
+                bool moveAlignmentForward(size_t numBytes);
+
+                /*!
+                 * @brief This function resets the alignment to the current position in the buffer.
+                 */
+                inline void resetAlignment(){m_alignPosition = m_currentPosition;}
+
+                /*!
+                 * @brief This operator serializes an octet.
+                 * @param octet_t The value of the octet that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const uint8_t octet_t){return serialize(octet_t);}
+
+                /*!
+                 * @brief This operator serializes a character.
+                 * @param char_t The value of the character that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const char char_t){return serialize(char_t);}
+
+                /*!
+                 * @brief This operator serializes a int8_t.
+                 * @param int8 The value of the int8_t that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const int8_t int8){return serialize(int8);}
+
+                /*!
+                 * @brief This operator serializes an unsigned short.
+                 * @param ushort_t The value of the unsigned short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const uint16_t ushort_t){return serialize(ushort_t);}
+
+                /*!
+                 * @brief This operator serializes a short.
+                 * @param short_t The value of the short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const int16_t short_t){return serialize(short_t);}
+
+                /*!
+                 * @brief This operator serializes an unsigned long.
+                 * @param ulong_t The value of the unsigned long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const uint32_t ulong_t){return serialize(ulong_t);}
+
+                /*!
+                 * @brief This operator serializes a long.
+                 * @param ulong_t The value of the long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const int32_t long_t){return serialize(long_t);}
+
+                /*!
+                 * @brief This operator serializes a wide-char.
+                 * @param wchar The value of the wide-char that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const wchar_t wchar){return serialize(wchar);}
+
+                /*!
+                 * @brief This operator serializes an unsigned long long.
+                 * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const uint64_t ulonglong_t){return serialize(ulonglong_t);}
+
+                /*!
+                 * @brief This operator serializes a long long.
+                 * @param longlong_t The value of the long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const int64_t longlong_t){return serialize(longlong_t);}
+
+                /*!
+                 * @brief This operator serializes a float.
+                 * @param float_t The value of the float that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const float float_t){return serialize(float_t);}
+
+                /*!
+                 * @brief This operator serializes a double.
+                 * @param double_t The value of the double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const double double_t){return serialize(double_t);}
+
+                /*!
+                 * @brief This operator serializes a long double.
+                 * @param ldouble_t The value of the long double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const long double ldouble_t){return serialize(ldouble_t);}
+
+                /*!
+                 * @brief This operator serializes a boolean.
+                 * @param bool_t The value of the boolean that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const bool bool_t){return serialize(bool_t);}
+
+                /*!
+                 * @brief This operator serializes a null-terminated c-string.
+                 * @param string_t Pointer to the begining of the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const char *string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a null-terminated c-string.
+                 * @param string_t Pointer to the begining of the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(char *string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a string.
+                 * @param string_t The string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const std::string &string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a wstring.
+                 * @param string_t The wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator<<(const std::wstring &string_t){return serialize(string_t);}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This operator template is used to serialize arrays.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& operator<<(const std::array<_T, _Size> &array_t){return serialize<_T, _Size>(array_t);}
+#endif
+
+                /*!
+                 * @brief This operator template is used to serialize sequences.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& operator<<(const std::vector<_T> &vector_t){return serialize<_T>(vector_t);}
+
+                /*!
+                 * @brief This operator template is used to serialize maps.
+                 * @param map_t The map that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _K, class _T>
+                    inline Cdr& operator<<(const std::map<_K, _T> &map_t){return serialize<_K, _T>(map_t);}
+
+                /*!
+                 * @brief This operator template is used to serialize any other non-basic type.
+                 * @param type_t A reference to the object that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& operator<<(const _T &type_t)
+                    {
+                        type_t.serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This operator deserializes an octet.
+                 * @param octet_t The variable that will store the octet read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(uint8_t &octet_t){return deserialize(octet_t);}
+
+                /*!
+                 * @brief This operator deserializes a character.
+                 * @param char_t The variable that will store the character read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(char &char_t){return deserialize(char_t);}
+
+                /*!
+                 * @brief This operator deserializes a int8_t.
+                 * @param int8 The variable that will store the int8_t read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(int8_t &int8){return deserialize(int8);}
+
+                /*!
+                 * @brief This operator deserializes an unsigned short.
+                 * @param ushort_t The variable that will store the unsigned short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(uint16_t &ushort_t){return deserialize(ushort_t);}
+
+                /*!
+                 * @brief This operator deserializes a short.
+                 * @param short_t The variable that will store the short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(int16_t &short_t){return deserialize(short_t);}
+
+                /*!
+                 * @brief This operator deserializes an unsigned long.
+                 * @param ulong_t The variable that will store the unsigned long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(uint32_t &ulong_t){return deserialize(ulong_t);}
+
+                /*!
+                 * @brief This operator deserializes a long.
+                 * @param long_t The variable that will store the long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(int32_t &long_t){return deserialize(long_t);}
+
+                // TODO in FastCdr
+                /*!
+                 * @brief This operator deserializes a wide-char.
+                 * @param wchar The variable that will store the wide-char read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(wchar_t &wchar){return deserialize(wchar);}
+
+                /*!
+                 * @brief This operator deserializes a unsigned long long.
+                 * @param ulonglong_t The variable that will store the unsigned long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(uint64_t &ulonglong_t){return deserialize(ulonglong_t);}
+
+                /*!
+                 * @brief This operator deserializes a long long.
+                 * @param longlong_t The variable that will store the long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(int64_t &longlong_t){return deserialize(longlong_t);}
+
+                /*!
+                 * @brief This operator deserializes a float.
+                 * @param float_t The variable that will store the float read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(float &float_t){return deserialize(float_t);}
+
+                /*!
+                 * @brief This operator deserializes a double.
+                 * @param double_t The variable that will store the double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(double &double_t){return deserialize(double_t);}
+
+                /*!
+                 * @brief This operator deserializes a long double.
+                 * @param ldouble_t The variable that will store the long double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(long double &ldouble_t){return deserialize(ldouble_t);}
+
+                /*!
+                 * @brief This operator deserializes a boolean.
+                 * @param bool_t The variable that will store the boolean read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                inline Cdr& operator>>(bool &bool_t){return deserialize(bool_t);}
+
+                /*!
+                 * @brief This operator deserializes a null-terminated c-string.
+                 * @param string_t The variable that will store the c-string read from the buffer.
+                 *                 Please note that a newly allocated string will be returned.
+                 *                 The caller should free the returned pointer when appropiate.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                inline Cdr& operator>>(char *&string_t){return deserialize(string_t);}
+
+                /*!
+                 * @brief This operator deserializes a string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(std::string &string_t){return deserialize(string_t);}
+
+                /*!
+                 * @brief This operator deserializes a string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& operator>>(std::wstring &string_t){return deserialize(string_t);}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This operator template is used to deserialize arrays.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& operator>>(std::array<_T, _Size> &array_t){return deserialize<_T, _Size>(array_t);}
+#endif
+
+                /*!
+                 * @brief This operator template is used to deserialize sequences.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& operator>>(std::vector<_T> &vector_t){return deserialize<_T>(vector_t);}
+
+                /*!
+                 * @brief This operator template is used to deserialize maps.
+                 * @param map_t The variable that will store the map read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _K, class _T>
+                    inline Cdr& operator>>(std::map<_K, _T> &map_t){return deserialize<_K, _T>(map_t);}
+
+                /*!
+                 * @brief This operator template is used to deserialize any other non-basic type.
+                 * @param type_t The variable that will store the object read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& operator>>(_T &type_t)
+                    {
+                        type_t.deserialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an octet.
+                 * @param octet_t The value of the octet that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint8_t octet_t)
+                    {
+                        return serialize(static_cast<char>(octet_t));
+                    }
+
+                /*!
+                 * @brief This function serializes an octet with a different endianness.
+                 * @param octet_t The value of the octet that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint8_t octet_t, Endianness endianness)
+                    {
+                        return serialize(static_cast<char>(octet_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes a character.
+                 * @param char_t The value of the character that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const char char_t);
+
+                /*!
+                 * @brief This function serializes a character with a different endianness.
+                 * @param char_t The value of the character that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const char char_t, Endianness /*endianness*/)
+                    {
+                        return serialize(char_t);
+                    }
+
+                /*!
+                 * @brief This function serializes an int8_t.
+                 * @param int8 The value of the int8_t that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const int8_t int8)
+                    {
+                        return serialize(static_cast<char>(int8));
+                    }
+
+                /*!
+                 * @brief This function serializes an int8_t with a different endianness.
+                 * @param octet_t The value of the int8_t that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const int8_t int8, Endianness endianness)
+                    {
+                        return serialize(static_cast<char>(int8), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned short.
+                 * @param ushort_t The value of the unsigned short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint16_t ushort_t)
+                    {
+                        return serialize(static_cast<int16_t>(ushort_t));
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned short with a different endianness.
+                 * @param ushort_t The value of the unsigned short that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint16_t ushort_t, Endianness endianness)
+                    {
+                        return serialize(static_cast<int16_t>(ushort_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes a short.
+                 * @param short_t The value of the short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int16_t short_t);
+
+                /*!
+                 * @brief This function serializes a short with a different endianness.
+                 * @param short_t The value of the short that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int16_t short_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an unsigned long.
+                 * @param ulong_t The value of the unsigned long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint32_t ulong_t)
+                    {
+                        return serialize(static_cast<int32_t>(ulong_t));
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned long with a different endianness.
+                 * @param ulong_t The value of the unsigned long that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint32_t ulong_t, Endianness endianness)
+                    {
+                        return serialize(static_cast<int32_t>(ulong_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes a long.
+                 * @param long_t The value of the long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int32_t long_t);
+
+                /*!
+                 * @brief This function serializes a long with a different endianness.
+                 * @param long_t The value of the long that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int32_t long_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a wide-char.
+                 * @param wchar The value of the wide-char that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const wchar_t wchar)
+                    {
+                        return serialize(static_cast<uint32_t>(wchar));
+                    }
+
+                /*!
+                 * @brief This function serializes a wide-char with a different endianness.
+                 * @param wchar The value of the wide-char that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const wchar_t wchar, Endianness endianness)
+                    {
+                        return serialize(static_cast<uint32_t>(wchar), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned long long.
+                 * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint64_t ulonglong_t)
+                    {
+                        return serialize(static_cast<int64_t>(ulonglong_t));
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned long long with a different endianness.
+                 * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const uint64_t ulonglong_t, Endianness endianness)
+                    {
+                        return serialize(static_cast<int64_t>(ulonglong_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes a long long.
+                 * @param longlong_t The value of the long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int64_t longlong_t);
+
+                /*!
+                 * @brief This function serializes a long long with a different endianness.
+                 * @param longlong_t The value of the long long that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const int64_t longlong_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a float.
+                 * @param float_t The value of the float that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const float float_t);
+
+                /*!
+                 * @brief This function serializes a float with a different endianness.
+                 * @param float_t The value of the float that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const float float_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a double.
+                 * @param double_t The value of the double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const double double_t);
+
+                /*!
+                 * @brief This function serializes a double with a different endianness.
+                 * @param double_t The value of the double that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const double double_t, Endianness endianness);
+
+
+                /*!
+                 * @brief This function serializes a long double.
+                 * @param ldouble_t The value of the long double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible.
+                 */
+                Cdr& serialize(const long double ldouble_t);
+
+                /*!
+                 * @brief This function serializes a long double with a different endianness.
+                 * @param ldouble_t The value of the long double that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible.
+                 */
+                Cdr& serialize(const long double ldouble_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a boolean.
+                 * @param bool_t The value of the boolean that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const bool bool_t);
+
+                /*!
+                 * @brief This function serializes a boolean with a different endianness.
+                 * @param bool_t The value of the boolean that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const bool bool_t, Endianness /*endianness*/)
+                    {
+                        return serialize(bool_t);
+                    }
+
+                /*!
+                 * @brief This function serializes a string.
+                 * @param string_t The pointer to the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline Cdr& serialize(char *string_t) { return serialize(static_cast<const char*>(string_t)); }
+
+                /*!
+                 * @brief This function serializes a string.
+                 * @param string_t The pointer to the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const char *string_t);
+
+                /*!
+                 * @brief This function serializes a wstring.
+                 * @param string_t The pointer to the wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const wchar_t *string_t);
+
+                /*!
+                 * @brief This function serializes a string with a different endianness.
+                 * @param string_t The pointer to the string that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const char *string_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a wstring with a different endianness.
+                 * @param string_t The pointer to the wstring that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serialize(const wchar_t *string_t, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes a std::string.
+                 * @param string_t The string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const std::string &string_t) {return serialize(string_t.c_str());}
+
+                /*!
+                 * @brief This function serializes a std::wstring.
+                 * @param string_t The wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const std::wstring &string_t) {return serialize(string_t.c_str());}
+
+                /*!
+                 * @brief This function serializes a std::string with a different endianness.
+                 * @param string_t The string that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serialize(const std::string &string_t, Endianness endianness)  {return serialize(string_t.c_str(), endianness);}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template serializes an array.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& serialize(const std::array<_T, _Size> &array_t)
+                    { return serializeArray(array_t.data(), array_t.size());}
+
+                /*!
+                 * @brief This function template serializes an array with a different endianness.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& serialize(const std::array<_T, _Size> &array_t, Endianness endianness)
+                    { return serializeArray(array_t.data(), array_t.size(), endianness);}
+#endif
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template serializes a sequence of booleans.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T = bool>
+                    Cdr& serialize(const std::vector<bool> &vector_t)
+                    {
+                        return serializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template serializes a sequence.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serialize(const std::vector<_T> &vector_t)
+                    {
+                        state state_before_error(*this);
+
+                        *this << static_cast<int32_t>(vector_t.size());
+
+                        try
+                        {
+                            return serializeArray(vector_t.data(), vector_t.size());
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes a map.
+                 * @param map_t The map that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _K, class _T>
+                    Cdr& serialize(const std::map<_K, _T> &map_t)
+                    {
+                        state state_(*this);
+
+                        *this << static_cast<int32_t>(map_t.size());
+
+                        try
+                        {
+                            for (auto it_pair = map_t.begin(); it_pair != map_t.end(); ++it_pair)
+                            {
+                                *this << it_pair->first;
+                                *this << it_pair->second;
+                            }
+                            //return serializeArray(map_t.data(), map_t.size());
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template serializes a sequence of booleans.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<>
+                    Cdr& serialize<bool>(const std::vector<bool> &vector_t)
+                    {
+                        return serializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template serializes a sequence with a different endianness.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serialize(const std::vector<_T> &vector_t, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            serialize(vector_t);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes a non-basic object.
+                 * @param type_t The object that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& serialize(const _T &type_t)
+                    {
+                        type_t.serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of octets.
+                 * @param octet_t The sequence of octets that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint8_t *octet_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(octet_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of octets with a different endianness.
+                 * @param octet_t The array of octets that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint8_t *octet_t, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(octet_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of characters.
+                 * @param char_t The array of characters that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const char *char_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of characters with a different endianness.
+                 * @param char_t The array of characters that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const char *char_t, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return serializeArray(char_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of int8_t.
+                 * @param int8 The sequence of int8_t that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const int8_t *int8, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(int8), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of int8_t with a different endianness.
+                 * @param int8 The array of int8_t that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const int8_t *int8, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(int8), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of unsigned shorts.
+                 * @param ushort_t The array of unsigned shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint16_t *ushort_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int16_t*>(ushort_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of unsigned shorts with a different endianness.
+                 * @param ushort_t The array of unsigned shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint16_t *ushort_t, size_t numElements, Endianness endianness)
+                    {
+                        return serializeArray(reinterpret_cast<const int16_t*>(ushort_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of shorts.
+                 * @param short_t The array of shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int16_t *short_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of shorts with a different endianness.
+                 * @param short_t The array of shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int16_t *short_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of unsigned longs.
+                 * @param ulong_t The array of unsigned longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint32_t *ulong_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int32_t*>(ulong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of unsigned longs with a different endianness.
+                 * @param ulong_t The array of unsigned longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint32_t *ulong_t, size_t numElements, Endianness endianness)
+                    {
+                        return serializeArray(reinterpret_cast<const int32_t*>(ulong_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of longs.
+                 * @param long_t The array of longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int32_t *long_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of longs with a different endianness.
+                 * @param long_t The array of longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int32_t *long_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of wide-chars.
+                 * @param wchar The array of wide-chars that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const wchar_t *wchar, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of wide-chars with a different endianness.
+                 * @param wchar The array of longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const wchar_t *wchar, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of unsigned long longs.
+                 * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint64_t *ulonglong_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int64_t*>(ulonglong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of unsigned long longs with a different endianness.
+                 * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const uint64_t *ulonglong_t, size_t numElements, Endianness endianness)
+                    {
+                        return serializeArray(reinterpret_cast<const int64_t*>(ulonglong_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of long longs.
+                 * @param longlong_t The array of long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int64_t *longlong_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of long longs with a different endianness.
+                 * @param longlong_t The array of long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const int64_t *longlong_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of floats.
+                 * @param float_t The array of floats that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const float *float_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of floats with a different endianness.
+                 * @param float_t The array of floats that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const float *float_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of doubles.
+                 * @param double_t The array of doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const double *double_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of doubles with a different endianness.
+                 * @param double_t The array of doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const double *double_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of long doubles.
+                 * @param ldouble_t The array of long doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const long double *ldouble_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of long doubles with a different endianness.
+                 * @param ldouble_t The array of long doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const long double *ldouble_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function serializes an array of booleans.
+                 * @param bool_t The array of booleans that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                Cdr& serializeArray(const bool *bool_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of booleans with a different endianness.
+                 * @param bool_t The array of booleans that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const bool *bool_t, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return serializeArray(bool_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of strings.
+                 * @param string_t The array of strings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const std::string *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(string_t[count].c_str());
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of wide-strings.
+                 * @param string_t The array of wide-strings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const std::wstring *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(string_t[count].c_str());
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of strings with a different endianness.
+                 * @param string_t The array of strings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const std::string *string_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            serializeArray(string_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of wide-strings with a different endianness.
+                 * @param string_t The array of wide-strings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& serializeArray(const std::wstring *string_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            serializeArray(string_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes an array of sequences of objects.
+                 * @param vector_t The array of sequences of objects that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serializeArray(const std::vector<_T> *vector_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(vector_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes an array of non-basic objects.
+                 * @param type_t The array of objects that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serializeArray(const _T *type_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            type_t[count].serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes an array of non-basic objects with a different endianness.
+                 * @param type_t The array of objects that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serializeArray(const _T *type_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            serializeArray(type_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes a raw sequence.
+                 * @param sequence_t Pointer to the sequence that will be serialized in the buffer.
+                 * @param numElements The number of elements contained in the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serializeSequence(const _T *sequence_t, size_t numElements)
+                    {
+                        state state_before_error(*this);
+
+                        serialize(static_cast<int32_t>(numElements));
+
+                        try
+                        {
+                            return serializeArray(sequence_t, numElements);
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes a raw sequence with a different endianness.
+                 * @param sequence_t Pointer to the sequence that will be serialized in the buffer.
+                 * @param numElements The number of elements contained in the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& serializeSequence(const _T *sequence_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            serializeSequence(sequence_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an octet.
+                 * @param octet_t The variable that will store the octet read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint8_t &octet_t)
+                    {
+                        return deserialize(reinterpret_cast<char&>(octet_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes an octet with a different endianness.
+                 * @param octet_t The variable that will store the octet read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint8_t &octet_t, Endianness endianness)
+                    {
+                        return deserialize(reinterpret_cast<char&>(octet_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes a character.
+                 * @param char_t The variable that will store the character read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(char &char_t);
+
+                /*!
+                 * @brief This function deserializes a character with a different endianness.
+                 * @param char_t The variable that will store the character read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(char &char_t, Endianness /*endianness*/)
+                    {
+                        return deserialize(char_t);
+                    }
+
+                /*!
+                 * @brief This function deserializes an int8_t.
+                 * @param int8 The variable that will store the int8_t read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(int8_t &int8)
+                    {
+                        return deserialize(reinterpret_cast<char&>(int8));
+                    }
+
+                /*!
+                 * @brief This function deserializes an int8_t with a different endianness.
+                 * @param int8 The variable that will store the int8_t read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(int8_t &int8, Endianness endianness)
+                    {
+                        return deserialize(reinterpret_cast<char&>(int8), endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned short.
+                 * @param ushort_t The variable that will store the unsigned short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint16_t &ushort_t)
+                    {
+                        return deserialize(reinterpret_cast<int16_t&>(ushort_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned short with a different endianness.
+                 * @param ushort_t The variable that will store the unsigned short read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint16_t &ushort_t, Endianness endianness)
+                    {
+                        return deserialize(reinterpret_cast<int16_t&>(ushort_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes a short.
+                 * @param short_t The variable that will store the short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int16_t &short_t);
+
+                /*!
+                 * @brief This function deserializes a short with a different endianness.
+                 * @param short_t The variable that will store the short read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int16_t &short_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an unsigned long.
+                 * @param ulong_t The variable that will store the unsigned long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint32_t &ulong_t)
+                    {
+                        return deserialize(reinterpret_cast<int32_t&>(ulong_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned long with a different endianness.
+                 * @param ulong_t The variable that will store the unsigned long read from the buffer..
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint32_t &ulong_t, Endianness endianness)
+                    {
+                        return deserialize(reinterpret_cast<int32_t&>(ulong_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes a long.
+                 * @param long_t The variable that will store the long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int32_t &long_t);
+
+                /*!
+                 * @brief This function deserializes a long with a different endianness.
+                 * @param long_t The variable that will store the long read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int32_t &long_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a wide-char.
+                 * @param wchar The variable that will store the wide-char read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(wchar_t &wchar)
+                    {
+                        uint32_t ret;
+                        deserialize(ret);
+                        wchar = static_cast<wchar_t>(ret);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes a wide-char with a different endianness.
+                 * @param wchar The variable that will store the wide-char read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(wchar_t &wchar, Endianness endianness)
+                    {
+                        uint32_t ret;
+                        deserialize(ret, endianness);
+                        wchar = static_cast<wchar_t>(ret);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned long long.
+                 * @param ulonglong_t The variable that will store the unsigned long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint64_t &ulonglong_t)
+                    {
+                        return deserialize(reinterpret_cast<int64_t&>(ulonglong_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned long long with a different endianness.
+                 * @param ulonglong_t The variable that will store the unsigned long long read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(uint64_t &ulonglong_t, Endianness endianness)
+                    {
+                        return deserialize(reinterpret_cast<int64_t&>(ulonglong_t), endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes a long long.
+                 * @param longlong_t The variable that will store the long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int64_t &longlong_t);
+
+                /*!
+                 * @brief This function deserializes a long long with a different endianness.
+                 * @param longlong_t The variable that will store the long long read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(int64_t &longlong_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a float.
+                 * @param float_t The variable that will store the float read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(float &float_t);
+
+                /*!
+                 * @brief This function deserializes a float with a different endianness.
+                 * @param float_t The variable that will store the float read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(float &float_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a double.
+                 * @param double_t The variable that will store the double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(double &double_t);
+
+                /*!
+                 * @brief This function deserializes a double with a different endianness.
+                 * @param double_t The variable that will store the double read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(double &double_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a long double.
+                 * @param ldouble_t The variable that will store the long double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible.
+                 */
+                Cdr& deserialize(long double &ldouble_t);
+
+                /*!
+                 * @brief This function deserializes a long double with a different endianness.
+                 * @param ldouble_t The variable that will store the long double read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible.
+                 */
+                Cdr& deserialize(long double &ldouble_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a boolean.
+                 * @param bool_t The variable that will store the boolean read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                Cdr& deserialize(bool &bool_t);
+
+                /*!
+                 * @brief This function deserializes a boolean with a different endianness.
+                 * @param bool_t The variable that will store the boolean read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                inline
+                    Cdr& deserialize(bool &bool_t, Endianness /*endianness*/)
+                    {
+                        return deserialize(bool_t);
+                    };
+
+                /*!
+                 * @brief This function deserializes a string.
+                 * This function allocates memory to store the string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(char *&string_t);
+
+                /*!
+                 * @brief This function deserializes a wide string.
+                 * This function allocates memory to store the wide string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the wide string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(wchar_t *&string_t);
+
+                /*!
+                 * @brief This function deserializes a string with a different endianness.
+                 * This function allocates memory to store the string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(char *&string_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a wide string with a different endianness.
+                 * This function allocates memory to store the wide string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the wide string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserialize(wchar_t *&string_t, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes a std::string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(std::string &string_t)
+                    {
+                        uint32_t length = 0;
+                        const char *str = readString(length);
+                        string_t = std::string(str, length);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes a std::string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(std::wstring &string_t)
+                    {
+                        uint32_t length = 0;
+                        string_t = readWString(length);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes a string with a different endianness.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(std::string &string_t, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserialize(string_t);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes a string with a different endianness.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserialize(std::wstring &string_t, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserialize(string_t);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes an array.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& deserialize(std::array<_T, _Size> &array_t)
+                    { return deserializeArray(array_t.data(), array_t.size());}
+
+                /*!
+                 * @brief This function template deserializes an array with a different endianness.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline Cdr& deserialize(std::array<_T, _Size> &array_t, Endianness endianness)
+                    { return deserializeArray(array_t.data(), array_t.size(), endianness);}
+#endif
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes a sequence.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T = bool>
+                    Cdr& deserialize(std::vector<bool> &vector_t)
+                    {
+                        return deserializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a sequence.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserialize(std::vector<_T> &vector_t)
+                    {
+                        uint32_t seqLength = 0;
+                        state state_before_error(*this);
+
+                        *this >> seqLength;
+
+                        try
+                        {
+                            vector_t.resize(seqLength);
+                            return deserializeArray(vector_t.data(), vector_t.size());
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes a map.
+                 * @param map_t The variable that will store the map read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _K, class _T>
+                    Cdr& deserialize(std::map<_K, _T> &map_t)
+                    {
+                        uint32_t seqLength = 0;
+                        state state_(*this);
+
+                        *this >> seqLength;
+
+                        try
+                        {
+                            for (uint32_t i = 0; i < seqLength; ++i)
+                            {
+                                _K key;
+                                _T value;
+                                *this >> key;
+                                *this >> value;
+                                map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(value)));
+                            }
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template deserializes a sequence.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<>
+                    Cdr& deserialize<bool>(std::vector<bool> &vector_t)
+                    {
+                        return deserializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a sequence with a different endianness.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserialize(std::vector<_T> &vector_t, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserialize(vector_t);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes a non-basic object.
+                 * @param type_t The variable that will store the object read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline Cdr& deserialize(_T &type_t)
+                    {
+                        type_t.deserialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of octets.
+                 * @param octet_t The variable that will store the array of octets read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint8_t *octet_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(octet_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of octets with a different endianness.
+                 * @param octet_t The variable that will store the array of octets read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint8_t *octet_t, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(octet_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of characters.
+                 * @param char_t The variable that will store the array of characters read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(char *char_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of characters with a different endianness.
+                 * @param char_t The variable that will store the array of characters read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(char *char_t, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return deserializeArray(char_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of int8_t.
+                 * @param int8 The variable that will store the array of int8_t read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(int8_t *int8, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(int8), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of int8_t with a different endianness.
+                 * @param int8 The variable that will store the array of int8_t read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(int8_t *int8, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(int8), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of unsigned shorts.
+                 * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint16_t *ushort_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int16_t*>(ushort_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of unsigned shorts with a different endianness.
+                 * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint16_t *ushort_t, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(reinterpret_cast<int16_t*>(ushort_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of shorts.
+                 * @param short_t The variable that will store the array of shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int16_t *short_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of shorts with a different endianness.
+                 * @param short_t The variable that will store the array of shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int16_t *short_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of unsigned longs.
+                 * @param ulong_t The variable that will store the array of unsigned longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint32_t *ulong_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int32_t*>(ulong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of unsigned longs with a different endianness.
+                 * @param ulong_t The variable that will store the array of unsigned longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint32_t *ulong_t, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(reinterpret_cast<int32_t*>(ulong_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of longs.
+                 * @param long_t The variable that will store the array of longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int32_t *long_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of longs with a different endianness.
+                 * @param long_t The variable that will store the array of longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int32_t *long_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of wide-chars.
+                 * @param wchar The variable that will store the array of wide-chars read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(wchar_t *wchar, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of wide-chars with a different endianness.
+                 * @param wchar The variable that will store the array of wide-chars read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(wchar_t *wchar, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of unsigned long longs.
+                 * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint64_t *ulonglong_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int64_t*>(ulonglong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of unsigned long longs with a different endianness.
+                 * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(uint64_t *ulonglong_t, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(reinterpret_cast<int64_t*>(ulonglong_t), numElements, endianness);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of long longs.
+                 * @param longlong_t The variable that will store the array of long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int64_t *longlong_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of long longs with a different endianness.
+                 * @param longlong_t The variable that will store the array of long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(int64_t *longlong_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of floats.
+                 * @param float_t The variable that will store the array of floats read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(float *float_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of floats with a different endianness.
+                 * @param float_t The variable that will store the array of floats read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(float *float_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of doubles.
+                 * @param double_t The variable that will store the array of doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(double *double_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of doubles with a different endianness.
+                 * @param double_t The variable that will store the array of doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(double *double_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of long doubles.
+                 * @param ldouble_t The variable that will store the array of long doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(long double *ldouble_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of long doubles with a different endianness.
+                 * @param ldouble_t The variable that will store the array of long doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(long double *ldouble_t, size_t numElements, Endianness endianness);
+
+                /*!
+                 * @brief This function deserializes an array of booleans.
+                 * @param bool_t The variable that will store the array of booleans read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                Cdr& deserializeArray(bool *bool_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of booleans with a different endianness.
+                 * @param bool_t The variable that will store the array of booleans read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(bool *bool_t, size_t numElements, Endianness /*endianness*/)
+                    {
+                        return deserializeArray(bool_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of strings.
+                 * @param string_t The variable that will store the array of strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(std::string *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(string_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of wide-strings.
+                 * @param string_t The variable that will store the array of wide-strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(std::wstring *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(string_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of strings with a different endianness.
+                 * @param string_t The variable that will store the array of strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(std::string *string_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserializeArray(string_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of wide-strings with a different endianness.
+                 * @param string_t The variable that will store the array of wide-strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                inline
+                    Cdr& deserializeArray(std::wstring *string_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserializeArray(string_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of sequences of objects.
+                 * @param string_t The variable that will store the array of sequences of objects read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserializeArray(std::vector<_T> *vector_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(vector_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes an array of non-basic objects.
+                 * @param type_t The variable that will store the array of objects read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserializeArray(_T *type_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            type_t[count].deserialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes an array of non-basic objects with a different endianness.
+                 * @param type_t The variable that will store the array of objects read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserializeArray(_T *type_t, size_t numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserializeArray(type_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes a string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T = std::string>
+                    Cdr& deserializeSequence(std::string *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeStringSequence(sequence_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function template deserializes a wide-string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T = std::wstring>
+                    Cdr& deserializeSequence(std::wstring *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeWStringSequence(sequence_t, numElements);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a raw sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserializeSequence(_T *&sequence_t, size_t &numElements)
+                    {
+                        uint32_t seqLength = 0;
+                        state state_before_error(*this);
+
+                        deserialize(seqLength);
+
+                        try
+                        {
+                            sequence_t = reinterpret_cast<_T*>(calloc(seqLength, sizeof(_T)));
+                            deserializeArray(sequence_t, seqLength);
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            free(sequence_t);
+                            sequence_t = NULL;
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        numElements = seqLength;
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template deserializes a string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<>
+                    Cdr& deserializeSequence<std::string>(std::string *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeStringSequence(sequence_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function template deserializes a wide-string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<>
+                    Cdr& deserializeSequence<std::wstring>(std::wstring *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeWStringSequence(sequence_t, numElements);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a raw sequence with a different endianness.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    Cdr& deserializeSequence(_T *&sequence_t, size_t &numElements, Endianness endianness)
+                    {
+                        bool auxSwap = m_swapBytes;
+                        m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
+
+                        try
+                        {
+                            deserializeSequence(sequence_t, numElements);
+                            m_swapBytes = auxSwap;
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            m_swapBytes = auxSwap;
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+            private:
+
+                Cdr(const Cdr&) = delete;
+
+                Cdr& operator=(const Cdr&) = delete;
+
+                Cdr& serializeBoolSequence(const std::vector<bool> &vector_t);
+
+                Cdr& deserializeBoolSequence(std::vector<bool> &vector_t);
+
+                Cdr& deserializeStringSequence(std::string *&sequence_t, size_t &numElements);
+
+                Cdr& deserializeWStringSequence(std::wstring *&sequence_t, size_t &numElements);
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template detects the content type of the STD container array and serializes the array.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    Cdr& serializeArray(const std::array<_T, _Size> *array_t, size_t numElements)
+                    {
+                        return serializeArray(array_t->data(), numElements * array_t->size());
+                    }
+
+                /*!
+                 * @brief This function template detects the content type of the STD container array and serializes the array with a different endianness.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    Cdr& serializeArray(const std::array<_T, _Size> *array_t, size_t numElements, Endianness endianness)
+                    {
+                        return serializeArray(array_t->data(), numElements * array_t->size(), endianness);
+                    }
+
+                /*!
+                 * @brief This function template detects the content type of the STD container array and deserializes the array.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    Cdr& deserializeArray(std::array<_T, _Size> *array_t, size_t numElements)
+                    {
+                        return deserializeArray(array_t->data(), numElements * array_t->size());
+                    }
+
+                /*!
+                 * @brief This function template detects the content type of STD container array and deserializes the array with a different endianness.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @param endianness Endianness that will be used in the serialization of this value.
+                 * @return Reference to the eprosima::fastcdr::Cdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    Cdr& deserializeArray(std::array<_T, _Size> *array_t, size_t numElements, Endianness endianness)
+                    {
+                        return deserializeArray(array_t->data(), numElements * array_t->size(), endianness);
+                    }
+#endif
+
+                /*!
+                 * @brief This function returns the extra bytes regarding the allignment.
+                 * @param dataSize The size of the data that will be serialized.
+                 * @return The size needed for the aligment.
+                 */
+                inline size_t alignment(size_t dataSize) const {return dataSize > m_lastDataSize ? (dataSize - ((m_currentPosition - m_alignPosition) % dataSize)) & (dataSize-1) : 0;}
+
+                /*!
+                 * @brief This function jumps the number of bytes of the alignment. These bytes should be calculated with the function eprosima::fastcdr::Cdr::alignment.
+                 * @param align The number of bytes to be skipped.
+                 */
+                inline void makeAlign(size_t align){m_currentPosition += align;}
+
+                /*!
+                 * @brief This function resizes the internal buffer. It only applies if the FastBuffer object was created with the default constructor.
+                 * @param minSizeInc Minimun size increase for the internal buffer
+                 * @return True if the resize was succesful, false if it was not
+                 */
+                bool resize(size_t minSizeInc);
+
+                //TODO
+                const char* readString(uint32_t &length);
+                const std::wstring readWString(uint32_t &length);
+
+                //! @brief Reference to the buffer that will be serialized/deserialized.
+                FastBuffer &m_cdrBuffer;
+
+                //! @brief The type of CDR that will be use in serialization/deserialization.
+                CdrType m_cdrType;
+
+                //! @brief Using DDS_CDR type, this attribute stores if the stream buffer contains a parameter list or not.
+                DDSCdrPlFlag m_plFlag;
+
+                //! @brief This attribute stores the option flags when the CDR type is DDS_CDR;
+                uint16_t m_options;
+
+                //! @brief The endianness that will be applied over the buffer.
+                uint8_t m_endianness;
+
+                //! @brief This attribute specifies if it is needed to swap the bytes.
+                bool m_swapBytes;
+
+                //! @brief Stores the last datasize serialized/deserialized. It's used to optimize.
+                size_t m_lastDataSize;
+
+                //! @brief The current position in the serialization/deserialization process.
+                FastBuffer::iterator m_currentPosition;
+
+                //! @brief The position from where the aligment is calculated.
+                FastBuffer::iterator m_alignPosition;
+
+                //! @brief The last position in the buffer;
+                FastBuffer::iterator m_lastPosition;
+        };
+    } //namespace fastcdr
+} //namespace eprosima
+
+#endif // _CDR_CDR_H_

+ 312 - 0
thirdpartylib/FastRTPS/include/fastcdr/FastBuffer.h

@@ -0,0 +1,312 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_CDRBUFFER_H_
+#define _FASTCDR_CDRBUFFER_H_
+
+#include "fastcdr_dll.h"
+#include <stdint.h>
+#include <cstdio>
+#include <string.h>
+#include <cstddef>
+#include <utility>
+
+inline uint32_t size_to_uint32(size_t val) {
+  #if defined(_WIN32) || !defined(FASTCDR_ARM32)
+  // On 64 bit platforms and all Windows architectures (because of C4267), explicitly cast.
+  return static_cast<uint32_t>(val);
+  #else
+  // Skip useless cast on 32-bit builds.
+  return val;
+  #endif
+}
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        /*!
+         * @brief This class implements the iterator used to go through a FastBuffer.
+         */
+        class Cdr_DllAPI _FastBuffer_iterator
+        {
+            public:
+
+                /*!
+                 * @brief Default constructor.
+                 * The iterator points any position.
+                 */
+                _FastBuffer_iterator() : m_buffer(NULL), m_currentPosition(NULL) {}
+
+                /*!
+                 * @brief Constructor.
+                 * The iterator points to the indicated position.
+                 * @param buffer Pointer to the raw buffer.
+                 * @param index Position of the raw buffer where the iterator will point.
+                 */
+                explicit _FastBuffer_iterator(char *buffer, size_t index) : m_buffer(buffer), m_currentPosition(&m_buffer[index]){}
+
+                /*!
+                 * @brief This operator changes the iterator's raw buffer.
+                 * This operator makes the iterator point to the same position but in another raw buffer.
+                 * The new raw buffer is the same than the source iterator's.
+                 * @param iterator The source iterator. The iterator will use the source iterator's raw buffer after this operation.
+                 */
+                inline
+                    void operator<<(const _FastBuffer_iterator &iterator)
+                    {
+                        ptrdiff_t diff = m_currentPosition - m_buffer;
+                        m_buffer = iterator.m_buffer;
+                        m_currentPosition = m_buffer + diff;
+                    }
+
+                /*!
+                 * @brief This operator changes the position where the iterator points.
+                 * This operator takes the index of the source iterator, but the iterator continues using its raw buffer.
+                 * @param The source iterator. The iterator will use the source's iterator index to point to its own raw buffer.
+                 */
+                inline
+                    void operator>>(const _FastBuffer_iterator &iterator)
+                    {
+                        ptrdiff_t diff = iterator.m_currentPosition - iterator.m_buffer;
+                        m_currentPosition = m_buffer + diff;
+                    }
+
+                /*!
+                 * @brief This operator copies a data in the raw buffer.
+                 * The copy uses the size of the data type.
+                 * @param data Data to be copied. Cannot be NULL.
+                 */
+                template<typename _T>
+                    inline
+                    void operator<<(const _T &data)
+                    {
+                        memcpy(m_currentPosition, &data, sizeof(_T));
+                    }
+
+                /*!
+                 * @brief This operator copies data from the raw buffer to a variable.
+                 * The copy uses the size of the data type.
+                 * @param data Data to be filled.
+                 */
+                template<typename _T>
+                    inline
+                    void operator>>(_T &data)
+                    {
+                        memcpy(&data, m_currentPosition, sizeof(_T));
+                    }
+
+                /*!
+                 * @brief This function copies a buffer into the raw buffer.
+                 * @param src The source buffer.
+                 * @param size The number of bytes to be copied.
+                 */
+                inline
+                    void memcopy(const void* src, const size_t size)
+                    {
+                        if (size > 0) {
+                            memcpy(m_currentPosition, src, size);
+                        }
+                    }
+
+                /*!
+                 * @brief This function copies from the raw buffer to a external buffer.
+                 * @param dst The destination buffer.
+                 * @param size The size of bytes to be copied.
+                 */
+                inline
+                    void rmemcopy(void* dst, const size_t size)
+                    {
+                        if (size > 0) {
+                            memcpy(dst, m_currentPosition, size);
+                        }
+                    }
+
+                /*!
+                 * @brief This function increments the position where the iterator points.
+                 * @param numBytes Number of bytes the iterator moves the position.
+                 */
+                inline
+                    void operator+=(size_t numBytes)
+                    {
+                        m_currentPosition += numBytes;
+                    }
+
+                /*!
+                 * @brief This operator returns the subtraction of the current interator's position and the source iterator's position.
+                 * @iterator Source iterator whose position is subtracted to the current iterator's position.
+                 * @return The result of subtract the current iterator's position and the source iterator's position.
+                 */
+                inline
+                    size_t operator-(const _FastBuffer_iterator &it) const
+                    {
+                        return static_cast<size_t>(m_currentPosition - it.m_currentPosition);
+                    }
+
+                /*!
+                 * @brief This function increments the iterator in one the position.
+                 * @return The current iterator.
+                 */
+                inline
+                    _FastBuffer_iterator operator++()
+                    {
+                        ++m_currentPosition;
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function increments the iterator in one the position.
+                 * @return The current iterator.
+                 */
+                inline
+                    _FastBuffer_iterator operator++(int)
+                    {
+                        _FastBuffer_iterator tmp = *this;
+                        ++*this;
+                        return tmp;
+                    }
+
+                /*!
+                 * @brief This function returns the current position in the raw buffer.
+                 * @return The current position in the raw buffer.
+                 */
+                inline
+                    char* operator&()
+                    {
+                        return m_currentPosition;
+                    }
+
+            private:
+
+                //! Pointer to the raw buffer.
+                char *m_buffer;
+
+                //! Current position in the raw buffer.
+                char *m_currentPosition;
+        };
+
+        /*!
+         * @brief This class represents a stream of bytes that contains (or will contain)
+         * serialized data. This class is used by the serializers to serialize
+         * or deserialize using their representation.
+         * @ingroup FASTCDRAPIREFERENCE
+         */
+        class Cdr_DllAPI FastBuffer
+        {
+            public:
+                typedef _FastBuffer_iterator iterator;
+
+                /*!
+                 * @brief This constructor creates an internal stream and assigns it to the eprosima::fastcdr::FastBuffers object.
+                 * The user can obtain this internal stream using the function eprosima::fastcdr::FastBuffers::getBuffer(). Be careful because this internal stream
+                 * is deleted in the destruction of the eprosima::fastcdr::FastBuffers object.
+                 */
+                FastBuffer();
+
+                /*!
+                 * @brief This constructor assigns the user's stream of bytes to the eprosima::fastcdr::FastBuffers object.
+                 * The user's stream will be used to serialize.
+                 *
+                 * @param buffer The user's buffer that will be used. This buffer is not deallocated in the object's destruction. Cannot be NULL.
+                 * @param bufferSize The length of user's buffer.
+                 */
+                FastBuffer(char* const buffer, const size_t bufferSize);
+
+                //! Move constructor
+                FastBuffer(FastBuffer&& fbuffer) : m_buffer(nullptr), m_bufferSize(0), m_internalBuffer(true)
+                {
+                    std::swap(m_buffer, fbuffer.m_buffer);
+                    std::swap(m_bufferSize, fbuffer.m_bufferSize);
+                    std::swap(m_internalBuffer, fbuffer.m_internalBuffer);
+                }
+
+                //! Move assignment
+                FastBuffer& operator=(FastBuffer&& fbuffer)
+                {
+                    std::swap(m_buffer, fbuffer.m_buffer);
+                    std::swap(m_bufferSize, fbuffer.m_bufferSize);
+                    std::swap(m_internalBuffer, fbuffer.m_internalBuffer);
+                    return *this;
+                }
+
+                /*!
+                 * @brief Default destructor.
+                 */
+                virtual ~FastBuffer();
+
+                /*!
+                 * @brief This function returns the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
+                 * @return The stream used by eprosima::fastcdr::FastBuffers to serialize data.
+                 */
+                inline char* getBuffer() const { return m_buffer;}
+
+                /*!
+                 * @brief This function returns the size of the allocated memory of the stream that the eprosima::fastcdr::FastBuffers uses to serialize data.
+                 * @return The size of the allocated memory of the stream used by the eprosima::fastcdr::FastBuffers to serialize data.
+                 */
+                inline size_t getBufferSize() const { return m_bufferSize;}
+
+                /*!
+                 * @brief This function returns a iterator that points to the begining of the stream.
+                 * @return The new iterator.
+                 */
+                inline
+                    iterator begin()
+                    {
+                        return (iterator(m_buffer, 0));
+                    }
+
+                /*!
+                 * @brief This function returns a iterator that points to the end of the stream.
+                 * @return The new iterator.
+                 */
+                inline
+                    iterator end()
+                    {
+                        return (iterator(m_buffer, m_bufferSize));
+                    }
+
+                /*!
+                 * @brief This function reserves memory for the internal raw buffer. It will only do so if the buffer is not yet allocated and is not externally set.
+                 * @param size The size of the memory to be allocated.
+                 * @return True if the allocation suceeded. False if the raw buffer was set externally or is already allocated.
+                 */
+                bool reserve(size_t size);
+
+                /*!
+                 * @brief This function resizes the raw buffer. It will call the user's defined function for this purpose.
+                 * @param minSizeInc The minimun growth expected of the current raw buffer.
+                 * @return True if the operation works. False if it does not.
+                 */
+                bool resize(size_t minSizeInc);
+
+            private:
+
+                FastBuffer(const FastBuffer&) = delete;
+
+                FastBuffer& operator=(const FastBuffer&) = delete;
+
+                //! @brief Pointer to the stream of bytes that contains the serialized data.
+                char *m_buffer;
+
+                //! @brief The total size of the user's buffer.
+                size_t m_bufferSize;
+
+                //! @brief This variable indicates if the managed buffer is internal or is from the user.
+                bool m_internalBuffer;
+        };
+    } //namespace fastcdr
+} //namespace eprosima
+
+#endif // _FASTCDR_FASTCDRBUFFER_H_

+ 1756 - 0
thirdpartylib/FastRTPS/include/fastcdr/FastCdr.h

@@ -0,0 +1,1756 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_FASTCDR_H_
+#define _FASTCDR_FASTCDR_H_
+
+#include "fastcdr_dll.h"
+#include "FastBuffer.h"
+#include "exceptions/NotEnoughMemoryException.h"
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__
+#include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
+
+#if HAVE_CXX0X
+#include <array>
+#endif
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        /*!
+         * @brief This class offers an interface to serialize/deserialize some basic types using a modified CDR protocol inside a eprosima::FastBuffer.
+         * This modified CDR protocol provides a serialization mechanism much faster than common CDR protocol, because it doesn't use alignment.
+         * @ingroup FASTCDRAPIREFERENCE
+         */
+        class Cdr_DllAPI FastCdr
+        {
+            public:
+
+                /*!
+                 * @brief This class stores the current state of a CDR serialization.
+                 */
+                class Cdr_DllAPI state
+                {
+                    friend class FastCdr;
+                    public:
+
+                    /*!
+                     * @brief Default constructor.
+                     */
+                    state(const FastCdr &fastcdr);
+
+                    /*!
+                     * @brief Copy constructor.
+                     */
+                    state(const state&);
+
+                    private:
+
+                    state& operator=(const state&) = delete;
+
+                    //! @brief The position in the buffer when the state was created.
+                    const FastBuffer::iterator m_currentPosition;
+                };
+                /*!
+                 * @brief This constructor creates a eprosima::fastcdr::FastCdr object that can serialize/deserialize
+                 * the assigned buffer.
+                 *
+                 * @param cdrBuffer A reference to the buffer that contains (or will contain) the CDR representation.
+                 */
+                FastCdr(FastBuffer &cdrBuffer);
+
+                /*!
+                 * @brief This function skips a number of bytes in the CDR stream buffer.
+                 * @param numBytes The number of bytes that will be jumped.
+                 * @return True is returned when the jump operation works successfully. Otherwise, false is returned.
+                 */
+                bool jump(size_t numBytes);
+
+                /*!
+                 * @brief This function resets the current position in the buffer to the begining.
+                 */
+                void reset();
+
+                /*!
+                 * @brief This function returns the current position in the CDR stream.
+                 * @return Pointer to the current position in the buffer.
+                 */
+                char* getCurrentPosition();
+
+                /*!
+                 * @brief This function returns the length of the serialized data inside the stream.
+                 * @return The length of the serialized data.
+                 */
+                inline size_t getSerializedDataLength() const { return m_currentPosition - m_cdrBuffer.begin();}
+
+                /*!
+                 * @brief This function returns the current state of the CDR stream.
+                 * @return The current state of the buffer.
+                 */
+                FastCdr::state getState();
+
+                /*!
+                 * @brief This function sets a previous state of the CDR stream;
+                 * @param state Previous state that will be set again.
+                 */
+                void setState(FastCdr::state &state);
+
+                /*!
+                 * @brief This operator serializes an octet.
+                 * @param octet_t The value of the octet that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const uint8_t octet_t){return serialize(octet_t);}
+
+                /*!
+                 * @brief This operator serializes a character.
+                 * @param char_t The value of the character that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const char char_t){return serialize(char_t);}
+
+                /*!
+                 * @brief This operator serializes a int8_t.
+                 * @param int8 The value of the int8_t that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const int8_t int8){return serialize(int8);}
+
+                /*!
+                 * @brief This operator serializes an unsigned short.
+                 * @param ushort_t The value of the unsigned short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const uint16_t ushort_t){return serialize(ushort_t);}
+
+                /*!
+                 * @brief This operator serializes a short.
+                 * @param short_t The value of the short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const int16_t short_t){return serialize(short_t);}
+
+                /*!
+                 * @brief This operator serializes an unsigned long.
+                 * @param ulong_t The value of the unsigned long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const uint32_t ulong_t){return serialize(ulong_t);}
+
+                /*!
+                 * @brief This operator serializes a long.
+                 * @param long_t The value of the long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const int32_t long_t){return serialize(long_t);}
+
+                /*!
+                 * @brief This operator serializes a wide-char.
+                 * @param wchar The value of the wide-char that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const wchar_t wchar){return serialize(wchar);}
+
+                /*!
+                 * @brief This operator serializes an unsigned long long.
+                 * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const uint64_t ulonglong_t){return serialize(ulonglong_t);}
+
+                /*!
+                 * @brief This operator serializes a long long.
+                 * @param longlong_t The value of the long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const int64_t longlong_t){return serialize(longlong_t);}
+
+                /*!
+                 * @brief This operator serializes a float.
+                 * @param float_t The value of the float that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const float float_t){return serialize(float_t);}
+
+                /*!
+                 * @brief This operator serializes a ldouble.
+                 * @param double_t The value of the double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const double double_t){return serialize(double_t);}
+
+                /*!
+                 * @brief This operator serializes a long double.
+                 * @param ldouble_t The value of the long double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const long double ldouble_t){return serialize(ldouble_t);}
+
+                /*!
+                 * @brief This operator serializes a boolean.
+                 * @param bool_t The value of the boolean that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const bool bool_t){return serialize(bool_t);}
+
+                /*!
+                 * @brief This operator serializes a null-terminated string.
+                 * @param string_t The value of the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const char *string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a null-terminated wide-string.
+                 * @param string_t The value of the wide-string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const wchar_t *string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a string.
+                 * @param string_t The string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const std::string &string_t){return serialize(string_t);}
+
+                /*!
+                 * @brief This operator serializes a wstring.
+                 * @param string_t The wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator<<(const std::wstring &string_t){return serialize(string_t);}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This operator template is used to serialize arrays.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline FastCdr& operator<<(const std::array<_T, _Size> &array_t){return serialize<_T, _Size>(array_t);}
+#endif
+
+                /*!
+                 * @brief This operator template is used to serialize sequences.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& operator<<(const std::vector<_T> &vector_t){return serialize<_T>(vector_t);}
+
+                /*!
+                 * @brief This operator template is used to serialize non-basic types.
+                 * @param type_t The object that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& operator<<(const _T &type_t)
+                    {
+                        type_t.serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This operator deserializes an octet.
+                 * @param octet_t The variable that will store the octet read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(uint8_t &octet_t){return deserialize(octet_t);}
+
+                /*!
+                 * @brief This operator deserializes a character.
+                 * @param char_t The variable that will store the character read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(char &char_t){return deserialize(char_t);}
+
+                /*!
+                 * @brief This operator deserializes an int8_t.
+                 * @param int8 The variable that will store the int8_t read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(int8_t &int8){return deserialize(int8);}
+
+                /*!
+                 * @brief This operator deserializes an unsigned short.
+                 * @param ushort_t The variable that will store the unsigned short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(uint16_t &ushort_t){return deserialize(ushort_t);}
+
+                /*!
+                 * @brief This operator deserializes a short.
+                 * @param short_t The variable that will store the short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(int16_t &short_t){return deserialize(short_t);}
+
+                /*!
+                 * @brief This operator deserializes an unsigned long.
+                 * @param ulong_t The variable that will store the unsigned long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(uint32_t &ulong_t){return deserialize(ulong_t);}
+
+                /*!
+                 * @brief This operator deserializes a long.
+                 * @param long_t The variable that will store the long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(int32_t &long_t){return deserialize(long_t);}
+
+                /*!
+                 * @brief This operator deserializes a wide-char.
+                 * @param wchar The variable that will store the wide-char read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(wchar_t &wchar){return deserialize(wchar);}
+
+                /*!
+                 * @brief This operator deserializes an unsigned long long.
+                 * @param ulonglong_t The variable that will store the unsigned long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(uint64_t &ulonglong_t){return deserialize(ulonglong_t);}
+
+                /*!
+                 * @brief This operator deserializes a long long.
+                 * @param longlong_t The variable that will store the long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(int64_t &longlong_t){return deserialize(longlong_t);}
+
+                /*!
+                 * @brief This operator deserializes a float.
+                 * @param float_t The variable that will store the float read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(float &float_t){return deserialize(float_t);}
+
+                /*!
+                 * @brief This operator deserializes a double.
+                 * @param double_t The variable that will store the double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(double &double_t){return deserialize(double_t);}
+
+                /*!
+                 * @brief This operator deserializes a long double.
+                 * @param ldouble_t The variable that will store the long double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(long double &ldouble_t){return deserialize(ldouble_t);}
+
+                /*!
+                 * @brief This operator deserializes a boolean.
+                 * @param bool_t The variable that will store the boolean read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize in an invalid value.
+                 */
+                inline FastCdr& operator>>(bool &bool_t){return deserialize(bool_t);}
+
+                /*!
+                 * @brief This operator deserializes a null-terminated c-string.
+                 * @param string_t The variable that will store the c-string read from the buffer.
+                 *                 Please note that a newly allocated string will be returned.
+                 *                 The caller should free the returned pointer when appropiate.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value.
+                 */
+                inline FastCdr& operator>>(char *&string_t){return deserialize(string_t);}
+
+                /*!
+                 * @brief This operator deserializes a string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(std::string &string_t){return deserialize(string_t);}
+
+                /*!
+                 * @brief This operator deserializes a wstring.
+                 * @param string_t The variable that will store the wstring read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline FastCdr& operator>>(std::wstring &string_t){return deserialize(string_t);}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This operator template is used to deserialize arrays.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline FastCdr& operator>>(std::array<_T, _Size> &array_t){return deserialize<_T, _Size>(array_t);}
+#endif
+
+                /*!
+                 * @brief This operator template is used to deserialize sequences.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& operator>>(std::vector<_T> &vector_t){return deserialize<_T>(vector_t);}
+
+                /*!
+                 * @brief This operator template is used to deserialize non-basic types.
+                 * @param type_t The variable that will store the object read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& operator>>(_T &type_t)
+                    {
+                        type_t.deserialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an octet.
+                 * @param octet_t The value of the octet that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const uint8_t octet_t)
+                    {
+                        return serialize(static_cast<char>(octet_t));
+                    }
+
+                /*!
+                 * @brief This function serializes a character.
+                 * @param char_t The value of the character that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const char char_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(char_t)) || resize(sizeof(char_t)))
+                        {
+                            m_currentPosition++ << char_t;
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes an int8_t.
+                 * @param int8 The value of the int8_t that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const int8_t int8)
+                    {
+                        return serialize(static_cast<char>(int8));
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned short.
+                 * @param ushort_t The value of the unsigned short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const uint16_t ushort_t)
+                    {
+                        return serialize(static_cast<int16_t>(ushort_t));
+                    }
+
+                /*!
+                 * @brief This function serializes a short.
+                 * @param short_t The value of the short that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const int16_t short_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(short_t)) || resize(sizeof(short_t)))
+                        {
+                            m_currentPosition << short_t;
+                            m_currentPosition += sizeof(short_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned long.
+                 * @param ulong_t The value of the unsigned long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const uint32_t ulong_t)
+                    {
+                        return serialize(static_cast<int32_t>(ulong_t));
+                    }
+
+                /*!
+                 * @brief This function serializes a long.
+                 * @param long_t The value of the long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const int32_t long_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(long_t)) || resize(sizeof(long_t)))
+                        {
+                            m_currentPosition << long_t;
+                            m_currentPosition += sizeof(long_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes a wide-char.
+                 * @param wchar The value of the wide-char that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const wchar_t wchar)
+                    {
+                        return serialize(static_cast<uint32_t>(wchar));
+                    }
+
+                /*!
+                 * @brief This function serializes an unsigned long long.
+                 * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const uint64_t ulonglong_t)
+                    {
+                        return serialize(static_cast<int64_t>(ulonglong_t));
+                    }
+
+                /*!
+                 * @brief This function serializes a long long.
+                 * @param longlong_t The value of the long long that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const int64_t longlong_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(longlong_t)) || resize(sizeof(longlong_t)))
+                        {
+                            m_currentPosition << longlong_t;
+                            m_currentPosition += sizeof(longlong_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes a float.
+                 * @param float_t The value of the float that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const float float_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(float_t)) || resize(sizeof(float_t)))
+                        {
+                            m_currentPosition << float_t;
+                            m_currentPosition += sizeof(float_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes a double.
+                 * @param double_t The value of the double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const double double_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(double_t)) || resize(sizeof(double_t)))
+                        {
+                            m_currentPosition << double_t;
+                            m_currentPosition += sizeof(double_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes a long double.
+                 * @param ldouble_t The value of the long double that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const long double ldouble_t)
+                    {
+                        if(((m_lastPosition - m_currentPosition) >= sizeof(ldouble_t)) || resize(sizeof(ldouble_t)))
+                        {
+                            m_currentPosition << ldouble_t;
+#if defined(_WIN32)
+                            m_currentPosition += sizeof(ldouble_t);
+                            m_currentPosition << static_cast<long double>(0);
+#endif
+                            m_currentPosition += sizeof(ldouble_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function serializes a boolean.
+                 * @param bool_t The value of the boolean that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serialize(const bool bool_t);
+
+                /*!
+                 * @brief This function serializes a string.
+                 * @param string_t The pointer to the string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serialize(const char *string_t);
+
+                /*!
+                 * @brief This function serializes a wstring.
+                 * @param string_t The pointer to the wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serialize(const wchar_t *string_t);
+
+                /*!
+                 * @brief This function serializes a std::string.
+                 * @param string_t The string that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const std::string &string_t) {return serialize(string_t.c_str());}
+
+                /*!
+                 * @brief This function serializes a std::wstring.
+                 * @param string_t The wstring that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serialize(const std::wstring &string_t) {return serialize(string_t.c_str());}
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template serializes an array.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline FastCdr& serialize(const std::array<_T, _Size> &array_t)
+                    { return serializeArray(array_t.data(), array_t.size());}
+#endif
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template serializes a sequence of booleans.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T = bool>
+                    FastCdr& serialize(const std::vector<bool> &vector_t)
+                    {
+                        return serializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template serializes a sequence.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& serialize(const std::vector<_T> &vector_t)
+                    {
+                        state state_before_error(*this);
+
+                        *this << static_cast<int32_t>(vector_t.size());
+
+                        try
+                        {
+                            return serializeArray(vector_t.data(), vector_t.size());
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template serializes a sequence of booleans.
+                 * @param vector_t The sequence that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<>
+                    FastCdr& serialize<bool>(const std::vector<bool> &vector_t)
+                    {
+                        return serializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template serializes a non-basic type.
+                 * @param type_t The object that will be serialized in the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& serialize(const _T &type_t)
+                    {
+                        type_t.serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of octets.
+                 * @param octet_t The sequence of octets that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const uint8_t *octet_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(octet_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of characters.
+                 * @param char_t The array of characters that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const char *char_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of int8_t.
+                 * @param int8 The sequence of int8_t that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const int8_t *int8, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const char*>(int8), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of unsigned shorts.
+                 * @param ushort_t The array of unsigned shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const uint16_t *ushort_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int16_t*>(ushort_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of shorts.
+                 * @param short_t The array of shorts that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const int16_t *short_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of unsigned longs.
+                 * @param ulong_t The array of unsigned longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const uint32_t *ulong_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int32_t*>(ulong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of longs.
+                 * @param long_t The array of longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const int32_t *long_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of wide-chars.
+                 * @param wchar The array of wide-chars that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const wchar_t *wchar, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of unsigned long longs.
+                 * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const uint64_t *ulonglong_t, size_t numElements)
+                    {
+                        return serializeArray(reinterpret_cast<const int64_t*>(ulonglong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function serializes an array of long longs.
+                 * @param longlong_t The array of  long longs that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const int64_t *longlong_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of floats.
+                 * @param float_t The array of floats that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const float *float_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of doubles.
+                 * @param double_t The array of doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const double *double_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of long doubles.
+                 * @param ldouble_t The array of long doubles that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const long double *ldouble_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of booleans.
+                 * @param bool_t The array of booleans that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& serializeArray(const bool *bool_t, size_t numElements);
+
+                /*!
+                 * @brief This function serializes an array of strings.
+                 * @param string_t The array of strings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const std::string *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(string_t[count].c_str());
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function serializes an array of wstrings.
+                 * @param string_t The array of wstrings that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& serializeArray(const std::wstring *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(string_t[count].c_str());
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes an array of sequences.
+                 * @param vector_t The array of sequences that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& serializeArray(const std::vector<_T> *vector_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            serialize(vector_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes an array of non-basic type objects.
+                 * @param string_t The array of objects that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& serializeArray(const _T *type_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            type_t[count].serialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template serializes a raw sequence.
+                 * @param sequence_t Pointer to the sequence that will be serialized in the buffer.
+                 * @param numElements The number of elements contained in the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& serializeSequence(const _T *sequence_t, size_t numElements)
+                    {
+                        state state_before_error(*this);
+
+                        serialize(static_cast<int32_t>(numElements));
+
+                        try
+                        {
+                            return serializeArray(sequence_t, numElements);
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an octet.
+                 * @param octet_t The variable that will store the octet read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(uint8_t &octet_t)
+                    {
+                        return deserialize(reinterpret_cast<char&>(octet_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes a character.
+                 * @param char_t The variable that will store the character read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(char &char_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(char_t))
+                        {
+                            m_currentPosition++ >> char_t;
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes an int8_t.
+                 * @param int8 The variable that will store the int8_t read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(int8_t &int8)
+                    {
+                        return deserialize(reinterpret_cast<char&>(int8));
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned short.
+                 * @param ushort_t The variable that will store the unsigned short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(uint16_t &ushort_t)
+                    {
+                        return deserialize(reinterpret_cast<int16_t&>(ushort_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes a short.
+                 * @param short_t The variable that will store the short read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(int16_t &short_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(short_t))
+                        {
+                            m_currentPosition >> short_t;
+                            m_currentPosition += sizeof(short_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned long.
+                 * @param ulong_t The variable that will store the unsigned long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(uint32_t &ulong_t)
+                    {
+                        return deserialize(reinterpret_cast<int32_t&>(ulong_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes a long.
+                 * @param long_t The variable that will store the long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(int32_t &long_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(long_t))
+                        {
+                            m_currentPosition >> long_t;
+                            m_currentPosition += sizeof(long_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes a wide-char.
+                 * @param wchar The variable that will store the wide-char read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(wchar_t &wchar)
+                    {
+                        uint32_t ret;
+                        deserialize(ret);
+                        wchar = static_cast<wchar_t>(ret);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an unsigned long long.
+                 * @param ulonglong_t The variable that will store the unsigned long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(uint64_t &ulonglong_t)
+                    {
+                        return deserialize(reinterpret_cast<int64_t&>(ulonglong_t));
+                    }
+
+                /*!
+                 * @brief This function deserializes a long long.
+                 * @param longlong_t The variable that will store the long long read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(int64_t &longlong_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(longlong_t))
+                        {
+                            m_currentPosition >> longlong_t;
+                            m_currentPosition += sizeof(longlong_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes a float.
+                 * @param float_t The variable that will store the float read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(float &float_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(float_t))
+                        {
+                            m_currentPosition >> float_t;
+                            m_currentPosition += sizeof(float_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes a double.
+                 * @param double_t The variable that will store the double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(double &double_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(double_t))
+                        {
+                            m_currentPosition >> double_t;
+                            m_currentPosition += sizeof(double_t);
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes a long double.
+                 * @param ldouble_t The variable that will store the long double read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(long double &ldouble_t)
+                    {
+                        if((m_lastPosition - m_currentPosition) >= sizeof(ldouble_t))
+                        {
+                            m_currentPosition >> ldouble_t;
+                            m_currentPosition += sizeof(ldouble_t);
+#if defined(_WIN32)
+                            m_currentPosition += sizeof(ldouble_t);
+#endif
+
+                            return *this;
+                        }
+
+                        throw exception::NotEnoughMemoryException(exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT);
+                    }
+
+                /*!
+                 * @brief This function deserializes a boolean.
+                 * @param bool_t The variable that will store the boolean read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 * @exception exception::BadParamException This exception is thrown when trying to deserialize in an invalid value.
+                 */
+                FastCdr& deserialize(bool &bool_t);
+
+                /*!
+                 * @brief This function deserializes a string.
+                 * This function allocates memory to store the string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserialize(char *&string_t);
+
+                /*!
+                 * @brief This function deserializes a wide string.
+                 * This function allocates memory to store the wide string. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param string_t The pointer that will point to the wide string read from the buffer.
+                 * The user will have to free the allocated memory using free()
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserialize(wchar_t *&string_t);
+
+                /*!
+                 * @brief This function deserializes a std::string.
+                 * @param string_t The variable that will store the string read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(std::string &string_t)
+                    {
+                        uint32_t length = 0;
+                        const char *str = readString(length);
+                        string_t = std::string(str, length);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes a std::wstring.
+                 * @param string_t The variable that will store the wstring read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserialize(std::wstring &string_t)
+                    {
+                        uint32_t length = 0;
+                        string_t = readWString(length);
+                        return *this;
+                    }
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes an array.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    inline FastCdr& deserialize(std::array<_T, _Size> &array_t)
+                    { return deserializeArray(array_t.data(), array_t.size());}
+#endif
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes a sequence of booleans.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T = bool>
+                    FastCdr& deserialize(std::vector<bool> &vector_t)
+                    {
+                        return deserializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a sequence.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& deserialize(std::vector<_T> &vector_t)
+                    {
+                        uint32_t seqLength = 0;
+                        state state_before_error(*this);
+
+                        *this >> seqLength;
+
+                        try
+                        {
+                            vector_t.resize(seqLength);
+                            return deserializeArray(vector_t.data(), vector_t.size());
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template deserializes a sequence of booleans.
+                 * @param vector_t The variable that will store the sequence read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<>
+                    FastCdr& deserialize<bool>(std::vector<bool> &vector_t)
+                    {
+                        return deserializeBoolSequence(vector_t);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a non-basic type object.
+                 * @param type_t The variable that will store the object read from the buffer.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    inline FastCdr& deserialize(_T &type_t)
+                    {
+                        type_t.deserialize(*this);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of octets.
+                 * @param octet_t The variable that will store the array of octets read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(uint8_t *octet_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(octet_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of characters.
+                 * @param char_t The variable that will store the array of characters read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(char *char_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of int8_t.
+                 * @param int8 The variable that will store the array of int8_t read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(int8_t *int8, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<char*>(int8), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of unsigned shorts.
+                 * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(uint16_t *ushort_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int16_t*>(ushort_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of shorts.
+                 * @param short_t The variable that will store the array of shorts read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(int16_t *short_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of unsigned longs.
+                 * @param ulong_t The variable that will store the array of unsigned longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(uint32_t *ulong_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int32_t*>(ulong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of longs.
+                 * @param long_t The variable that will store the array of longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(int32_t *long_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of wide-chars.
+                 * @param wchar The variable that will store the array of wide-chars read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(wchar_t *wchar, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of unsigned long longs.
+                 * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(uint64_t *ulonglong_t, size_t numElements)
+                    {
+                        return deserializeArray(reinterpret_cast<int64_t*>(ulonglong_t), numElements);
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of long longs.
+                 * @param longlong_t The variable that will store the array of long longs read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(int64_t *longlong_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of floats.
+                 * @param float_t The variable that will store the array of floats read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(float *float_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of doubles.
+                 * @param double_t The variable that will store the array of doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(double *double_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of long doubles.
+                 * @param ldouble_t The variable that will store the array of long doubles read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(long double *ldouble_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of booleans.
+                 * @param bool_t The variable that will store the array of booleans read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                FastCdr& deserializeArray(bool *bool_t, size_t numElements);
+
+                /*!
+                 * @brief This function deserializes an array of strings.
+                 * @param string_t The variable that will store the array of strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(std::string *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(string_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function deserializes an array of wide-strings.
+                 * @param string_t The variable that will store the array of strings read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                inline
+                    FastCdr& deserializeArray(std::wstring *string_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(string_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes an array of sequences.
+                 * @param vector_t The variable that will store the array of sequences read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& deserializeArray(std::vector<_T> *vector_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            deserialize(vector_t[count]);
+                        return *this;
+                    }
+
+                /*!
+                 * @brief This function template deserializes an array of non-basic type objects.
+                 * @param type_t The variable that will store the array of objects read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& deserializeArray(_T *type_t, size_t numElements)
+                    {
+                        for(size_t count = 0; count < numElements; ++count)
+                            type_t[count].deserialize(*this);
+                        return *this;
+                    }
+
+#if !defined(_MSC_VER) && HAVE_CXX0X
+                /*!
+                 * @brief This function template deserializes a string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T = std::string>
+                    FastCdr& deserializeSequence(std::string *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeStringSequence(sequence_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function template deserializes a wide-string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T = std::wstring>
+                    FastCdr& deserializeSequence(std::wstring *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeWStringSequence(sequence_t, numElements);
+                    }
+#endif
+
+                /*!
+                 * @brief This function template deserializes a raw sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T>
+                    FastCdr& deserializeSequence(_T *&sequence_t, size_t &numElements)
+                    {
+                        uint32_t seqLength = 0;
+                        state state_before_error(*this);
+
+                        deserialize(seqLength);
+
+                        try
+                        {
+                            sequence_t = reinterpret_cast<_T*>(calloc(seqLength, sizeof(_T)));
+                            deserializeArray(sequence_t, seqLength);
+                        }
+                        catch(eprosima::fastcdr::exception::Exception &ex)
+                        {
+                            free(sequence_t);
+                            sequence_t = NULL;
+                            setState(state_before_error);
+                            ex.raise();
+                        }
+
+                        numElements = seqLength;
+                        return *this;
+                    }
+
+#ifdef _MSC_VER
+                /*!
+                 * @brief This function template deserializes a string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<>
+                    FastCdr& deserializeSequence<std::string>(std::string *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeStringSequence(sequence_t, numElements);
+                    }
+
+                /*!
+                 * @brief This function template deserializes a wide-string sequence.
+                 * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory.
+                 * The user will have to free this allocated memory using free()
+                 * @param sequence_t The pointer that will store the sequence read from the buffer.
+                 * @param numElements This variable return the number of elements of the sequence.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<>
+                    FastCdr& deserializeSequence<std::wstring>(std::wstring *&sequence_t, size_t &numElements)
+                    {
+                        return deserializeWStringSequence(sequence_t, numElements);
+                    }
+#endif
+
+            private:
+
+                FastCdr(const FastCdr&) = delete;
+
+                FastCdr& operator=(const FastCdr&) = delete;
+
+                FastCdr& serializeBoolSequence(const std::vector<bool> &vector_t);
+
+                FastCdr& deserializeBoolSequence(std::vector<bool> &vector_t);
+
+                FastCdr& deserializeStringSequence(std::string *&sequence_t, size_t &numElements);
+
+                FastCdr& deserializeWStringSequence(std::wstring *&sequence_t, size_t &numElements);
+
+#if HAVE_CXX0X
+                /*!
+                 * @brief This function template detects the content type of the STD container array and serializes the array.
+                 * @param array_t The array that will be serialized in the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    FastCdr& serializeArray(const std::array<_T, _Size> *array_t, size_t numElements)
+                    {
+                        return serializeArray(array_t->data(), numElements * array_t->size());
+                    }
+
+                /*!
+                 * @brief This function template detects the content type of the STD container array and deserializes the array.
+                 * @param array_t The variable that will store the array read from the buffer.
+                 * @param numElements Number of the elements in the array.
+                 * @return Reference to the eprosima::fastcdr::FastCdr object.
+                 * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize in a position that exceeds the internal memory size.
+                 */
+                template<class _T, size_t _Size>
+                    FastCdr& deserializeArray(std::array<_T, _Size> *array_t, size_t numElements)
+                    {
+                        return deserializeArray(array_t->data(), numElements * array_t->size());
+                    }
+#endif
+
+                bool resize(size_t minSizeInc);
+
+                const char* readString(uint32_t &length);
+
+                std::wstring readWString(uint32_t &length);
+
+                //! @brief Reference to the buffer that will be serialized/deserialized.
+                FastBuffer &m_cdrBuffer;
+
+                //! @brief The current position in the serialization/deserialization process.
+                FastBuffer::iterator m_currentPosition;
+
+                //! @brief The last position in the buffer;
+                FastBuffer::iterator m_lastPosition;
+        };
+    } //namespace fastcdr
+} //namespace eprosima
+
+#endif //_FASTCDR_FASTCDR_H_

+ 53 - 0
thirdpartylib/FastRTPS/include/fastcdr/config.h

@@ -0,0 +1,53 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_CONFIG_H_
+#define _FASTCDR_CONFIG_H_
+
+#define FASTCDR_VERSION_MAJOR 1
+#define FASTCDR_VERSION_MINOR 0
+#define FASTCDR_VERSION_MICRO 14
+#define FASTCDR_VERSION_STR "1.0.14"
+
+// C++11 support defines
+#ifndef HAVE_CXX11
+#define HAVE_CXX11 1
+#endif
+
+// C++0x support defines
+#ifndef HAVE_CXX0X
+#define HAVE_CXX0X 1
+#endif
+
+// C++ constexpr support
+#ifndef HAVE_CXX_CONSTEXPR
+#define HAVE_CXX_CONSTEXPR 1
+#endif
+
+#if HAVE_CXX_CONSTEXPR
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR const
+#endif
+
+// Endianness defines
+#ifndef __BIG_ENDIAN__
+#define __BIG_ENDIAN__ 0
+#endif
+
+#if defined(__ARM_ARCH) && __ARM_ARCH <= 7
+#define FASTCDR_ARM32
+#endif
+
+#endif // _FASTCDR_CONFIG_H_

+ 53 - 0
thirdpartylib/FastRTPS/include/fastcdr/config.h.in

@@ -0,0 +1,53 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_CONFIG_H_
+#define _FASTCDR_CONFIG_H_
+
+#define FASTCDR_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
+#define FASTCDR_VERSION_MINOR @PROJECT_VERSION_MINOR@
+#define FASTCDR_VERSION_MICRO @PROJECT_VERSION_PATCH@
+#define FASTCDR_VERSION_STR "@PROJECT_VERSION@"
+
+// C++11 support defines
+#ifndef HAVE_CXX11
+#define HAVE_CXX11 @HAVE_CXX11@
+#endif
+
+// C++0x support defines
+#ifndef HAVE_CXX0X
+#define HAVE_CXX0X @HAVE_CXX0X@
+#endif
+
+// C++ constexpr support
+#ifndef HAVE_CXX_CONSTEXPR
+#define HAVE_CXX_CONSTEXPR @HAVE_CXX_CONSTEXPR@
+#endif
+
+#if HAVE_CXX_CONSTEXPR
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR const
+#endif
+
+// Endianness defines
+#ifndef __BIG_ENDIAN__
+#define __BIG_ENDIAN__ @__BIG_ENDIAN__@
+#endif
+
+#if defined(__ARM_ARCH) && __ARM_ARCH <= 7
+#define FASTCDR_ARM32
+#endif
+
+#endif // _FASTCDR_CONFIG_H_

+ 66 - 0
thirdpartylib/FastRTPS/include/fastcdr/eProsima_auto_link.h

@@ -0,0 +1,66 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*
+ Expected defines.
+
+ - EPROSIMA_LIB_NAME
+ - FASTCDR_VERSION_MAJOR
+ - FASTCDR_VERSION_MINOR
+*/
+
+#if defined(_MSC_VER)
+    #define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X)
+    #define EPROSIMA_DO_STRINGIZE(X) #X
+
+    #if defined(_DEBUG)
+        #define EPROSIMA_LIB_DEBUG_TAG "d"
+    #else
+        #define EPROSIMA_LIB_DEBUG_TAG
+    #endif // _DEBUG
+
+    // Select linkage option.
+    #if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
+        #define EPROSIMA_LIB_PREFIX
+    #elif defined(EPROSIMA_DYN_LINK)
+        #error "Mixing a dll eprosima library with a static runtime is a bad idea"
+    #else
+        #define EPROSIMA_LIB_PREFIX "lib"
+    #endif
+
+    // Include library
+    #if defined(EPROSIMA_LIB_NAME) \
+	&& defined(EPROSIMA_LIB_PREFIX) \
+	&& defined(EPROSIMA_LIB_DEBUG_TAG) \
+	&& defined(FASTCDR_VERSION_MAJOR) \
+	&& defined(FASTCDR_VERSION_MINOR)
+        #pragma comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG "-" EPROSIMA_STRINGIZE(FASTCDR_VERSION_MAJOR) "." EPROSIMA_STRINGIZE(FASTCDR_VERSION_MINOR) ".lib")
+    #else
+    #error "Some required macros where not defined"
+    #endif
+
+#endif // _MSC_VER
+    
+// Undef macros
+#ifdef EPROSIMA_LIB_PREFIX
+#undef EPROSIMA_LIB_PREFIX
+#endif
+
+#ifdef EPROSIMA_LIB_NAME
+#undef EPROSIMA_LIB_NAME
+#endif
+
+#ifdef EPROSIMA_LIB_DEBUG_TAG
+#undef EPROSIMA_LIB_DEBUG_TAG
+#endif

+ 85 - 0
thirdpartylib/FastRTPS/include/fastcdr/exceptions/BadParamException.h

@@ -0,0 +1,85 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_EXCEPTIONS_BADPARAMEXCEPTION_H_
+#define _FASTCDR_EXCEPTIONS_BADPARAMEXCEPTION_H_
+
+#include "Exception.h"
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        namespace exception
+        {
+            /*!
+             * @brief This class is thrown as an exception when a invalid parameter was being serialized.
+             * @ingroup EXCEPTIONMODULE
+             */
+            class BadParamException : public Exception
+            {
+                public:
+
+                    /*!
+                     * @brief Default constructor.
+                     *
+                     * @param message A error message. This message pointer is copied.
+                     */
+                    Cdr_DllAPI BadParamException(const char* const &message) noexcept;
+
+                    /*!
+                     * @brief Default copy constructor.
+                     *
+                     * @param ex BadParamException that will be copied.
+                     */
+                    Cdr_DllAPI BadParamException(const BadParamException &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Default move constructor.
+                     *
+                     * @param ex BadParamException that will be moved.
+                     */
+                    Cdr_DllAPI BadParamException(BadParamException&& ex) noexcept;
+#endif
+
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex BadParamException that will be copied.
+                     */
+                    Cdr_DllAPI BadParamException& operator=(const BadParamException &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex BadParamException that will be moved.
+                     */
+                    BadParamException& operator=(BadParamException&& ex) noexcept;
+#endif
+
+                    //! @brief Default constructor
+                    virtual Cdr_DllAPI ~BadParamException() noexcept;
+
+                    //! @brief This function throws the object as exception.
+                    virtual Cdr_DllAPI void raise() const;
+
+                    //! @brief Default message used in the library.
+                    static Cdr_DllAPI const char* const BAD_PARAM_MESSAGE_DEFAULT;
+            };
+        } //namespace exception
+    } //namespace fastcdr
+} //namespace eprosima
+#endif // _FASTCDR_EXCEPTIONS_BADPARAMEXCEPTION_H_

+ 98 - 0
thirdpartylib/FastRTPS/include/fastcdr/exceptions/Exception.h

@@ -0,0 +1,98 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_EXCEPTIONS_EXCEPTION_H_
+#define _FASTCDR_EXCEPTIONS_EXCEPTION_H_
+
+#include "../fastcdr_dll.h"
+#include <string>
+#include <exception>
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        namespace exception
+        {
+            /*!
+             * @brief This abstract class is used to create exceptions.
+             * @ingroup EXCEPTIONMODULE
+             */
+            class Exception : public std::exception
+            {
+                public:
+
+                    //! \brief Default destructor.
+                    virtual Cdr_DllAPI ~Exception() noexcept;
+
+                    //! \brief This function throws the object as exception.
+                    virtual Cdr_DllAPI void raise() const = 0;
+
+                    /*!
+                     * @brief This function returns the error message.
+                     *
+                     * @return The error message.
+                     */
+                    virtual Cdr_DllAPI const char* what() const noexcept ;
+
+                protected:
+
+                    /*!
+                     * @brief Default constructor.
+                     *
+                     * @param message A error message. This message pointer is copied.
+                     */
+                    Cdr_DllAPI Exception(const char* const &message) noexcept;
+
+                    /*!
+                     * @brief Default copy constructor.
+                     *
+                     * @param ex Exception that will be copied.
+                     */
+                    Cdr_DllAPI Exception(const Exception &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Default move constructor.
+                     *
+                     * @param ex Exception that will be moved.
+                     */
+                    Cdr_DllAPI Exception(Exception&& ex) noexcept;
+#endif
+
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex Exception that will be copied.
+                     */
+                    Cdr_DllAPI Exception& operator=(const Exception &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex Exception that will be moved.
+                     */
+                    Cdr_DllAPI Exception& operator=(Exception&&) noexcept;
+#endif
+
+                private:
+
+                    const char* m_message;
+            };
+        } //namespace exception
+    } //namespace fastcdr
+} //namespace eprosima
+
+#endif // _FASTCDR_EXCEPTIONS_EXCEPTION_H_

+ 85 - 0
thirdpartylib/FastRTPS/include/fastcdr/exceptions/NotEnoughMemoryException.h

@@ -0,0 +1,85 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_EXCEPTIONS_NOTENOUGHMEMORYEXCEPTION_H_
+#define _FASTCDR_EXCEPTIONS_NOTENOUGHMEMORYEXCEPTION_H_
+
+#include "Exception.h"
+
+namespace eprosima
+{
+    namespace fastcdr
+    {
+        namespace exception
+        {
+            /*!
+             * @brief This class is thrown as an exception when the buffer's internal memory reachs its size limit.
+             * @ingroup EXCEPTIONMODULE
+             */
+            class NotEnoughMemoryException : public Exception
+            {
+                public:
+
+                    /*!
+                     * @brief Default constructor.
+                     *
+                     * @param message A error message. This message pointer is copied.
+                     */
+                    Cdr_DllAPI NotEnoughMemoryException(const char* const &message) noexcept;
+
+                    /*!
+                     * @brief Default copy constructor.
+                     *
+                     * @param ex NotEnoughMemoryException that will be copied.
+                     */
+                    Cdr_DllAPI NotEnoughMemoryException(const NotEnoughMemoryException &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Default move constructor.
+                     *
+                     * @param ex NotEnoughMemoryException that will be moved.
+                     */
+                    Cdr_DllAPI NotEnoughMemoryException(NotEnoughMemoryException&& ex) noexcept;
+#endif
+
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex NotEnoughMemoryException that will be copied.
+                     */
+                    Cdr_DllAPI NotEnoughMemoryException& operator=(const NotEnoughMemoryException &ex) noexcept;
+
+#if HAVE_CXX0X
+                    /*!
+                     * @brief Assigment operation.
+                     *
+                     * @param ex NotEnoughMemoryException that will be moved.
+                     */
+                    Cdr_DllAPI NotEnoughMemoryException& operator=(NotEnoughMemoryException&& ex) noexcept;
+#endif
+
+                    //! @brief Default constructor
+                    virtual Cdr_DllAPI ~NotEnoughMemoryException() noexcept;
+
+                    //! @brief This function throws the object as exception.
+                    virtual Cdr_DllAPI void raise() const;
+
+                    //! @brief Default message used in the library.
+                    static Cdr_DllAPI const char* const NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT;
+            };
+        } //namespace exception
+    } //namespace fastcdr
+} //namespace eprosima
+#endif // _FASTCDR_EXCEPTIONS_NOTENOUGHMEMORYEXCEPTION_H_

+ 69 - 0
thirdpartylib/FastRTPS/include/fastcdr/fastcdr_dll.h

@@ -0,0 +1,69 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTCDR_FASTCDR_DLL_H_
+#define _FASTCDR_FASTCDR_DLL_H_
+
+#include <fastcdr/config.h>
+
+// normalize macros
+#if !defined(FASTCDR_DYN_LINK) && !defined(FASTCDR_STATIC_LINK) \
+    && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK)
+#define FASTCDR_STATIC_LINK
+#endif
+
+#if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTCDR_DYN_LINK)
+#define FASTCDR_DYN_LINK
+#endif
+
+#if defined(FASTCDR_DYN_LINK) && defined(FASTCDR_STATIC_LINK)
+#error Must not define both FASTCDR_DYN_LINK and FASTCDR_STATIC_LINK
+#endif
+
+#if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTCDR_NO_LIB)
+#define FASTCDR_NO_LIB
+#endif
+
+// enable dynamic linking
+
+#if defined(_WIN32)
+#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTCDR_DYN_LINK)
+#if defined(fastcdr_EXPORTS)
+#define Cdr_DllAPI __declspec( dllexport )
+#else
+#define Cdr_DllAPI __declspec( dllimport )
+#endif // FASTCDR_SOURCE
+#else
+#define Cdr_DllAPI
+#endif
+#else
+#define Cdr_DllAPI
+#endif // _WIN32
+
+// Auto linking.
+
+#if !defined(FASTCDR_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \
+    && !defined(FASTCDR_NO_LIB)
+
+// Set properties.
+#define EPROSIMA_LIB_NAME fastcdr
+
+#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTCDR_DYN_LINK)
+#define EPROSIMA_DYN_LINK
+#endif
+
+#include "eProsima_auto_link.h"
+#endif // auto-linking disabled
+
+#endif // _FASTCDR_FASTCDR_DLL_H_

+ 63 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/ReplyHeader.hpp

@@ -0,0 +1,63 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file RequestHeader.hpp
+ *
+ */
+
+#ifndef REPLYHEADER_HPP
+#define REPLYHEADER_HPP
+
+#include <fastrtps/rtps/common/SampleIdentity.h>
+#include <fastdds/dds/builtin/common/Types.hpp>
+
+namespace eprosima {
+
+namespace fastcdr {
+class Cdr;
+} // fastcdr
+
+namespace fastdds {
+namespace dds {
+namespace rpc {
+
+struct ReplyHeader
+{
+    fastrtps::rtps::SampleIdentity relatedRequestId;
+
+    RemoteExceptionCode_t remoteEx;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(
+            const ReplyHeader& data,
+            size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(
+            eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(
+            eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined()
+    {
+        return false;
+    }
+};
+
+} // namespace rpc
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // REPLYHEADER_HPP

+ 63 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/RequestHeader.hpp

@@ -0,0 +1,63 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file RequestHeader.hpp
+ *
+ */
+
+#ifndef REQUESTHEADER_HPP
+#define REQUESTHEADER_HPP
+
+#include <fastrtps/rtps/common/SampleIdentity.h>
+#include <fastdds/dds/builtin/common/Types.hpp>
+
+namespace eprosima {
+
+namespace fastcdr {
+class Cdr;
+} // fastcdr
+
+namespace fastdds {
+namespace dds {
+namespace rpc {
+
+struct RequestHeader
+{
+    eprosima::fastrtps::rtps::SampleIdentity requestId;
+
+    InstanceName instanceName;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(
+            const RequestHeader& data,
+            size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(
+            eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(
+            eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined()
+    {
+        return false;
+    }
+};
+
+} // namespace rpc
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // REQUESTHEADER_HPP

+ 46 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/common/Types.hpp

@@ -0,0 +1,46 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Types.hpp
+ *
+ */
+
+#ifndef TYPES_HPP
+#define TYPES_HPP
+
+#include <fastrtps/utils/fixed_size_string.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+namespace rpc {
+
+using InstanceName = fastrtps::string_255;
+
+enum RemoteExceptionCode_t {
+    REMOTE_EX_OK,
+    REMOTE_EX_UNSUPPORTED,
+    REMOTE_EX_INVALID_ARGUMENT,
+    REMOTE_EX_OUT_OF_RESOURCES,
+    REMOTE_EX_UNKNOWN_OPERATION,
+    REMOTE_EX_UNKNOWN_EXCEPTION
+};
+
+} // namespace rpc
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // TYPES_HPP

+ 292 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp

@@ -0,0 +1,292 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TypeLookupManager.hpp
+ *
+ */
+
+#ifndef _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP
+#define _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+#include <vector>
+
+#include <fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp>
+#include <fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp>
+#include <fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp>
+
+#include <fastdds/rtps/builtin/data/WriterProxyData.h>
+#include <fastdds/rtps/builtin/data/ReaderProxyData.h>
+
+namespace eprosima {
+namespace fastrtps{
+
+namespace rtps {
+
+class BuiltinProtocols;
+class ReaderHistory;
+class RTPSParticipantImpl;
+class StatefulReader;
+class StatefulWriter;
+class ParticipantProxyData;
+class WriterHistory;
+
+} // namespace rtps
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+namespace builtin {
+
+extern const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY;
+
+/**
+ * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.2 specification.
+ * @ingroup XTYPES
+ */
+class TypeLookupManager
+{
+    friend class TypeLookupRequestListener;
+    friend class TypeLookupReplyListener;
+
+public:
+    /**
+    * Constructor
+    * @param prot Pointer to the BuiltinProtocols object.
+    */
+    TypeLookupManager(
+            fastrtps::rtps::BuiltinProtocols* prot);
+
+    virtual ~TypeLookupManager();
+
+    /**
+     * Initialize the TypeLookupManager protocol.
+     * @param p Pointer to the RTPS participant implementation.
+     * @return true if the initialziacion was succesful.
+     */
+    bool init_typelookup_service(
+            fastrtps::rtps::RTPSParticipantImpl* p);
+
+    /**
+     * Assign the remote endpoints for a newly discovered RTPSParticipant.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     * @return True if correct.
+     */
+    bool assign_remote_endpoints(
+            const fastrtps::rtps::ParticipantProxyData& pdata);
+
+    /**
+     * Remove remote endpoints from the typelookup service.
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    void remove_remote_endpoints(
+            fastrtps::rtps::ParticipantProxyData* pdata);
+
+    /**
+     * Get the builtin protocols
+     * @return Builtin protocols
+     */
+    fastrtps::rtps::BuiltinProtocols* get_builtin_protocols()
+    {
+        return builtin_protocols_;
+    }
+
+    /**
+     * Get the builtin request writer
+     * @return stateful writer
+     */
+    fastrtps::rtps::StatefulWriter* get_builtin_request_writer();
+
+    /**
+     * Get the builtin reply writer
+     * @return stateful writer
+     */
+    fastrtps::rtps::StatefulWriter* get_builtin_reply_writer();
+
+    /**
+    * Get the builtin request writer's history
+    * @return writer history
+    */
+    fastrtps::rtps::WriterHistory* get_builtin_request_writer_history();
+
+    /**
+    * Get the builtin reply writer's history
+    * @return writer history
+    */
+    fastrtps::rtps::WriterHistory* get_builtin_reply_writer_history();
+
+    /**
+     * Get the builtin request reader
+     * @return stateful reader
+     */
+    fastrtps::rtps::StatefulReader* get_builtin_request_reader();
+
+    /**
+     * Get the builtin reply reader
+     * @return stateful reader
+     */
+    fastrtps::rtps::StatefulReader* get_builtin_reply_reader();
+
+    /**
+    * Get the builtin request reader's history
+    * @return reader history
+    */
+    fastrtps::rtps::ReaderHistory* get_builtin_request_reader_history();
+
+    /**
+    * Get the builtin reply reader's history
+    * @return reader history
+    */
+    fastrtps::rtps::ReaderHistory* get_builtin_reply_reader_history();
+
+/* TODO Uncomment if security is implemented.
+#if HAVE_SECURITY
+    bool pairing_remote_reader_with_local_writer_after_security(
+            const fastrtps::rtps::GUID_t& local_writer,
+            const fastrtps::rtps::ReaderProxyData& remote_reader_data);
+
+    bool pairing_remote_writer_with_local_reader_after_security(
+            const fastrtps::rtps::GUID_t& local_reader,
+            const fastrtps::rtps::WriterProxyData& remote_writer_data);
+#endif
+*/
+
+    fastrtps::rtps::SampleIdentity get_type_dependencies(
+            const fastrtps::types::TypeIdentifierSeq& in) const;
+
+    fastrtps::rtps::SampleIdentity get_types(
+            const fastrtps::types::TypeIdentifierSeq& in) const;
+
+private:
+    /**
+     * Create the endpoints used in the TypeLookupManager.
+     * @return true if correct.
+     */
+    bool create_endpoints();
+
+    /**
+     * Get the RTPS participant
+     * @return RTPS participant
+     */
+    inline fastrtps::rtps::RTPSParticipantImpl* get_RTPS_participant()
+    {
+        return participant_;
+    }
+
+    //! Get out instanceName as defined in 7.6.2.3.4 of the XTypes 1.2 document
+    std::string get_instanceName() const;
+
+    //! Aux method to send requests
+    bool send_request(
+            TypeLookup_Request& req) const;
+
+    //! Aux method to send replies
+    bool send_reply(
+            TypeLookup_Reply& rep) const;
+
+    //! Aux method to received requests
+    bool recv_request(
+            fastrtps::rtps::CacheChange_t& change,
+            TypeLookup_Request& req) const;
+
+    //! Aux method to received replies
+    bool recv_reply(
+            fastrtps::rtps::CacheChange_t& change,
+            TypeLookup_Reply& rep) const;
+
+    const fastrtps::rtps::GUID_t& get_builtin_request_writer_guid() const;
+
+    //!Pointer to the local RTPSParticipant.
+    fastrtps::rtps::RTPSParticipantImpl* participant_;
+
+    //!Pointer to the builtinprotocol class.
+    fastrtps::rtps::BuiltinProtocols* builtin_protocols_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    fastrtps::rtps::StatefulWriter* builtin_request_writer_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    fastrtps::rtps::StatefulReader* builtin_request_reader_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    fastrtps::rtps::StatefulWriter* builtin_reply_writer_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    fastrtps::rtps::StatefulReader* builtin_reply_reader_;
+
+    //!Writer History
+    fastrtps::rtps::WriterHistory* builtin_request_writer_history_;
+
+    //!Writer History
+    fastrtps::rtps::WriterHistory* builtin_reply_writer_history_;
+
+    //!Reader History
+    fastrtps::rtps::ReaderHistory* builtin_request_reader_history_;
+
+    //!Reader History
+    fastrtps::rtps::ReaderHistory* builtin_reply_reader_history_;
+
+    //!Request Listener object.
+    TypeLookupRequestListener* request_listener_;
+
+    //!Reply Listener object.
+    TypeLookupReplyListener* reply_listener_;
+
+    std::mutex temp_data_lock_;
+    fastrtps::rtps::ReaderProxyData temp_reader_proxy_data_;
+    fastrtps::rtps::WriterProxyData temp_writer_proxy_data_;
+
+    mutable fastrtps::rtps::SequenceNumber_t request_seq_number_;
+
+    mutable TypeLookup_RequestTypeSupport request_type_;
+
+    mutable TypeLookup_ReplyTypeSupport reply_type_;
+
+/* TODO Uncomment if security is implemented.
+#if HAVE_SECURITY
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    fastrtps::rtps::StatefulWriter* builtin_request_writer_secure_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    fastrtps::rtps::StatefulWriter* builtin_reply_writer_secure_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    fastrtps::rtps::StatefulReader* builtin_request_reader_secure_;
+
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    fastrtps::rtps::StatefulReader* builtin_reply_reader_secure_;
+
+    //!Writer History
+    fastrtps::rtps::WriterHistory* builtin_request_writer_secure_history_;
+
+    //!Writer History
+    fastrtps::rtps::WriterHistory* builtin_reply_writer_secure_history_;
+
+    //!Reader History
+    fastrtps::rtps::ReaderHistory* builtin_request_reader_secure_history_;
+
+    //!Reader History
+    fastrtps::rtps::ReaderHistory* builtin_reply_reader_secure_history_;
+
+    bool create_secure_endpoints();
+#endif
+*/
+};
+
+} /* namespace builtin */
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP */

+ 89 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp

@@ -0,0 +1,89 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TypeLookupReplyListener.hpp
+ *
+ */
+
+#ifndef TYPELOOKUP_REPLY_LISTENER_HPP_
+#define TYPELOOKUP_REPLY_LISTENER_HPP_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+#include <fastrtps/rtps/reader/ReaderListener.h>
+
+namespace eprosima {
+namespace fastrtps {
+
+namespace types {
+class TypeObjectFactory;
+} // namespace types
+
+namespace rtps {
+
+class RTPSReader;
+struct CacheChange_t;
+
+} // namespace rtps
+} // namespace fastrtp
+
+namespace fastdds {
+namespace dds {
+namespace builtin {
+
+class TypeLookupManager;
+
+/**
+ * Class TypeLookupReplyListener that receives the typelookup request messages of remote endpoints.
+ * @ingroup TYPES_MODULE
+ */
+class TypeLookupReplyListener : public fastrtps::rtps::ReaderListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     * @param pwlp Pointer to the writer liveliness protocol
+     */
+    TypeLookupReplyListener(
+            TypeLookupManager* pwlp);
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~TypeLookupReplyListener() override;
+
+    /**
+     * @brief Method call when this class is notified of a new cache change
+     * @param reader The reader receiving the cache change
+     * @param change The cache change
+     */
+    void onNewCacheChangeAdded(
+            fastrtps::rtps::RTPSReader* reader,
+            const fastrtps::rtps::CacheChange_t* const  change) override;
+
+private:
+
+    //! A pointer to the typelookup manager
+    TypeLookupManager* tlm_;
+
+    //! A pointer to the TypeObject factory.
+    fastrtps::types::TypeObjectFactory* factory_;
+};
+
+} /* namespace builtin */
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+#endif
+#endif /* TYPELOOKUP_REPLY_LISTENER_HPP_*/

+ 90 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp

@@ -0,0 +1,90 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TypeLookupRequestListener.hpp
+ *
+ */
+
+#ifndef TYPELOOKUP_REQUEST_LISTENER_HPP_
+#define TYPELOOKUP_REQUEST_LISTENER_HPP_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+#include <fastrtps/rtps/reader/ReaderListener.h>
+
+namespace eprosima {
+namespace fastrtps {
+
+namespace types {
+class TypeObjectFactory;
+} // namespace types
+
+namespace rtps {
+
+class RTPSReader;
+struct CacheChange_t;
+
+} // namespace rtps
+} // namespace fastrtp
+
+namespace fastdds {
+namespace dds {
+namespace builtin {
+
+class TypeLookupManager;
+
+/**
+ * Class TypeLookupRequestListener that receives the typelookup request messages of remote endpoints.
+ * @ingroup TYPES_MODULE
+ */
+class TypeLookupRequestListener : public fastrtps::rtps::ReaderListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     * @param pwlp Pointer to the writer liveliness protocol
+     */
+    TypeLookupRequestListener(
+            TypeLookupManager* pwlp);
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~TypeLookupRequestListener() override;
+
+    /**
+     * @brief Method call when this class is notified of a new cache change
+     * @param reader The reader receiving the cache change
+     * @param change The cache change
+     */
+    void onNewCacheChangeAdded(
+            fastrtps::rtps::RTPSReader* reader,
+            const fastrtps::rtps::CacheChange_t* const  change) override;
+
+private:
+
+    //! A pointer to the typelookup manager
+    TypeLookupManager* tlm_;
+
+    //! A pointer to the TypeObject factory.
+    fastrtps::types::TypeObjectFactory* factory_;
+
+};
+
+} /* namespace builtin */
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+#endif
+#endif /* TYPELOOKUP_REQUEST_LISTENER_HPP_*/

+ 425 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp

@@ -0,0 +1,425 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TypeLookupTypes.hpp
+ *
+ */
+
+#ifndef TYPELOOKUPTYPES_HPP
+#define TYPELOOKUPTYPES_HPP
+
+#include <fastrtps/types/TypeObject.h>
+#include <fastdds/dds/builtin/common/RequestHeader.hpp>
+#include <fastdds/dds/topic/TypeSupport.hpp>
+
+#include <cstdint>
+#include <vector>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+namespace builtin {
+
+const int32_t TypeLookup_getTypes_Hash = static_cast<int32_t>(0xd35282d1);
+const int32_t TypeLookup_getDependencies_Hash = static_cast<int32_t>(0x31fbaa35);
+
+struct TypeLookup_getTypes_In
+{
+    std::vector<fastrtps::types::TypeIdentifier> type_ids;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypes_In& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+struct TypeLookup_getTypes_Out
+{
+    std::vector<fastrtps::types::TypeIdentifierTypeObjectPair> types;
+
+    std::vector<fastrtps::types::TypeIdentifierPair> complete_to_minimal;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypes_Out& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+class TypeLookup_getTypes_Result
+{
+public:
+
+    RTPS_DllAPI TypeLookup_getTypes_Result();
+
+    RTPS_DllAPI ~TypeLookup_getTypes_Result();
+
+    RTPS_DllAPI TypeLookup_getTypes_Result(const TypeLookup_getTypes_Result &x);
+
+    RTPS_DllAPI TypeLookup_getTypes_Result(TypeLookup_getTypes_Result &&x);
+
+    RTPS_DllAPI TypeLookup_getTypes_Result& operator=(const TypeLookup_getTypes_Result &x);
+
+    RTPS_DllAPI TypeLookup_getTypes_Result& operator=(TypeLookup_getTypes_Result &&x);
+
+    RTPS_DllAPI void _d(int32_t __d);
+
+    RTPS_DllAPI int32_t _d() const;
+
+    RTPS_DllAPI int32_t& _d();
+
+    RTPS_DllAPI void result(const TypeLookup_getTypes_Out &_result);
+
+    RTPS_DllAPI void result(TypeLookup_getTypes_Out &&_result);
+
+    RTPS_DllAPI const TypeLookup_getTypes_Out& result() const;
+
+    RTPS_DllAPI TypeLookup_getTypes_Out& result();
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypes_Result& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+
+private:
+    int32_t m__d;
+    TypeLookup_getTypes_Out m_result;
+};
+
+class TypeLookup_getTypeDependencies_In
+{
+public:
+    std::vector<fastrtps::types::TypeIdentifier> type_ids;
+
+    std::vector<uint8_t> continuation_point;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypeDependencies_In& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+class TypeLookup_getTypeDependencies_Out
+{
+public:
+    std::vector<fastrtps::types::TypeIdentifierWithSize> dependent_typeids;
+
+    std::vector<uint8_t> continuation_point;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypeDependencies_Out& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+class TypeLookup_getTypeDependencies_Result
+{
+public:
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result();
+
+    RTPS_DllAPI ~TypeLookup_getTypeDependencies_Result();
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result(const TypeLookup_getTypeDependencies_Result &x);
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result(TypeLookup_getTypeDependencies_Result &&x);
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result& operator=(const TypeLookup_getTypeDependencies_Result &x);
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result& operator=(TypeLookup_getTypeDependencies_Result &&x);
+
+    RTPS_DllAPI void _d(int32_t __d);
+
+    RTPS_DllAPI int32_t _d() const;
+
+    RTPS_DllAPI int32_t& _d();
+
+    RTPS_DllAPI void result(const TypeLookup_getTypeDependencies_Out &_result);
+
+    RTPS_DllAPI void result(TypeLookup_getTypeDependencies_Out &&_result);
+
+    RTPS_DllAPI const TypeLookup_getTypeDependencies_Out& result() const;
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Out& result();
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_getTypeDependencies_Result& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+
+private:
+    int32_t m__d;
+
+    TypeLookup_getTypeDependencies_Out m_result;
+};
+class TypeLookup_Call
+{
+public:
+
+    RTPS_DllAPI TypeLookup_Call();
+
+    RTPS_DllAPI ~TypeLookup_Call();
+
+    RTPS_DllAPI TypeLookup_Call(const TypeLookup_Call &x);
+
+    RTPS_DllAPI TypeLookup_Call(TypeLookup_Call &&x);
+
+    RTPS_DllAPI TypeLookup_Call& operator=(const TypeLookup_Call &x);
+
+    RTPS_DllAPI TypeLookup_Call& operator=(TypeLookup_Call &&x);
+
+    RTPS_DllAPI void _d(int32_t __d);
+
+    RTPS_DllAPI int32_t _d() const;
+
+    RTPS_DllAPI int32_t& _d();
+
+    RTPS_DllAPI void getTypes(const TypeLookup_getTypes_In &_getTypes);
+
+    RTPS_DllAPI void getTypes(TypeLookup_getTypes_In &&_getTypes);
+
+    RTPS_DllAPI const TypeLookup_getTypes_In& getTypes() const;
+
+    RTPS_DllAPI TypeLookup_getTypes_In& getTypes();
+
+    RTPS_DllAPI void getTypeDependencies(const TypeLookup_getTypeDependencies_In &_getTypeDependencies);
+
+    RTPS_DllAPI void getTypeDependencies(TypeLookup_getTypeDependencies_In &&_getTypeDependencies);
+
+    RTPS_DllAPI const TypeLookup_getTypeDependencies_In& getTypeDependencies() const;
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_In& getTypeDependencies();
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_Call& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+
+private:
+    int32_t m__d;
+
+    TypeLookup_getTypes_In m_getTypes;
+    TypeLookup_getTypeDependencies_In m_getTypeDependencies;
+};
+
+class TypeLookup_Request
+{
+public:
+    rpc::RequestHeader header;
+
+    TypeLookup_Call data;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_Request& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+class TypeLookup_Return
+{
+public:
+
+    RTPS_DllAPI TypeLookup_Return();
+
+    RTPS_DllAPI ~TypeLookup_Return();
+
+    RTPS_DllAPI TypeLookup_Return(const TypeLookup_Return &x);
+
+    RTPS_DllAPI TypeLookup_Return(TypeLookup_Return &&x);
+
+    RTPS_DllAPI TypeLookup_Return& operator=(const TypeLookup_Return &x);
+
+    RTPS_DllAPI TypeLookup_Return& operator=(TypeLookup_Return &&x);
+
+    RTPS_DllAPI void _d(int32_t __d);
+
+    RTPS_DllAPI int32_t _d() const;
+
+    RTPS_DllAPI int32_t& _d();
+
+    RTPS_DllAPI void getType(const TypeLookup_getTypes_Result &_getType);
+
+    RTPS_DllAPI void getType(TypeLookup_getTypes_Result &&_getType);
+
+    RTPS_DllAPI const TypeLookup_getTypes_Result& getType() const;
+
+    RTPS_DllAPI TypeLookup_getTypes_Result& getType();
+
+    RTPS_DllAPI void getTypeDependencies(const TypeLookup_getTypeDependencies_Result &_getTypeDependencies);
+
+    RTPS_DllAPI void getTypeDependencies(TypeLookup_getTypeDependencies_Result &&_getTypeDependencies);
+
+    RTPS_DllAPI const TypeLookup_getTypeDependencies_Result& getTypeDependencies() const;
+
+    RTPS_DllAPI TypeLookup_getTypeDependencies_Result& getTypeDependencies();
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_Return& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+
+private:
+    int32_t m__d;
+
+    TypeLookup_getTypes_Result m_getType;
+    TypeLookup_getTypeDependencies_Result m_getTypeDependencies;
+};
+
+class TypeLookup_Reply
+{
+public:
+    rpc::RequestHeader header;
+
+    TypeLookup_Return return_value;
+
+    RTPS_DllAPI static size_t getCdrSerializedSize(const TypeLookup_Reply& data, size_t current_alignment = 0);
+
+    RTPS_DllAPI void serialize(eprosima::fastcdr::Cdr &cdr) const;
+
+    RTPS_DllAPI void deserialize(eprosima::fastcdr::Cdr &cdr);
+
+    RTPS_DllAPI static bool isKeyDefined() { return false; }
+};
+
+// TypeSupports
+class TypeLookup_RequestPubSubType : public TopicDataType
+{
+public:
+    TypeLookup_RequestPubSubType();
+
+    virtual ~TypeLookup_RequestPubSubType() override;
+
+    bool serialize(
+            void *data,
+            fastrtps::rtps::SerializedPayload_t* payload) override;
+
+    bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data) override;
+
+    /*
+    bool getKey(
+            void*,
+            fastrtps::rtps::InstanceHandle_t*,
+            bool) override
+    {}
+    */
+
+    void* createData() override;
+
+    void deleteData(void* data) override;
+};
+
+class TypeLookup_ReplyPubSubType : public TopicDataType
+{
+public:
+    TypeLookup_ReplyPubSubType();
+
+    virtual ~TypeLookup_ReplyPubSubType() override;
+
+    bool serialize(
+            void *data,
+            fastrtps::rtps::SerializedPayload_t* payload) override;
+
+    bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data) override;
+
+    /*
+    bool getKey(
+            void*,
+            fastrtps::rtps::InstanceHandle_t*,
+            bool) override
+    {}
+    */
+
+    void* createData() override;
+
+    void deleteData(void* data) override;
+};
+
+class TypeLookup_RequestTypeSupport : public TypeSupport
+{
+public:
+    RTPS_DllAPI bool serialize(
+            void* data,
+            fastrtps::rtps::SerializedPayload_t* payload) override;
+
+    RTPS_DllAPI bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data) override;
+
+    static size_t getCdrSerializedSize(
+            const TypeLookup_Request& data,
+            size_t current_alignment = 0);
+
+    RTPS_DllAPI void* create_data() override;
+
+    RTPS_DllAPI void delete_data(void* data) override;
+};
+
+class TypeLookup_ReplyTypeSupport : public TypeSupport
+{
+public:
+    RTPS_DllAPI bool serialize(
+            void* data,
+            fastrtps::rtps::SerializedPayload_t* payload) override;
+
+    RTPS_DllAPI bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data) override;
+
+    static size_t getCdrSerializedSize(
+            const TypeLookup_Reply& data,
+            size_t current_alignment = 0);
+
+    RTPS_DllAPI void* create_data() override;
+
+    RTPS_DllAPI void delete_data(void* data) override;
+};
+
+
+}
+}
+}
+}
+
+#endif // TYPELOOKUPTYPES_HPP

+ 149 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/Entity.hpp

@@ -0,0 +1,149 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Entity.hpp
+ *
+ */
+
+#ifndef _FASTDDS_ENTITY_HPP_
+#define _FASTDDS_ENTITY_HPP_
+
+#include <fastdds/dds/core/status/StatusMask.hpp>
+#include <fastdds/rtps/common/InstanceHandle.h>
+#include <fastrtps/types/TypesBase.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * @brief The Entity class is the abstract base class for all the objects that support QoS policies, a listener and
+ * a status condition.
+ *
+ */
+class Entity
+{
+public:
+
+    /**
+     * @brief Constructor
+     * @param mask StatusMask (default: all)
+     */
+    RTPS_DllAPI Entity(
+            const StatusMask& mask = StatusMask::all())
+        : status_mask_(mask)
+        , enable_(false)
+    {
+    }
+
+    /**
+     * @brief This operation enables the Entity
+     * @return RETCODE_OK
+     */
+    virtual fastrtps::types::ReturnCode_t enable()
+    {
+        enable_ = true;
+        return fastrtps::types::ReturnCode_t::RETCODE_OK;
+    }
+
+    /**
+     * @brief This operation disables the Entity before closing it
+     */
+    void close()
+    {
+        enable_ = false;
+    }
+
+    /**
+     * @brief Retrieves the set of relevant statuses for the Entity
+     * @return Reference to the StatusMask with the relevant statuses set to 1
+     */
+    RTPS_DllAPI const StatusMask& get_status_mask() const
+    {
+        return status_mask_;
+    }
+
+    /**
+     * @brief Retrieves the instance handler that represents the Entity
+     * @return Reference to the InstanceHandle
+     */
+    const fastrtps::rtps::InstanceHandle_t& get_instance_handle() const
+    {
+        return instance_handle_;
+    }
+
+    /**
+     * @brief Checks if the Entity is enabled
+     * @return true if enabled, false if not
+     */
+    RTPS_DllAPI bool is_enabled() const
+    {
+        return enable_;
+    }
+
+    RTPS_DllAPI bool operator ==(
+            const Entity& other) const
+    {
+        return (this->instance_handle_ == other.instance_handle_);
+    }
+
+protected:
+
+    /**
+     * @brief Setter for the Instance Handle
+     * @param handle Instance Handle
+     */
+    RTPS_DllAPI void set_instance_handle(
+            const fastrtps::rtps::InstanceHandle_t& handle)
+    {
+        instance_handle_ = handle;
+    }
+
+    //! StatusMask with relevant statuses set to 1
+    StatusMask status_mask_;
+
+    //! InstanceHandle associated to the Entity
+    fastrtps::rtps::InstanceHandle_t instance_handle_;
+
+    //! Boolean that states if the Entity is enabled or disabled
+    bool enable_;
+
+};
+
+/**
+ * @brief The DomainEntity class is a subclass of Entity created in order to differentiate between DomainParticipants
+ * and the rest of Entities
+ */
+class DomainEntity : public Entity
+{
+public:
+
+    /**
+     * @brief Constructor
+     * @param mask StatusMask (default: all)
+     */
+    RTPS_DllAPI DomainEntity(
+            const StatusMask& mask = StatusMask::all())
+        : Entity(mask)
+    {
+    }
+
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_ENTITY_HPP_

+ 1582 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/ParameterTypes.hpp

@@ -0,0 +1,1582 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ParameterTypes.hpp
+ */
+
+#ifndef _FASTDDS_DDS_QOS_PARAMETERTYPES_HPP_
+#define _FASTDDS_DDS_QOS_PARAMETERTYPES_HPP_
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/common/all_common.h>
+#include <fastdds/rtps/common/Token.h>
+#include <fastdds/rtps/messages/CDRMessage.h>
+
+#include <fastrtps/utils/fixed_size_string.hpp>
+
+#if HAVE_SECURITY
+#include <fastdds/rtps/security/accesscontrol/ParticipantSecurityAttributes.h>
+#include <fastdds/rtps/security/accesscontrol/EndpointSecurityAttributes.h>
+#endif
+
+#include <string>
+#include <vector>
+
+namespace eprosima {
+
+namespace fastrtps {
+namespace rtps {
+struct CDRMessage_t;
+}
+}
+
+namespace fastdds {
+namespace dds {
+
+/**
+ * @addtogroup PARAMETER_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enum for the unique parameter identifier. Alias of uint16_t.
+ */
+enum ParameterId_t : uint16_t
+{
+    PID_PAD = 0x0000,
+    PID_SENTINEL = 0x0001,
+    PID_USER_DATA = 0x002c,
+    PID_TOPIC_NAME = 0x0005,
+    PID_TYPE_NAME = 0x0007,
+    PID_GROUP_DATA =0x002d,
+    PID_TOPIC_DATA =0x002e,
+    PID_DURABILITY =0x001d,
+    PID_DURABILITY_SERVICE =0x001e,
+    PID_DEADLINE =0x0023,
+    PID_LATENCY_BUDGET =0x0027,
+    PID_LIVELINESS =0x001b,
+    PID_RELIABILITY =0x001A,
+    PID_LIFESPAN =0x002b,
+    PID_DESTINATION_ORDER =0x0025,
+    PID_HISTORY =0x0040,
+    PID_RESOURCE_LIMITS =0x0041,
+    PID_OWNERSHIP =0x001f,
+    PID_OWNERSHIP_STRENGTH =0x0006,
+    PID_PRESENTATION =0x0021,
+    PID_PARTITION =0x0029,
+    PID_TIME_BASED_FILTER =0x0004,
+    PID_TRANSPORT_PRIORITY =0x0049,
+    PID_PROTOCOL_VERSION = 0x0015,
+    PID_VENDORID = 0x0016,
+    PID_UNICAST_LOCATOR = 0x002f,
+    PID_MULTICAST_LOCATOR = 0x0030,
+    PID_MULTICAST_IPADDRESS =0x0011,
+    PID_DEFAULT_UNICAST_LOCATOR = 0x0031,
+    PID_DEFAULT_MULTICAST_LOCATOR = 0x0048,
+    PID_METATRAFFIC_UNICAST_LOCATOR = 0x0032,
+    PID_METATRAFFIC_MULTICAST_LOCATOR = 0x0033,
+    PID_DEFAULT_UNICAST_IPADDRESS =0x000c,
+    PID_DEFAULT_UNICAST_PORT = 0x000e,
+    PID_METATRAFFIC_UNICAST_IPADDRESS =0x0045,
+    PID_METATRAFFIC_UNICAST_PORT = 0x000d,
+    PID_METATRAFFIC_MULTICAST_IPADDRESS =0x000b,
+    PID_METATRAFFIC_MULTICAST_PORT = 0x0046,
+    PID_EXPECTS_INLINE_QOS =0x0043,
+    PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT =0x0034,
+    PID_PARTICIPANT_BUILTIN_ENDPOINTS = 0x0044,
+    PID_PARTICIPANT_LEASE_DURATION = 0x0002,
+    PID_CONTENT_FILTER_PROPERTY =0x0035,
+    PID_PARTICIPANT_GUID = 0x0050,
+    PID_PARTICIPANT_ENTITYID =0x0051,
+    PID_GROUP_GUID =0x0052,
+    PID_GROUP_ENTITYID =0x0053,
+    PID_BUILTIN_ENDPOINT_SET = 0x0058,
+    PID_PROPERTY_LIST = 0x0059,
+    PID_TYPE_MAX_SIZE_SERIALIZED =0x0060,
+    PID_ENTITY_NAME = 0x0062,
+    PID_TYPE_IDV1 = 0x0069,
+    PID_KEY_HASH = 0x0070,
+    PID_STATUS_INFO = 0x0071,
+    PID_TYPE_OBJECTV1 = 0x0072,
+    PID_ENDPOINT_GUID = 0x005a,
+    //PID_RELATED_SAMPLE_IDENTITY = 0x0083
+    PID_IDENTITY_TOKEN = 0x1001,
+    PID_PERMISSIONS_TOKEN = 0x1002,
+    PID_DATA_TAGS = 0x1003,
+    PID_ENDPOINT_SECURITY_INFO = 0x1004,
+    PID_PARTICIPANT_SECURITY_INFO = 0x1005,
+    PID_IDENTITY_STATUS_TOKEN = 0x1006,
+    PID_PERSISTENCE_GUID = 0x8002,
+    PID_RELATED_SAMPLE_IDENTITY = 0x800f,
+    PID_DATA_REPRESENTATION = 0x0073,
+    PID_TYPE_CONSISTENCY_ENFORCEMENT = 0x0074,
+    PID_TYPE_INFORMATION = 0x0075,
+    PID_DISABLE_POSITIVE_ACKS = 0x8005,
+};
+
+//!Base Parameter class with parameter PID and parameter length in bytes.
+//!@ingroup PARAMETER_MODULE
+class Parameter_t
+{
+public:
+
+    /**
+     * @brief Constructor without parameters
+     */
+    RTPS_DllAPI Parameter_t()
+        : Pid(PID_PAD)
+        , length(0)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param length Its associated length
+     */
+    RTPS_DllAPI Parameter_t(
+            ParameterId_t pid,
+            uint16_t length)
+        : Pid(pid)
+        , length(length)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~Parameter_t()
+    {
+    }
+
+    bool operator ==(
+            const Parameter_t& b) const
+    {
+        return (this->Pid == b.Pid) &&
+               (this->length == b.length);
+    }
+
+public:
+
+    //!Parameter ID. <br> By default, PID_PAD.
+    ParameterId_t Pid;
+    //!Parameter length. <br> By default, 0.
+    uint16_t length;
+};
+
+/**
+ *@ingroup PARAMETER_MODULE
+ */
+class ParameterKey_t : public Parameter_t
+{
+public:
+
+    //!Instance Handle. <br> By default, c_InstanceHandle_Unknown.
+    fastrtps::rtps::InstanceHandle_t key;
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterKey_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterKey_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, parameter length and Instance Handle
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param ke Instance Handle to be set
+     */
+    ParameterKey_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            const fastrtps::rtps::InstanceHandle_t& ke)
+        : Parameter_t(pid, in_length)
+        , key(ke)
+    {
+    }
+
+};
+
+#define PARAMETER_KEY_HASH_LENGTH 16
+
+/**
+ *@ingroup PARAMETER_MODULE
+ */
+class ParameterLocator_t : public Parameter_t
+{
+public:
+
+    //!Locator
+    fastrtps::rtps::Locator_t locator;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterLocator_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterLocator_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a Locator
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param loc Locator to be set
+     */
+    ParameterLocator_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            const fastrtps::rtps::Locator_t& loc)
+        : Parameter_t(pid, in_length)
+        , locator(loc)
+    {
+    }
+
+};
+#define PARAMETER_LOCATOR_LENGTH 24
+
+
+/**
+ *@ingroup PARAMETER_MODULE
+ */
+class ParameterString_t : public Parameter_t
+{
+public:
+
+    /**
+     * @brief Constructor without parameters.
+     */
+    ParameterString_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterString_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a string
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param strin Parameter name
+     */
+    ParameterString_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            const fastrtps::string_255& strin)
+        : Parameter_t(pid, in_length)
+        , string_(strin)
+    {
+    }
+
+    /**
+     * @brief Getter for the name
+     * @return current name associated
+     */
+    inline const char* getName() const
+    {
+        return string_.c_str();
+    }
+
+    /**
+     * @brief Setter for the name
+     * @param name String to be set
+     */
+    inline void setName(
+            const char* name)
+    {
+        string_ = name;
+    }
+
+    /**
+     * @brief Getter for the name size
+     * @return size_t
+     */
+    inline size_t size() const
+    {
+        return string_.size();
+    }
+
+private:
+
+    //!Name. <br> By default, empty string.
+    fastrtps::string_255 string_;
+};
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterPort_t : public Parameter_t
+{
+public:
+
+    //!Port. <br> By default, 0.
+    uint32_t port;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterPort_t()
+        : port(0)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterPort_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , port(0)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a port
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param po Port to be set
+     */
+    ParameterPort_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            uint32_t po)
+        : Parameter_t(pid, in_length)
+        , port(po)
+    {
+    }
+
+};
+
+#define PARAMETER_PORT_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterGuid_t : public Parameter_t
+{
+public:
+
+    //!GUID <br> By default, unknown GUID.
+    fastrtps::rtps::GUID_t guid;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterGuid_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterGuid_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a GUID
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param guidin GUID to be set
+     */
+    ParameterGuid_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            const fastrtps::rtps::GUID_t& guidin)
+        : Parameter_t(pid, in_length)
+        , guid(guidin)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a Instance Handle
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param iH Instance Handle to be set as GUID
+     */
+    ParameterGuid_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            const fastrtps::rtps::InstanceHandle_t& iH)
+        : Parameter_t(pid, in_length)
+    {
+        for (uint8_t i = 0; i < 16; ++i)
+        {
+            if (i < 12)
+            {
+                guid.guidPrefix.value[i] = iH.value[i];
+            }
+            else
+            {
+                guid.entityId.value[i - 12] = iH.value[i];
+            }
+        }
+    }
+
+};
+
+#define PARAMETER_GUID_LENGTH 16
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterProtocolVersion_t : public Parameter_t
+{
+public:
+
+    //!Protocol Version. <br> By default, c_ProtocolVersion.
+    fastrtps::rtps::ProtocolVersion_t protocolVersion;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterProtocolVersion_t()
+    {
+        protocolVersion = fastrtps::rtps::c_ProtocolVersion;
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterProtocolVersion_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+        protocolVersion = fastrtps::rtps::c_ProtocolVersion;
+    }
+
+};
+
+#define PARAMETER_PROTOCOL_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterVendorId_t : public Parameter_t
+{
+public:
+
+    //!Vendor Id. <br> By default, c_VendorId_eProsima.
+    fastrtps::rtps::VendorId_t vendorId;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterVendorId_t()
+        : vendorId(fastrtps::rtps::c_VendorId_eProsima)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterVendorId_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , vendorId(fastrtps::rtps::c_VendorId_eProsima)
+    {
+    }
+
+};
+
+#define PARAMETER_VENDOR_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterIP4Address_t : public Parameter_t
+{
+public:
+
+    //!Address <br> By default [0,0,0,0].
+    fastrtps::rtps::octet address[4];
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterIP4Address_t()
+    {
+        this->setIP4Address(0, 0, 0, 0);
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterIP4Address_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+        this->setIP4Address(0, 0, 0, 0);
+    }
+
+    /**
+     * @brief Setter for the address
+     * @param o1 First octet
+     * @param o2 Second octet
+     * @param o3 Third octet
+     * @param o4 Fourth octet
+     */
+    void setIP4Address(
+            fastrtps::rtps::octet o1,
+            fastrtps::rtps::octet o2,
+            fastrtps::rtps::octet o3,
+            fastrtps::rtps::octet o4)
+    {
+        address[0] = o1;
+        address[1] = o2;
+        address[2] = o3;
+        address[3] = o4;
+    }
+
+};
+
+#define PARAMETER_IP4_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterBool_t : public Parameter_t
+{
+public:
+
+    //!Boolean <br> By default, false.
+    bool value;
+
+    /**
+     * @brief Constructor without parameter
+     */
+    ParameterBool_t()
+        : value(false)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterBool_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , value(false)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and a boolean
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param inbool Boolean to be set
+     */
+    ParameterBool_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            bool inbool)
+        : Parameter_t(pid, in_length)
+        , value(inbool)
+    {
+    }
+
+};
+
+#define PARAMETER_BOOL_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterStatusInfo_t : public Parameter_t
+{
+public:
+
+    //!Status <br> By default, 0.
+    uint8_t status;
+
+    /**
+     * @brief Constructor without parameter
+     */
+    ParameterStatusInfo_t()
+        : status(0)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterStatusInfo_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , status(0)
+    {
+    }
+
+    /**
+     * @brief Constructor using a parameter PID, the parameter length and status value
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     * @param instatus uint8_t to be set as status
+     */
+    ParameterStatusInfo_t(
+            ParameterId_t pid,
+            uint16_t in_length,
+            uint8_t instatus)
+        : Parameter_t(pid, in_length)
+        , status(instatus)
+    {
+    }
+
+};
+
+#define PARAMETER_STATUS_INFO_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterCount_t : public Parameter_t
+{
+public:
+
+    //!Count <br> By default, 0.
+    fastrtps::rtps::Count_t count;
+
+    /**
+     * @brief Constructor without parameter
+     */
+    ParameterCount_t()
+        : count(0)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterCount_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , count(0)
+    {
+    }
+
+};
+
+#define PARAMETER_COUNT_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterEntityId_t : public Parameter_t
+{
+public:
+
+    //!EntityId <br> By default, ENTITYID_UNKNOWN.
+    fastrtps::rtps::EntityId_t entityId;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterEntityId_t()
+        : entityId(ENTITYID_UNKNOWN)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterEntityId_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , entityId(ENTITYID_UNKNOWN)
+    {
+    }
+
+};
+
+#define PARAMETER_ENTITYID_LENGTH 4
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterTime_t : public Parameter_t
+{
+public:
+
+    //!Time <br> By default, 0.
+    fastrtps::rtps::Time_t time;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterTime_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterTime_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+};
+
+#define PARAMETER_TIME_LENGTH 8
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterBuiltinEndpointSet_t : public Parameter_t
+{
+public:
+
+    //!Builtin Endpoint Set <br> By default, 0.
+    fastrtps::rtps::BuiltinEndpointSet_t endpointSet;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterBuiltinEndpointSet_t()
+        : endpointSet(0)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterBuiltinEndpointSet_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , endpointSet(0)
+    {
+    }
+
+};
+
+#define PARAMETER_BUILTINENDPOINTSET_LENGTH 4
+
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterProperty_t
+{
+
+    friend class ParameterPropertyList_t;
+
+private:
+
+    //!Data <br> By default, nullptr.
+    fastrtps::rtps::octet* data;
+
+public:
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterProperty_t()
+    {
+        data = nullptr;
+    }
+
+    /**
+     * @brief Constructor using a pointer
+     * @param ptr Pointer to be set as data
+     */
+    explicit ParameterProperty_t(
+            void* ptr)
+    {
+        data = (fastrtps::rtps::octet*)ptr;
+    }
+
+    /**
+     * @brief Getter for the first element in data
+     * @return string with the data
+     */
+    std::string first() const
+    {
+        //Skip the size and return the string
+        return std::string((char*)data + 4);
+    }
+
+    /**
+     * @brief Getter for the second element in data
+     * @return string with the data
+     */
+    std::string second() const
+    {
+        //Skip the first element
+        uint32_t size1 = ParameterProperty_t::element_size(data);
+
+        //Skip the size of the second element and return the string
+        return std::string((char*)data + size1 + 4);
+    }
+
+    /**
+     * @brief Setter using a pair of strings
+     * @param new_value Pair of strings with the new values
+     * @return true if the modification is done correctly and false if the size of the new_value is not valid
+     */
+    bool modify(
+            const std::pair<std::string, std::string>& new_value)
+    {
+        uint32_t old_size = size();
+
+        uint32_t first_size = (uint32_t)new_value.first.size() + 1;
+        uint32_t first_alignment = ((first_size + 3) & ~3) - first_size;
+        uint32_t second_size = (uint32_t)new_value.second.size() + 1;
+        uint32_t second_alignment = ((second_size + 3) & ~3) - second_size;
+        uint32_t new_size = first_size + first_alignment + second_size + second_alignment + 8;
+
+        if (old_size != new_size)
+        {
+            return false;
+        }
+
+        fastrtps::rtps::octet* current = data;
+        memcpy(current, &first_size, 4);
+        memcpy(current + 4, new_value.first.c_str(), first_size);
+        memset(current + 4 + first_size, 0, first_alignment);
+
+        current = data + 4 + first_size + first_alignment;
+        memcpy(current, &second_size, 4);
+        memcpy(current + 4, new_value.second.c_str(), second_size);
+        memset(current + 4 + second_size, 0, second_alignment);
+
+        return true;
+    }
+
+    /**
+     * @brief Getter that returns a pair of the first and second elements in data
+     * @return Pair of strings with the first and second elements data
+     */
+    std::pair<const std::string, const std::string> pair() const
+    {
+        return std::make_pair(std::string(first()), std::string(second()));
+    }
+
+    /**
+     * @brief Getter for data size
+     * @return uint32_t with the size
+     */
+    uint32_t size() const
+    {
+        //Size of the first element (with alignment)
+        uint32_t size1 = ParameterProperty_t::element_size(data);
+
+        //Size of the second element (with alignment)
+        uint32_t size2 = ParameterProperty_t::element_size(data + size1);
+        return size1 + size2;
+    }
+
+    bool operator ==(
+            const ParameterProperty_t& b) const
+    {
+        return (first() == b.first()) &&
+               (second() == b.second());
+    }
+
+    bool operator !=(
+            const ParameterProperty_t& b) const
+    {
+        return !(*this == b);
+    }
+
+private:
+
+    /**
+     * @brief Getter for the size of a specific octet pointer
+     * @param ptr Octet pointer to measure
+     * @return Size of the pointer data
+     */
+    static uint32_t element_size(
+            const fastrtps::rtps::octet* ptr)
+    {
+        //Size of the element (with alignment)
+        uint32_t size = *(uint32_t*)ptr;
+        return (4 + ((size + 3) & ~3));
+    }
+
+};
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterPropertyList_t : public Parameter_t
+{
+private:
+
+    //!Properties
+    fastrtps::rtps::SerializedPayload_t properties_;
+    //!Number of properties
+    uint32_t Nproperties_ = 0;
+    //!Maximum size
+    bool limit_size_ = false;
+
+public:
+
+    class iterator
+    {
+public:
+
+        typedef iterator self_type;
+        typedef ParameterProperty_t value_type;
+        typedef ParameterProperty_t reference;
+        typedef ParameterProperty_t* pointer;
+        typedef size_t difference_type;
+        typedef std::forward_iterator_tag iterator_category;
+
+        /**
+         * @brief Constructor using an octet pointer
+         * @param ptr Octet pointer to be set
+         */
+        iterator(
+                fastrtps::rtps::octet* ptr)
+            : ptr_(ptr)
+            , value_(ptr)
+        {
+        }
+
+        self_type operator ++()
+        {
+            self_type i = *this;
+            advance();
+            return i;
+        }
+
+        self_type operator ++(
+                int)
+        {
+            advance();
+            return *this;
+        }
+
+        reference operator *()
+        {
+            return value_;
+        }
+
+        pointer operator ->()
+        {
+            return &value_;
+        }
+
+        bool operator ==(
+                const self_type& rhs)
+        {
+            return ptr_ == rhs.ptr_;
+        }
+
+        bool operator !=(
+                const self_type& rhs)
+        {
+            return ptr_ != rhs.ptr_;
+        }
+
+protected:
+
+        /**
+         * @brief Shift the pointer to the next value
+         */
+        void advance()
+        {
+            ptr_ += value_.size();
+            value_ = ParameterProperty_t(ptr_);
+        }
+
+        /**
+         * @brief Getter for the pointer
+         * @return the pointer
+         */
+        fastrtps::rtps::octet* address() const
+        {
+            return ptr_;
+        }
+
+private:
+
+        //!Pointer
+        fastrtps::rtps::octet* ptr_;
+        //!Parameter Property
+        ParameterProperty_t value_;
+    };
+
+    class const_iterator
+    {
+public:
+
+        typedef const_iterator self_type;
+        typedef const ParameterProperty_t value_type;
+        typedef const ParameterProperty_t reference;
+        typedef const ParameterProperty_t* pointer;
+        typedef size_t difference_type;
+        typedef std::forward_iterator_tag iterator_category;
+
+        /**
+         * @brief Constructor using a pointer
+         * @param ptr Pointer to be set
+         */
+        const_iterator(
+                const fastrtps::rtps::octet* ptr)
+            : ptr_(ptr)
+            , value_(const_cast<fastrtps::rtps::octet*>(ptr))
+        {
+        }
+
+        self_type operator ++()
+        {
+            self_type i = *this;
+            advance();
+            return i;
+        }
+
+        self_type operator ++(
+                int)
+        {
+            advance();
+            return *this;
+        }
+
+        reference operator *()
+        {
+            return value_;
+        }
+
+        pointer operator ->()
+        {
+            return &value_;
+        }
+
+        bool operator ==(
+                const self_type& rhs)
+        {
+            return ptr_ == rhs.ptr_;
+        }
+
+        bool operator !=(
+                const self_type& rhs)
+        {
+            return ptr_ != rhs.ptr_;
+        }
+
+protected:
+
+        /**
+         * @brief Shift the pointer to the next value
+         */
+        void advance()
+        {
+            ptr_ += value_.size();
+            value_ = ParameterProperty_t(const_cast<fastrtps::rtps::octet*>(ptr_));
+        }
+
+        /**
+         * @brief Getter for the pointer
+         * @return the pointer
+         */
+        const fastrtps::rtps::octet* address() const
+        {
+            return ptr_;
+        }
+
+private:
+
+        //!Pointer
+        const fastrtps::rtps::octet* ptr_;
+        //!Parameter Property
+        ParameterProperty_t value_;
+    };
+
+public:
+
+    /**
+     * @brief Constructor without parameters
+     * Sets PID_PROPERTY_LIST as the PID of the parameter
+     */
+    ParameterPropertyList_t()
+        : Parameter_t(PID_PROPERTY_LIST, 0)
+        , Nproperties_ (0)
+        , limit_size_ (false)
+    {
+    }
+
+    /**
+     * Constructor with a defined maximum size
+     * @param size Size to be set as maximum
+     */
+    ParameterPropertyList_t(
+            uint32_t size)
+        : Parameter_t(PID_PROPERTY_LIST, 0)
+        , properties_(size)
+        , Nproperties_ (0)
+        , limit_size_ (size == 0 ? false : true)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param in_length Its associated length
+     */
+    ParameterPropertyList_t(
+            ParameterId_t /*pid*/,
+            uint16_t in_length)
+        : Parameter_t(PID_PROPERTY_LIST, in_length)
+        , Nproperties_ (0)
+        , limit_size_ (false)
+    {
+    }
+
+    /**
+     * @brief Constructor using a Parameter Property List
+     * @param parameter_properties Properties to be set
+     */
+    ParameterPropertyList_t(
+            const ParameterPropertyList_t& parameter_properties)
+        : Parameter_t(PID_PROPERTY_LIST, parameter_properties.length)
+        , properties_(parameter_properties.limit_size_ ?
+                parameter_properties.properties_.max_size :
+                parameter_properties.properties_.length)
+        , Nproperties_ (parameter_properties.Nproperties_)
+        , limit_size_ (parameter_properties.limit_size_)
+    {
+        properties_.copy(&parameter_properties.properties_, parameter_properties.limit_size_);
+    }
+
+    ParameterPropertyList_t& operator = (
+            const ParameterPropertyList_t& parameter_properties)
+    {
+        length = parameter_properties.length;
+        limit_size_ = parameter_properties.limit_size_;
+        properties_.reserve(limit_size_ ?
+                parameter_properties.properties_.max_size :
+                parameter_properties.properties_.length);
+        properties_.copy(&parameter_properties.properties_, parameter_properties.limit_size_);
+        Nproperties_ = parameter_properties.Nproperties_;
+        return *this;
+    }
+
+    /**
+     * @brief Getter for the first position of the ParameterPropertyList
+     * @return iterator
+     */
+    iterator begin()
+    {
+        return iterator(properties_.data);
+    }
+
+    /**
+     * @brief Getter for the end of the ParameterPropertyList
+     * @return iterator
+     */
+    iterator end()
+    {
+        return iterator(properties_.data + properties_.length);
+    }
+
+    /**
+     * @brief Getter for the first position of the ParameterPropertyList
+     * @return const_iterator
+     */
+    const_iterator begin() const
+    {
+        return const_iterator(properties_.data);
+    }
+
+    /**
+     * @brief Getter for the end of the ParameterPropertyList
+     * @return const_iterator
+     */
+    const_iterator end() const
+    {
+        return const_iterator(properties_.data + properties_.length);
+    }
+
+    /**
+     * @brief Introduce a new property in the ParameterPropertyList
+     * @param p Pair with the values of the new property
+     * @return true if it is introduced, false if not.
+     */
+    bool push_back(
+            std::pair<std::string, std::string> p)
+    {
+        //Realloc if needed;
+        uint32_t size1 = (uint32_t) p.first.length() + 1;
+        uint32_t alignment1 = ((size1 + 3) & ~3) - size1;
+
+        uint32_t size2 = (uint32_t) p.second.length() + 1;
+        uint32_t alignment2 = ((size2 + 3) & ~3) - size2;
+
+        if (limit_size_ && (properties_.max_size < properties_.length +
+                size1 + alignment1 + 4 +
+                size2 + alignment2 + 4))
+        {
+            return false;
+        }
+        properties_.reserve(properties_.length +
+                size1 + alignment1 + 4 +
+                size2 + alignment2 + 4);
+
+        push_back_helper((fastrtps::rtps::octet*)p.first.c_str(), size1, alignment1);
+        push_back_helper((fastrtps::rtps::octet*)p.second.c_str(), size2, alignment2);
+        ++Nproperties_;
+        return true;
+    }
+
+    /**
+     * @brief Introduce a new property in the ParameterPropertyList
+     * @param str1 Name of the property
+     * @param str1_size Size of the first string
+     * @param str2 Value of the property
+     * @param str2_size Size of the second string
+     * @return true if it is introduced, false if not.
+     */
+    bool push_back(
+            const unsigned char* str1,
+            uint32_t str1_size,
+            const unsigned char* str2,
+            uint32_t str2_size)
+    {
+        //Realloc if needed;
+        uint32_t alignment1 = ((str1_size + 3) & ~3) - str1_size;
+        uint32_t alignment2 = ((str2_size + 3) & ~3) - str2_size;
+
+        if (limit_size_ && (properties_.max_size < properties_.length +
+                str1_size + alignment1 + 4 +
+                str2_size + alignment2 + 4))
+        {
+            return false;
+        }
+        properties_.reserve(properties_.length +
+                str1_size + alignment1 + 4 +
+                str2_size + alignment2 + 4);
+
+        push_back_helper((fastrtps::rtps::octet*)str1, str1_size, alignment1);
+        push_back_helper((fastrtps::rtps::octet*)str2, str2_size, alignment2);
+        ++Nproperties_;
+        return true;
+    }
+
+    /**
+     * @brief Setter of a new property value on a specific position
+     * @param pos Iterator with the position of the property to be changed
+     * @param new_value Value to be set
+     * @return true if changed, false if not
+     */
+    bool set_property (
+            iterator pos,
+            const std::pair<std::string, std::string>& new_value)
+    {
+        return pos->modify(new_value);
+    }
+
+    /**
+     * @brief Clears the ParameterPropertyList
+     */
+    void clear()
+    {
+        properties_.length = 0;
+        Nproperties_ = 0;
+    }
+
+    /**
+     * @brief Getter for the size of the ParameterPropertyList
+     * @return uint32_t with the size
+     */
+    uint32_t size() const
+    {
+        return Nproperties_;
+    }
+
+    /**
+     * @brief Setter for the maximum size of the ParameterPropertyList
+     */
+    void set_max_size (
+            uint32_t size)
+    {
+        properties_.reserve(size);
+        limit_size_ = true;
+    }
+
+    /**
+     * @brief Getter for the maximum size of the ParameterPropertyList
+     * @return uint32_t with the size
+     */
+    uint32_t max_size ()
+    {
+        return (limit_size_ ? properties_.max_size : 0);
+    }
+
+protected:
+
+    void push_back_helper (
+            const fastrtps::rtps::octet* data,
+            uint32_t size,
+            uint32_t alignment)
+    {
+        fastrtps::rtps::octet* o = (fastrtps::rtps::octet*)&size;
+        memcpy(properties_.data + properties_.length, o, 4);
+        properties_.length += 4;
+
+        memcpy(properties_.data + properties_.length, data, size);
+        properties_.length += size;
+
+        for (uint32_t i = 0; i < alignment; ++i)
+        {
+            properties_.data[properties_.length + i] = '\0';
+        }
+        properties_.length += alignment;
+    }
+
+};
+
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterSampleIdentity_t : public Parameter_t
+{
+public:
+
+    //!Sample Identity <br> By default, unknown.
+    fastrtps::rtps::SampleIdentity sample_id;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterSampleIdentity_t()
+        : sample_id(fastrtps::rtps::SampleIdentity::unknown())
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterSampleIdentity_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , sample_id(fastrtps::rtps::SampleIdentity::unknown())
+    {
+    }
+
+    /**
+     * Add the parameter to a CDRMessage_t message.
+     * @param[in,out] msg Pointer to the message where the parameter should be added.
+     * @return True if the parameter was correctly added.
+     */
+    bool addToCDRMessage(
+            fastrtps::rtps::CDRMessage_t* msg) const;
+
+    /**
+     * Read the parameter from a CDRMessage_t message.
+     * @param[in,out] msg Pointer to the message from where the parameter should be taken.
+     * @param size Size of the parameter field to read
+     * @return True if the parameter was correctly taken.
+     */
+    bool readFromCDRMessage(
+            fastrtps::rtps::CDRMessage_t* msg,
+            uint16_t size);
+
+};
+
+#define PARAMETER_SAMPLEIDENTITY_LENGTH 24
+
+
+#if HAVE_SECURITY
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterToken_t : public Parameter_t
+{
+public:
+
+    //!Token
+    fastrtps::rtps::Token token;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    ParameterToken_t()
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterToken_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+};
+
+//!Default value for the ParameterParticipantSecurityInfo_t length
+#define PARAMETER_PARTICIPANT_SECURITY_INFO_LENGTH 8
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterParticipantSecurityInfo_t : public Parameter_t
+{
+public:
+
+    //!Participant Security Attributes Mask <br> By default, 0.
+    fastrtps::rtps::security::ParticipantSecurityAttributesMask security_attributes = 0;
+    //!Plugin Participant Security Attributes Mask <br> By default, 0.
+    fastrtps::rtps::security::PluginParticipantSecurityAttributesMask plugin_security_attributes = 0;
+
+    /**
+     * @brief Constructor without parameters. <br>
+     * Sets the value PID_PARTICIPANT_SECURITY_INFO for the parameter PID and PARAMETER_PARTICIPANT_SECURITY_INFO_LENGTH
+     * for the length.
+     */
+    ParameterParticipantSecurityInfo_t()
+        : Parameter_t(PID_PARTICIPANT_SECURITY_INFO, PARAMETER_PARTICIPANT_SECURITY_INFO_LENGTH)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterParticipantSecurityInfo_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+};
+
+//!Default value for the ParameterEndpointSecurityInfo_t length
+#define PARAMETER_ENDPOINT_SECURITY_INFO_LENGTH 8
+
+/**
+ * @ingroup PARAMETER_MODULE
+ */
+class ParameterEndpointSecurityInfo_t : public Parameter_t
+{
+public:
+
+    fastrtps::rtps::security::EndpointSecurityAttributesMask security_attributes;
+    fastrtps::rtps::security::PluginEndpointSecurityAttributesMask plugin_security_attributes;
+
+    /**
+     * @brief Constructor without parameters. <br>
+     * Sets the value PID_ENDPOINT_SECURITY_INFO for the parameter PID and PARAMETER_ENDPOINT_SECURITY_INFO_LENGTH
+     * for the length.
+     */
+    ParameterEndpointSecurityInfo_t()
+        : Parameter_t(PID_ENDPOINT_SECURITY_INFO, PARAMETER_ENDPOINT_SECURITY_INFO_LENGTH)
+    {
+    }
+
+    /**
+     * Constructor using a parameter PID and the parameter length
+     * @param pid Pid of the parameter
+     * @param in_length Its associated length
+     */
+    ParameterEndpointSecurityInfo_t(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+    {
+    }
+
+};
+
+#endif
+
+///@}
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif
+#endif // _FASTDDS_DDS_QOS_PARAMETERTYPES_HPP_

+ 2704 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/QosPolicies.hpp

@@ -0,0 +1,2704 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file QosPolicies.hpp
+ *
+ */
+
+#ifndef _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_
+#define _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_
+
+#include <vector>
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/dds/core/policy/ParameterTypes.hpp>
+#include <fastdds/rtps/attributes/PropertyPolicy.h>
+#include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+#include <fastdds/rtps/resources/ResourceManagement.h>
+#include <fastdds/rtps/attributes/PropertyPolicy.h>
+#include <fastrtps/types/TypeObject.h>
+#include <fastrtps/utils/collections/ResourceLimitedVector.hpp>
+
+
+namespace eprosima {
+
+namespace fastrtps {
+namespace rtps {
+class EDP;
+}
+}
+
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class QosPolicy, base for all QoS policies defined for Writers and Readers.
+ */
+class QosPolicy
+{
+public:
+
+    //! Boolean that indicates if the Qos has been changed
+    bool hasChanged;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    QosPolicy()
+        : hasChanged(false)
+        , send_always_(false)
+    {
+    }
+
+    /**
+     * @brief Constructor
+     * @param send_always Boolean that set if the Qos need to be sent even if it is not changed
+     */
+    explicit QosPolicy(
+            bool send_always)
+        : hasChanged(false)
+        , send_always_(send_always)
+    {
+    }
+
+    /**
+     * @brief Copy Constructor
+     * @param b Another instance of QosPolicy
+     */
+    QosPolicy(
+            const QosPolicy& b) = default;
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~QosPolicy() = default;
+
+    bool operator ==(
+            const QosPolicy& b) const
+    {
+        // hasChanged field isn't needed to be compared to being equal two QosPolicy objects.
+        return (this->send_always_ == b.send_always_);
+    }
+
+    QosPolicy& operator =(
+            const QosPolicy& b) = default;
+
+    /**
+     * Whether it should always be sent.
+     * @return True if it should always be sent.
+     */
+    virtual bool send_always() const
+    {
+        return send_always_;
+    }
+
+    /**
+     * @brief Clears the QosPolicy object
+     */
+    virtual inline void clear() = 0;
+
+protected:
+
+    //! Boolean that indicates if the Qos has to be sent even if it is not changed
+    bool send_always_;
+};
+
+/**
+ * @brief Controls the behavior of the entity when acting as a factory for other entities. In other words,
+ * configures the side-effects of the create_* and delete_* operations.
+ * @note Mutable Qos Policy
+ */
+class EntityFactoryQosPolicy
+{
+public:
+
+    /**
+     * Specifies whether the entity acting as a factory automatically enables the instances it creates.
+     * If True the factory will automatically enable each created Entity otherwise it will not. <br>
+     * By default, True.
+     */
+    bool autoenable_created_entities;
+
+    /**
+     * @brief Constructor without parameters
+     */
+    RTPS_DllAPI EntityFactoryQosPolicy()
+        : autoenable_created_entities(true)
+    {
+    }
+
+    /**
+     * @brief Constructor
+     * @param autoenable Value for the autoenable_created_entities boolean
+     */
+    RTPS_DllAPI EntityFactoryQosPolicy(
+            bool autoenable)
+        : autoenable_created_entities(autoenable)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~EntityFactoryQosPolicy()
+    {
+    }
+
+    bool operator ==(
+            const EntityFactoryQosPolicy& b) const
+    {
+        return
+            (this->autoenable_created_entities == b.autoenable_created_entities);
+    }
+
+    inline void clear()
+    {
+        EntityFactoryQosPolicy reset = EntityFactoryQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+/**
+ * Enum DurabilityQosPolicyKind_t, different kinds of durability for DurabilityQosPolicy.
+ */
+typedef enum DurabilityQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * The Service does not need to keep any samples of data-instances on behalf of any DataReader that is not
+     * known by the DataWriter at the time the instance is written. In other words the Service will only attempt
+     * to provide the data to existing subscribers
+     */
+    VOLATILE_DURABILITY_QOS,
+    /**
+     * For TRANSIENT_LOCAL, the service is only required to keep the data in the memory of the DataWriter that
+     * wrote the data and the data is not required to survive the DataWriter.
+     */
+    TRANSIENT_LOCAL_DURABILITY_QOS,
+    /**
+     * For TRANSIENT, the service is only required to keep the data in memory and not in permanent storage; but
+     * the data is not tied to the lifecycle of the DataWriter and will, in general, survive it.
+     */
+    TRANSIENT_DURABILITY_QOS,
+    /**
+     * Data is kept on permanent storage, so that they can outlive a system session.
+     * @warning Not Supported
+     */
+    PERSISTENT_DURABILITY_QOS
+} DurabilityQosPolicyKind_t;
+
+#define PARAMETER_KIND_LENGTH 4
+#define PARAMETER_BOOL_LENGTH 4
+
+/**
+ * This policy expresses if the data should ‘outlive’ their writing time.
+ * @note Immutable Qos Policy
+ */
+class DurabilityQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DurabilityQosPolicy()
+        : Parameter_t(PID_DURABILITY, PARAMETER_KIND_LENGTH)
+        , QosPolicy(true)
+        , kind(VOLATILE_DURABILITY_QOS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DurabilityQosPolicy() = default;
+
+    /**
+     * Translates kind to rtps layer equivalent
+     * @return fastrtps::rtps::DurabilityKind_t
+     */
+    inline fastrtps::rtps::DurabilityKind_t durabilityKind() const
+    {
+        switch (kind)
+        {
+            default:
+            case VOLATILE_DURABILITY_QOS: return fastrtps::rtps::VOLATILE;
+            case TRANSIENT_LOCAL_DURABILITY_QOS: return fastrtps::rtps::TRANSIENT_LOCAL;
+            case TRANSIENT_DURABILITY_QOS: return fastrtps::rtps::TRANSIENT;
+            case PERSISTENT_DURABILITY_QOS: return fastrtps::rtps::PERSISTENT;
+        }
+    }
+
+    bool operator ==(
+            const DurabilityQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    /**
+     * Set kind passing the rtps layer equivalent kind
+     * @param new_kind fastrtps::rtps::DurabilityKind_t
+     */
+    inline void durabilityKind(
+            const fastrtps::rtps::DurabilityKind_t new_kind)
+    {
+        switch (new_kind)
+        {
+            default:
+            case fastrtps::rtps::VOLATILE: kind = VOLATILE_DURABILITY_QOS; break;
+            case fastrtps::rtps::TRANSIENT_LOCAL: kind = TRANSIENT_LOCAL_DURABILITY_QOS; break;
+            case fastrtps::rtps::TRANSIENT: kind = TRANSIENT_DURABILITY_QOS; break;
+            case fastrtps::rtps::PERSISTENT: kind = PERSISTENT_DURABILITY_QOS; break;
+        }
+
+    }
+
+    inline void clear() override
+    {
+        DurabilityQosPolicy reset = DurabilityQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    /**
+     * @brief DurabilityQosPolicyKind. <br>
+     * By default the value for DataReaders: VOLATILE_DURABILITY_QOS, for DataWriters TRANSIENT_LOCAL_DURABILITY_QOS
+     */
+    DurabilityQosPolicyKind_t kind;
+};
+
+/**
+ * @brief DataReader expects a new sample updating the value of each instance at least once every deadline period.
+ * DataWriter indicates that the application commits to write a new value (using the DataWriter) for each instance managed
+ * by the DataWriter at least once every deadline period.
+ * @note Mutable Qos Policy
+ */
+class DeadlineQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DeadlineQosPolicy()
+        : Parameter_t(PID_DEADLINE, PARAMETER_TIME_LENGTH)
+        , QosPolicy(true)
+        , period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DeadlineQosPolicy() = default;
+
+    bool operator ==(
+            const DeadlineQosPolicy& b) const
+    {
+        return (this->period == b.period) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        DeadlineQosPolicy reset = DeadlineQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    /**
+     * @brief Maximum time expected between samples.
+     * It is inconsistent for a DataReader to have a DEADLINE period less than its TimeBasedFilterQosPolicy
+     * minimum_separation. <br>
+     * By default, c_TimeInifinite.
+     */
+    fastrtps::Duration_t period;
+};
+
+/**
+ * Specifies the maximum acceptable delay from the time the data is written until the data is inserted in the receiver's
+ * application-cache and the receiving application is notified of the fact.This policy is a hint to the Service, not something
+ * that must be monitored or enforced. The Service is not required to track or alert the user of any violation.
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Mutable Qos Policy
+ */
+class LatencyBudgetQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI LatencyBudgetQosPolicy()
+        : Parameter_t(PID_LATENCY_BUDGET, PARAMETER_TIME_LENGTH)
+        , QosPolicy(true)
+        , duration(0, 0)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~LatencyBudgetQosPolicy() = default;
+
+    bool operator ==(
+            const LatencyBudgetQosPolicy& b) const
+    {
+        return (this->duration == b.duration) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        LatencyBudgetQosPolicy reset = LatencyBudgetQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //!Maximum acceptable delay from the time data is written until it is received. <br> By default, c_TimeZero.
+    fastrtps::Duration_t duration;
+};
+
+/**
+ * Enum LivelinessQosPolicyKind, different kinds of liveliness for LivelinessQosPolicy
+ */
+typedef enum LivelinessQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * The infrastructure will automatically signal liveliness for the DataWriters at least as often as required by the lease_duration.
+     */
+    AUTOMATIC_LIVELINESS_QOS,
+    /**
+     * The Service will assume that as long as at least one Entity within the DomainParticipant has asserted its liveliness the other
+     * Entities in that same DomainParticipant are also alive.
+     */
+    MANUAL_BY_PARTICIPANT_LIVELINESS_QOS,
+    /**
+     * The Service will only assume liveliness of the DataWriter if the application has asserted liveliness of that DataWriter itself.
+     */
+    MANUAL_BY_TOPIC_LIVELINESS_QOS
+
+} LivelinessQosPolicyKind;
+
+/**
+ * Determines the mechanism and parameters used by the application to determine whether an Entity is “active” (alive).
+ * The “liveliness” status of an Entity is used to maintain instance ownership in combination with the setting of the
+ * OwnershipQosPolicy.
+ * The application is also informed via listener when an Entity is no longer alive.
+ *
+ * The DataReader requests that liveliness of the writers is maintained by the requested means and loss of liveliness is
+ * detected with delay not to exceed the lease_duration.
+ *
+ * The DataWriter commits to signaling its liveliness using the stated means at intervals not to exceed the lease_duration.
+ * Listeners are used to notify the DataReaderof loss of liveliness and DataWriter of violations to the liveliness contract.
+ */
+class LivelinessQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI LivelinessQosPolicy()
+        : Parameter_t(PID_LIVELINESS, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
+        , QosPolicy(true)
+        , kind(AUTOMATIC_LIVELINESS_QOS)
+        , lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+        , announcement_period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~LivelinessQosPolicy() = default;
+
+    bool operator ==(
+            const LivelinessQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               (this->lease_duration == b.lease_duration) &&
+               (this->announcement_period == b.announcement_period) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        LivelinessQosPolicy reset = LivelinessQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //! Liveliness kind <br> By default, AUTOMATIC_LIVELINESS.
+    LivelinessQosPolicyKind kind;
+    //! Period within which liveliness should be asserted.
+    //! On a DataWriter it represents the period it commits to signal its liveliness.
+    //! On a DataReader it represents the period without assertion after which a DataWriter is considered
+    //! inactive.
+    //! By default, c_TimeInfinite.
+    fastrtps::Duration_t lease_duration;
+    //! The period for automatic assertion of liveliness.
+    //! Only used for DataWriters with AUTOMATIC liveliness.
+    //! By default, c_TimeInfinite.
+    //! @warning When not infinite, must be < lease_duration, and it is advisable to be less than 0.7*lease_duration.
+    fastrtps::Duration_t announcement_period;
+};
+
+/**
+ * Enum ReliabilityQosPolicyKind, different kinds of reliability for ReliabilityQosPolicy.
+ */
+typedef enum ReliabilityQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * Indicates that it is acceptable to not retry propagation of any samples. Presumably new values for the samples
+     * are generated often enough that it is not necessary to re-send or acknowledge any samples
+     */
+    BEST_EFFORT_RELIABILITY_QOS = 0x01,
+    /**
+     * Specifies the Service will attempt to deliver all samples in its history. Missed samples may be retried.
+     * In steady-state (no modifications communicated via the DataWriter) the middleware guarantees that all samples
+     * in the DataWriter history will eventually be delivered to all the DataReader objects. Outside steady state the
+     * HistoryQosPolicy and ResourceLimitsQosPolicy will determine how samples become part of the history and whether
+     * samples can be discarded from it.
+     */
+    RELIABLE_RELIABILITY_QOS = 0x02
+} ReliabilityQosPolicyKind;
+
+/**
+ * Indicates the reliability of the endpoint.
+ * @note Immutable Qos Policy
+ */
+class ReliabilityQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI ReliabilityQosPolicy()
+        : Parameter_t(PID_RELIABILITY, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
+        , QosPolicy(true) //indicate send always
+        , kind(BEST_EFFORT_RELIABILITY_QOS)
+        , max_blocking_time{0, 100000000} // max_blocking_time = 100ms
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~ReliabilityQosPolicy() = default;
+
+    bool operator ==(
+            const ReliabilityQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               (this->max_blocking_time == b.max_blocking_time) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        ReliabilityQosPolicy reset = ReliabilityQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    /*!
+     * @brief Defines the reliability kind of the endpoint. <br>
+     * By default, BEST_EFFORT_RELIABILITY_QOS for DataReaders and RELIABLE_RELIABILITY_QOS for DataWriters.
+     */
+    ReliabilityQosPolicyKind kind;
+
+    /*!
+     * @brief Defines the maximum period of time certain methods will be blocked.
+     *
+     * Methods affected by this property are:
+     * - DataWriter::write
+     * - DataReader::takeNextData
+     * - DataReader::readNextData
+     * <br>
+     * By default, 100 ms.
+     */
+    fastrtps::Duration_t max_blocking_time;
+};
+
+
+
+/**
+ * Enum OwnershipQosPolicyKind, different kinds of ownership for OwnershipQosPolicy.
+ */
+enum OwnershipQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * Indicates shared ownership for each instance. Multiple writers are allowed to update the same instance and all the
+     * updates are made available to the readers. In other words there is no concept of an “owner” for the instances.
+     */
+    SHARED_OWNERSHIP_QOS,
+    /**
+     * Indicates each instance can only be owned by one DataWriter, but the owner of an instance can change dynamically.
+     * The selection of the owner is controlled by the setting of the OwnershipStrengthQosPolicy. The owner is always set
+     * to be the highest-strength DataWriter object among the ones currently “active” (as determined by the LivelinessQosPolicy).
+     */
+    EXCLUSIVE_OWNERSHIP_QOS
+};
+
+/**
+ * Specifies whether it is allowed for multiple DataWriters to write the same instance of the data and if so, how these
+ * modifications should be arbitrated
+ * @note Immutable Qos Policy
+ */
+class OwnershipQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI OwnershipQosPolicy()
+        : Parameter_t(PID_OWNERSHIP, PARAMETER_KIND_LENGTH)
+        , QosPolicy(true)
+        , kind(SHARED_OWNERSHIP_QOS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~OwnershipQosPolicy() = default;
+
+    bool operator ==(
+            const OwnershipQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        OwnershipQosPolicy reset = OwnershipQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //!OwnershipQosPolicyKind
+    OwnershipQosPolicyKind kind;
+};
+
+/**
+ * Enum DestinationOrderQosPolicyKind, different kinds of destination order for DestinationOrderQosPolicy.
+ */
+enum DestinationOrderQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * Indicates that data is ordered based on the reception time at each Subscriber. Since each subscriber may receive
+     * the data at different times there is no guaranteed that the changes will be seen in the same order. Consequently,
+     * it is possible for each subscriber to end up with a different final value for the data.
+     */
+    BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS,
+    /**
+     * Indicates that data is ordered based on a timestamp placed at the source (by the Service or by the application).
+     * In any case this guarantees a consistent final value for the data in all subscribers.
+     */
+    BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS
+};
+
+
+
+/**
+ * Controls the criteria used to determine the logical order among changes made by Publisher entities to the same instance of
+ * data (i.e., matching Topic and key).
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Immutable Qos Policy
+ */
+class DestinationOrderQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DestinationOrderQosPolicy()
+        : Parameter_t(PID_DESTINATION_ORDER, PARAMETER_KIND_LENGTH)
+        , QosPolicy(true)
+        , kind(BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DestinationOrderQosPolicy() = default;
+
+    bool operator ==(
+            const DestinationOrderQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        DestinationOrderQosPolicy reset = DestinationOrderQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //!DestinationOrderQosPolicyKind. <br> By default, BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS.
+    DestinationOrderQosPolicyKind kind;
+};
+
+
+/**
+ * Class GenericDataQosPolicy, base class to transmit user data during the discovery phase.
+ */
+class GenericDataQosPolicy : public Parameter_t, public QosPolicy,
+    public fastrtps::ResourceLimitedVector<fastrtps::rtps::octet>
+{
+    using ResourceLimitedOctetVector = fastrtps::ResourceLimitedVector<fastrtps::rtps::octet>;
+
+public:
+
+    RTPS_DllAPI GenericDataQosPolicy(
+            ParameterId_t pid)
+        : Parameter_t(pid, 0)
+        , QosPolicy(false)
+        , ResourceLimitedOctetVector()
+    {
+    }
+
+    RTPS_DllAPI GenericDataQosPolicy(
+            ParameterId_t pid,
+            uint16_t in_length)
+        : Parameter_t(pid, in_length)
+        , QosPolicy(false)
+        , ResourceLimitedOctetVector()
+    {
+    }
+
+    /**
+     * Construct from another GenericDataQosPolicy.
+     *
+     * The resulting GenericDataQosPolicy will have the same size limits
+     * as the input attribute
+     *
+     * @param data data to copy in the newly created object
+     */
+    RTPS_DllAPI GenericDataQosPolicy(
+            const GenericDataQosPolicy& data)
+        : Parameter_t(data.Pid, data.length)
+        , QosPolicy(false)
+        , ResourceLimitedOctetVector(data)
+    {
+    }
+
+    /**
+     * Construct from underlying collection type.
+     *
+     * Useful to easy integration on old APIs where a traditional container was used.
+     * The resulting GenericDataQosPolicy will always be unlimited in size
+     *
+     * @param pid Id of the parameter
+     * @param data data to copy in the newly created object
+     */
+    RTPS_DllAPI GenericDataQosPolicy(
+            ParameterId_t pid,
+            const collection_type& data)
+        : Parameter_t(pid, 0)
+        , QosPolicy(false)
+        , ResourceLimitedOctetVector()
+    {
+        assign(data.begin(), data.end());
+        length = (size() + 7) & ~3;
+    }
+
+    virtual RTPS_DllAPI ~GenericDataQosPolicy() = default;
+
+    /**
+     * Copies data from underlying collection type.
+     *
+     * Useful to easy integration on old APIs where a traditional container was used.
+     * The resulting GenericDataQosPolicy will keep the current size limit.
+     * If the input data is larger than the current limit size, the elements exceeding
+     * that maximum will be silently discarded.
+     *
+     * @param b object to be copied
+     * @return reference to the current object.
+     */
+    GenericDataQosPolicy& operator =(
+            const collection_type& b)
+    {
+        if (collection_ != b)
+        {
+            //If the object is size limited, already has max_size() allocated
+            //assign() will always stop copying when reaching max_size()
+            assign(b.begin(), b.end());
+            length = (size() + 7) & ~3;
+            hasChanged = true;
+        }
+        return *this;
+    }
+
+    /**
+     * Copies another GenericDataQosPolicy.
+     *
+     * The resulting GenericDataQosPolicy will have the same size limit
+     * as the input parameter, so all data in the input will be copied.
+     *
+     * @param b object to be copied
+     * @return reference to the current object.
+     */
+    GenericDataQosPolicy& operator =(
+            const GenericDataQosPolicy& b)
+    {
+        QosPolicy::operator =(b);
+        Parameter_t::operator =(b);
+        configuration_ = b.configuration_;
+        collection_.reserve(b.collection_.capacity());
+        collection_.assign(b.collection_.begin(), b.collection_.end());
+        return *this;
+    }
+
+    bool operator ==(
+            const GenericDataQosPolicy& b) const
+    {
+        return collection_ == b.collection_ &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    bool operator ==(
+            const collection_type& b) const
+    {
+        return collection_ == b;
+    }
+
+    /**
+     * Set the maximum size of the user data and reserves memory for that much.
+     * @param size new maximum size of the user data. Zero for unlimited size
+     */
+    void set_max_size (
+            size_t size)
+    {
+        if (size > 0)
+        {
+            configuration_ = fastrtps::ResourceLimitedContainerConfig::fixed_size_configuration(size);
+            collection_.reserve(configuration_.maximum);
+        }
+        else
+        {
+            configuration_ = fastrtps::ResourceLimitedContainerConfig::dynamic_allocation_configuration();
+        }
+    }
+
+    void resize(
+            size_t new_size)
+    {
+        collection_.resize(new_size);
+    }
+
+    /**
+     * @return const reference to the internal raw data.
+     */
+    inline const collection_type& dataVec() const
+    {
+        return collection_;
+    }
+
+    inline void clear() override
+    {
+        ResourceLimitedOctetVector::clear();
+        hasChanged = false;
+    }
+
+    /**
+     * Returns raw data vector.
+     * @return raw data as vector of octets.
+     * */
+    RTPS_DllAPI inline const collection_type& data_vec() const
+    {
+        return collection_;
+    }
+
+    /**
+     * Returns raw data vector.
+     * @return raw data as vector of octets.
+     * */
+    RTPS_DllAPI inline collection_type& data_vec()
+    {
+        return collection_;
+    }
+
+    /**
+     * Sets raw data vector.
+     * @param vec raw data to set.
+     * */
+    RTPS_DllAPI inline void data_vec(
+            const collection_type& vec)
+    {
+        if (collection_ != vec)
+        {
+            assign(vec.begin(), vec.end());
+            length = (size() + 7) & ~3;
+            hasChanged = true;
+        }
+    }
+
+    /**
+     * Returns raw data vector.
+     * @return raw data as vector of octets.
+     * */
+    RTPS_DllAPI inline const collection_type& getValue() const
+    {
+        return collection_;
+    }
+
+    /**
+     * Sets raw data vector.
+     * @param vec raw data to set.
+     * */
+    RTPS_DllAPI inline void setValue(
+            const collection_type& vec)
+    {
+        data_vec(vec);
+    }
+
+};
+
+/**
+ * Class TClassName, base template for data qos policies.
+ * Data not known by the middleware, but distributed by means of built-in topics.
+ * By default, zero-sized sequence.
+ * @note Mutable Qos Policy
+ */
+#define TEMPLATE_DATA_QOS_POLICY(TClassName, TPid)                                     \
+    class TClassName : public GenericDataQosPolicy                                         \
+    {                                                                                      \
+public:                                                                                \
+                                                                                       \
+        RTPS_DllAPI TClassName()                                                           \
+            : GenericDataQosPolicy(TPid)                                                   \
+        {                                                                                  \
+        }                                                                                  \
+                                                                                       \
+        RTPS_DllAPI TClassName(                                                            \
+            uint16_t in_length)                                                        \
+            : GenericDataQosPolicy(TPid, in_length)                                        \
+        {                                                                                  \
+        }                                                                                  \
+                                                                                       \
+        /** \
+         * Construct from another TClassName. \
+         * \
+         * The resulting TClassName will have the same size limits \
+         * as the input attribute \
+         * \
+         * @param data data to copy in the newly created object \
+         */                                                                            \
+        RTPS_DllAPI TClassName(                                                            \
+            const TClassName &data) = default;                                         \
+                                                                                       \
+        /** \
+         * Construct from underlying collection type. \
+         * \
+         * Useful to easy integration on old APIs where a traditional container was used. \
+         * The resulting TClassName will always be unlimited in size \
+         * \
+         * @param data data to copy in the newly created object \
+         */                                                                            \
+        RTPS_DllAPI TClassName(                                                            \
+            const collection_type &data)                                               \
+            : GenericDataQosPolicy(TPid, data)                                             \
+        {                                                                                  \
+        }                                                                                  \
+                                                                                       \
+        virtual RTPS_DllAPI ~TClassName() = default;                                       \
+                                                                                       \
+        /** \
+         * Copies another TClassName. \
+         * \
+         * The resulting TClassName will have the same size limit \
+         * as the input parameter, so all data in the input will be copied. \
+         * \
+         * @param b object to be copied \
+         * @return reference to the current object. \
+         */                                                                            \
+        TClassName& operator =(                                                            \
+            const TClassName &b) = default;                                            \
+                                                                                       \
+    };
+
+//Variable used to generate the doxygen documentation for this QoS Policies
+#ifdef DOXYGEN_DOCUMENTATION
+/**
+ * @brief Class derived from GenericDataQosPolicy
+ *
+ * The purpose of this QoS is to allow the application to attach additional information to the created
+ * Entity objects such that when a remote application discovers their existence it can access that information and
+ * use it for its own purposes.
+ *
+ * One possible use of this QoS is to attach security credentials or some other information that can be used by the
+ * remote application to authenticate the source.
+ */
+class UserDataQosPolicy : public GenericDataQosPolicy
+{
+};
+/**
+ * @brief Class derived from GenericDataQosPolicy
+ *
+ * The purpose of this QoS is to allow the application to attach additional information to the created Topic
+ * such that when a remote application discovers their existence it can examine the information and use it in an
+ * application-defined way.
+ *
+ * In combination with the listeners on the DataReader and DataWriter as well as by means of operations such as
+ * ignore_topic,these QoS can assist an application to extend the provided QoS.
+ */
+class TopicDataQosPolicy : public GenericDataQosPolicy
+{
+};
+/**
+ * @brief Class derived from GenericDataQosPolicy
+ *
+ * The purpose of this QoS is to allow the application to attach additional information to the created
+ * Publisher or Subscriber. The value of the GROUP_DATA is available to the application on the DataReader and
+ * DataWriter entities and is propagated by means of the built-in topics.
+ *
+ * This QoS can be used by an application combination with the DataReaderListener and DataWriterListener to
+ * implement matching policies similar to those of the PARTITION QoS except the decision can be made based on an
+ * application-defined policy.
+ */
+class GroupDataQosPolicy : public GenericDataQosPolicy
+{
+};
+#endif
+
+TEMPLATE_DATA_QOS_POLICY(UserDataQosPolicy, PID_USER_DATA)
+TEMPLATE_DATA_QOS_POLICY(TopicDataQosPolicy, PID_TOPIC_DATA)
+TEMPLATE_DATA_QOS_POLICY(GroupDataQosPolicy, PID_GROUP_DATA)
+
+/**
+ * Filter that allows a DataReader to specify that it is interested only in (potentially) a subset of the values of the data.
+ * The filter states that the DataReader does not want to receive more than one value each minimum_separation, regardless
+ * of how fast the changes occur. It is inconsistent for a DataReader to have a minimum_separation longer than its
+ * Deadline period.
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Mutable Qos Policy
+ */
+class TimeBasedFilterQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TimeBasedFilterQosPolicy()
+        : Parameter_t(PID_TIME_BASED_FILTER, PARAMETER_TIME_LENGTH)
+        , QosPolicy(false)
+        , minimum_separation(0, 0)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TimeBasedFilterQosPolicy() = default;
+
+    bool operator ==(
+            const TimeBasedFilterQosPolicy& b) const
+    {
+        return (this->minimum_separation == b.minimum_separation) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        TimeBasedFilterQosPolicy reset = TimeBasedFilterQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //! Minimum interval between samples. By default, c_TimeZero (the DataReader is interested in all values)
+    fastrtps::Duration_t minimum_separation;
+};
+
+/**
+ * Enum PresentationQosPolicyAccessScopeKind, different kinds of Presentation Policy order for PresentationQosPolicy.
+ */
+enum PresentationQosPolicyAccessScopeKind : fastrtps::rtps::octet
+{
+    /**
+     * Scope spans only a single instance. Indicates that changes to one instance need not be coherent nor ordered with
+     * respect to changes to any other instance. In other words, order and coherent changes apply to each instance
+     * separately.
+     */
+    INSTANCE_PRESENTATION_QOS,
+    /**
+     * Scope spans to all instances within the same DataWriter (or DataReader), but not across instances in different
+     * DataWriter (or DataReader).
+     */
+    TOPIC_PRESENTATION_QOS,
+    /**
+     * Scope spans to all instances belonging to DataWriter (or DataReader) entities within the same Publisher (or Subscriber).
+     */
+    GROUP_PRESENTATION_QOS
+};
+
+#define PARAMETER_PRESENTATION_LENGTH 8
+
+/**
+ * Specifies how the samples representing changes to data instances are presented to the subscribing application.
+ * This policy affects the application’s ability to specify and receive coherent changes and to see the relative
+ * order of changes.access_scope determines the largest scope spanning the entities for which the order and coherency
+ * of changes can be preserved. The two booleans control whether coherent access and ordered access are supported within
+ * the scope access_scope.
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Immutable Qos Policy
+ */
+class PresentationQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor without parameters
+     */
+    RTPS_DllAPI PresentationQosPolicy()
+        : Parameter_t(PID_PRESENTATION, PARAMETER_PRESENTATION_LENGTH)
+        , QosPolicy(false)
+        , access_scope(INSTANCE_PRESENTATION_QOS)
+        , coherent_access(false)
+        , ordered_access(false)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~PresentationQosPolicy() = default;
+
+    bool operator ==(
+            const PresentationQosPolicy& b) const
+    {
+        return (this->access_scope == b.access_scope) &&
+               (this->coherent_access == b.coherent_access) &&
+               (this->ordered_access == b.ordered_access) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        PresentationQosPolicy reset = PresentationQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //!Access Scope Kind <br> By default, INSTANCE_PRESENTATION_QOS.
+    PresentationQosPolicyAccessScopeKind access_scope;
+    /**
+     * @brief Specifies support coherent access. That is, the ability to group a set of changes as a unit
+     * on the publishing end such that they are received as a unit at the subscribing end.
+     * by default, false.
+     */
+    bool coherent_access;
+    /**
+     * @brief Specifies support for ordered access to the samples received at the subscription end. That is,
+     * the ability of the subscriber to see changes in the same order as they occurred on the publishing end.
+     * By default, false.
+     */
+    bool ordered_access;
+};
+
+
+class Partition_t
+{
+
+    friend class PartitionQosPolicy;
+
+private:
+
+    const char* partition_;
+
+private:
+
+    Partition_t()
+    {
+        partition_ = nullptr;
+    }
+
+public:
+
+    /**
+     * @brief Constructor using a pointer
+     * @param ptr Pointer to be set
+     */
+    explicit Partition_t(
+            const void* ptr)
+    {
+        partition_ = (char*)ptr;
+    }
+
+    bool operator ==(
+            const Partition_t& rhs) const
+    {
+        return (size() == rhs.size() &&
+               (size() == 0 || strcmp(partition_ + 4, rhs.partition_ + 4)));
+    }
+
+    bool operator !=(
+            const Partition_t& rhs) const
+    {
+        return !(*this == rhs);
+    }
+
+    /**
+     * @brief Getter for the size
+     * @return uint32_t with the size
+     */
+    uint32_t size() const
+    {
+        return *(uint32_t*)partition_;
+    }
+
+    /**
+     * @brief Getter for the partition name
+     * @return name
+     */
+    const char* name() const
+    {
+        return partition_ + 4;
+    }
+
+};
+
+/**
+ * Set of strings that introduces a logical partition among the topics visible by the Publisher and Subscriber.
+ * A DataWriter within a Publisher only communicates with a DataReader in a Subscriber if (in addition to matching the
+ * Topic and having compatible QoS) the Publisher and Subscriber have a common partition name string.
+ *
+ * The empty string ("") is considered a valid partition that is matched with other partition names using the same rules of
+ * string matching and regular-expression matching used for any other partition name.
+ * @note Mutable Qos Policy
+ */
+class PartitionQosPolicy : public Parameter_t, public QosPolicy
+{
+    friend class fastrtps::rtps::EDP;
+
+public:
+
+    class const_iterator
+    {
+public:
+
+        typedef const_iterator self_type;
+        typedef const Partition_t value_type;
+        typedef const Partition_t reference;
+        typedef const Partition_t* pointer;
+        typedef size_t difference_type;
+        typedef std::forward_iterator_tag iterator_category;
+
+        /**
+         * @brief Constructor using a pointer
+         * @param ptr Pointer to be set
+         */
+        const_iterator(
+                const fastrtps::rtps::octet* ptr)
+            : ptr_(ptr)
+            , value_ (ptr_)
+        {
+        }
+
+        self_type operator ++()
+        {
+            self_type tmp = *this;
+            advance();
+            return tmp;
+        }
+
+        self_type operator ++(
+                int)
+        {
+            advance();
+            return *this;
+        }
+
+        reference operator *()
+        {
+            return value_;
+        }
+
+        pointer operator ->()
+        {
+            return &value_;
+        }
+
+        bool operator ==(
+                const self_type& rhs)
+        {
+            return ptr_ == rhs.ptr_;
+        }
+
+        bool operator !=(
+                const self_type& rhs)
+        {
+            return ptr_ != rhs.ptr_;
+        }
+
+protected:
+
+        /**
+         * @brief Shift the pointer to the next element
+         */
+        void advance()
+        {
+            //Size of the element (with alignment)
+            uint32_t size = *(uint32_t*)ptr_;
+            ptr_ += (4 + ((size + 3) & ~3));
+            value_ = Partition_t(ptr_);
+        }
+
+private:
+
+        //!Pointer
+        const fastrtps::rtps::octet* ptr_;
+        //!Partition
+        Partition_t value_;
+
+    };
+
+public:
+
+    /**
+     * @brief Constructor without parameters
+     */
+    RTPS_DllAPI PartitionQosPolicy()
+        : Parameter_t(PID_PARTITION, 0)
+        , QosPolicy(false)
+        , max_size_ (0)
+        , Npartitions_ (0)
+    {
+    }
+
+    /**
+     * @brief Constructor using Parameter length
+     * @param in_length Length of the parameter
+     */
+    RTPS_DllAPI PartitionQosPolicy(
+            uint16_t in_length)
+        : Parameter_t(PID_PARTITION, in_length)
+        , QosPolicy(false)
+        , max_size_ (in_length)
+        , partitions_(in_length)
+        , Npartitions_ (0)
+    {
+    }
+
+    /**
+     * @brief Copy constructor
+     * @param b Another PartitionQosPolicy instance
+     */
+    RTPS_DllAPI PartitionQosPolicy(
+            const PartitionQosPolicy& b)
+        : Parameter_t(b)
+        , QosPolicy(b)
+        , max_size_ (b.max_size_)
+        , partitions_(b.max_size_ != 0 ?
+                b.partitions_.max_size :
+                b.partitions_.length)
+        , Npartitions_ (b.Npartitions_)
+    {
+        partitions_.copy(&b.partitions_, b.max_size_ != 0);
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~PartitionQosPolicy() = default;
+
+    bool operator ==(
+            const PartitionQosPolicy& b) const
+    {
+        return (this->max_size_ == b.max_size_) &&
+               (this->Npartitions_ == b.Npartitions_) &&
+               (this->partitions_ == b.partitions_) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    PartitionQosPolicy& operator =(
+            const PartitionQosPolicy& b)
+    {
+        QosPolicy::operator =(b);
+        Parameter_t::operator =(b);
+        max_size_ = b.max_size_;
+        partitions_.reserve(max_size_ != 0 ?
+                b.partitions_.max_size :
+                b.partitions_.length);
+        partitions_.copy(&b.partitions_, b.max_size_ != 0);
+        Npartitions_ = b.Npartitions_;
+
+        return *this;
+    }
+
+    /**
+     * @brief Getter for the first position of the partition list
+     * @return const_iterator
+     */
+    const_iterator begin() const
+    {
+        return const_iterator(partitions_.data);
+    }
+
+    /**
+     * @brief Getter for the end of the partition list
+     * @return const_iterator
+     */
+    const_iterator end() const
+    {
+        return const_iterator(partitions_.data + partitions_.length);
+    }
+
+    /**
+     * @brief Getter for the number of partitions
+     * @return uint32_t with the size
+     */
+    uint32_t size() const
+    {
+        return Npartitions_;
+    }
+
+    /**
+     * @brief Check if the set is empty
+     * @return true if it is empty, false otherwise
+     */
+    uint32_t empty() const
+    {
+        return Npartitions_ == 0;
+    }
+
+    /**
+     * @brief Setter for the maximum size
+     * @param size Size to be set
+     */
+    void set_max_size (
+            uint32_t size)
+    {
+        partitions_.reserve(size);
+        max_size_ = size;
+    }
+
+    /**
+     * @brief Getter for the maximum size
+     * @return uint32_t with the maximum size
+     */
+    uint32_t max_size () const
+    {
+        return max_size_;
+    }
+
+    /**
+     * Appends a name to the list of partition names.
+     * @param name Name to append.
+     */
+    RTPS_DllAPI inline void push_back(
+            const char* name)
+    {
+        //Realloc if needed;
+        uint32_t size = (uint32_t)strlen(name) + 1;
+        uint32_t alignment = ((size + 3) & ~3) - size;
+
+        if (max_size_ != 0 && (partitions_.max_size < partitions_.length +
+                size + alignment + 4))
+        {
+            return;
+        }
+
+        partitions_.reserve(partitions_.length + size + alignment + 4);
+
+        fastrtps::rtps::octet* o = (fastrtps::rtps::octet*)&size;
+        memcpy(partitions_.data + partitions_.length, o, 4);
+        partitions_.length += 4;
+
+        memcpy(partitions_.data + partitions_.length, name, size);
+        partitions_.length += size;
+
+        memset(partitions_.data + partitions_.length, 0, alignment);
+        partitions_.length += alignment;
+
+        ++Npartitions_;
+        hasChanged = true;
+    }
+
+    /**
+     * Clears list of partition names
+     */
+    RTPS_DllAPI inline void clear() override
+    {
+        partitions_.length = 0;
+        Npartitions_ = 0;
+        hasChanged = false;
+    }
+
+    /**
+     * Returns partition names.
+     * @return Vector of partition name strings.
+     */
+    RTPS_DllAPI inline const std::vector<std::string> getNames() const
+    {
+        return names();
+    }
+
+    /**
+     * Overrides partition names
+     * @param nam Vector of partition name strings.
+     */
+    RTPS_DllAPI inline void setNames(
+            std::vector<std::string>& nam)
+    {
+        names(nam);
+    }
+
+    /**
+     * Returns partition names.
+     * @return Vector of partition name strings.
+     */
+    RTPS_DllAPI inline const std::vector<std::string> names() const
+    {
+        std::vector<std::string> names;
+        if (Npartitions_ > 0)
+        {
+            for (auto it = begin(); it != end(); ++it)
+            {
+                names.push_back(it->name());
+            }
+        }
+        return names;
+    }
+
+    /**
+     * Overrides partition names
+     * @param nam Vector of partition name strings.
+     */
+    RTPS_DllAPI inline void names(
+            std::vector<std::string>& nam)
+    {
+        clear();
+        for (auto it = nam.begin(); it != nam.end(); ++it)
+        {
+            push_back(it->c_str());
+        }
+        hasChanged = true;
+    }
+
+private:
+
+    //! Maximum size <br> By default, 0.
+    uint32_t max_size_;
+    //! Partitions
+    fastrtps::rtps::SerializedPayload_t partitions_;
+    //! Number of partitions. <br> By default, 0.
+    uint32_t Npartitions_;
+};
+
+/**
+ * Enum HistoryQosPolicyKind, different kinds of History Qos for HistoryQosPolicy.
+ */
+enum HistoryQosPolicyKind : fastrtps::rtps::octet
+{
+    /**
+     * On the publishing side, the Service will only attempt to keep the most recent “depth” samples of each instance
+     * of data (identified by its key) managed by the DataWriter. On the subscribing side, the DataReader will only attempt
+     * to keep the most recent “depth” samples received for each instance (identified by its key) until the application
+     * “takes” them via the DataReader’s take operation.
+     */
+    KEEP_LAST_HISTORY_QOS,
+    /**
+     * On the publishing side, the Service will attempt to keep all samples (representing each value written) of each
+     * instance of data (identified by its key) managed by the DataWriter until they can be delivered to all subscribers.
+     * On the subscribing side, the Service will attempt to keep all samples of each instance of data (identified by its
+     * key) managed by the DataReader. These samples are kept until the application “takes” them from the Service via the
+     * take operation.
+     */
+    KEEP_ALL_HISTORY_QOS
+};
+
+/**
+ * Specifies the behavior of the Service in the case where the value of a sample changes (one or more times) before it
+ * can be successfully communicated to one or more existing subscribers. This QoS policy controls whether the Service
+ * should deliver only the most recent value, attempt to deliver all intermediate values, or do something in between.
+ * On the publishing side this policy controls the samples that should be maintained by the DataWriter on behalf of
+ * existing DataReader entities. The behavior with regards to a DataReaderentities discovered after a sample is written
+ * is controlled by the DURABILITY QoS policy. On the subscribing side it controls the samples that should be maintained
+ * until the application “takes” them from the Service.
+ * @note Immutable Qos Policy
+ */
+class HistoryQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI HistoryQosPolicy()
+        : Parameter_t(PID_HISTORY, PARAMETER_KIND_LENGTH + 4)
+        , QosPolicy(true)
+        , kind(KEEP_LAST_HISTORY_QOS)
+        , depth(1)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~HistoryQosPolicy() = default;
+
+    bool operator ==(
+            const HistoryQosPolicy& b) const
+    {
+        return (this->kind == b.kind) &&
+               (this->depth == b.depth) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        HistoryQosPolicy reset = HistoryQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //!HistoryQosPolicyKind. <br> By default, KEEP_LAST_HISTORY_QOS.
+    HistoryQosPolicyKind kind;
+    //!History depth. <br> By default, 1. If a value other than 1 is specified, it should
+    //! be consistent with the settings of the ResourceLimitsQosPolicy.
+    //! @warning Only takes effect if the kind is KEEP_LAST_HISTORY_QOS.
+    int32_t depth;
+};
+
+/**
+ * Specifies the resources that the Service can consume in order to meet the requested QoS
+ * @note Immutable Qos Policy
+ */
+class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Specifies the maximum number of data-samples the DataWriter (or DataReader) can manage across all the
+     * instances associated with it. Represents the maximum samples the middleware can store for any one DataWriter
+     * (or DataReader). <br>
+     * By default, 5000.
+     * @warning It is inconsistent for this value to be less than max_samples_per_instance.
+     */
+    int32_t max_samples;
+    /**
+     * @brief Represents the maximum number of instances DataWriter (or DataReader) can manage. <br>
+     * By default, 10.
+     */
+    int32_t max_instances;
+    /**
+     * @brief Represents the maximum number of samples of any one instance a DataWriter(or DataReader) can manage. <br>
+     * By default, 400.
+     * @warning It is inconsistent for this value to be greater than max_samples.
+     */
+    int32_t max_samples_per_instance;
+    /**
+     * @brief Number of samples currently allocated. <br>
+     * By default, 100.
+     */
+    int32_t allocated_samples;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI ResourceLimitsQosPolicy()
+        : Parameter_t(PID_RESOURCE_LIMITS, 4 + 4 + 4)
+        , QosPolicy(false)
+        , max_samples(5000)
+        , max_instances(10)
+        , max_samples_per_instance(400)
+        , allocated_samples(100)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~ResourceLimitsQosPolicy() = default;
+
+    bool operator ==(
+            const ResourceLimitsQosPolicy& b) const
+    {
+        return (this->max_samples == b.max_samples) &&
+               (this->max_instances == b.max_instances) &&
+               (this->max_samples_per_instance == b.max_samples_per_instance) &&
+               (this->allocated_samples == b.allocated_samples) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        ResourceLimitsQosPolicy reset = ResourceLimitsQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+
+
+/**
+ * Specifies the configuration of the durability service. That is, the service that implements the DurabilityQosPolicy kind
+ * of TRANSIENT and PERSISTENT.
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Immutable Qos Policy
+ */
+class DurabilityServiceQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DurabilityServiceQosPolicy()
+        : Parameter_t(PID_DURABILITY_SERVICE, PARAMETER_TIME_LENGTH + PARAMETER_KIND_LENGTH + 4 + 4 + 4 + 4)
+        , QosPolicy(false)
+        , history_kind(KEEP_LAST_HISTORY_QOS)
+        , history_depth(1)
+        , max_samples(-1)
+        , max_instances(-1)
+        , max_samples_per_instance(-1)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DurabilityServiceQosPolicy() = default;
+
+    bool operator ==(
+            const DurabilityServiceQosPolicy& b) const
+    {
+        return (this->history_kind == b.history_kind) &&
+               (this->history_depth == b.history_depth) &&
+               (this->max_samples == b.max_samples) &&
+               (this->max_instances == b.max_instances) &&
+               (this->max_samples_per_instance == b.max_samples_per_instance) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        DurabilityServiceQosPolicy reset = DurabilityServiceQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    /**
+     * @brief Control when the service is able to remove all information regarding a data-instance. <br>
+     * By default, c_TimeZero.
+     */
+    fastrtps::Duration_t service_cleanup_delay;
+    /**
+     * @brief Controls the HistoryQosPolicy of the fictitious DataReader that stores the data within the durability service.
+     * <br>
+     * By default, KEEP_LAST_HISTORY_QOS.
+     */
+    HistoryQosPolicyKind history_kind;
+    /**
+     * @brief Number of most recent values that should be maintained on the History. It only have effect if the history_kind
+     * is KEEP_LAST_HISTORY_QOS. <br>
+     * By default, 1.
+     */
+    int32_t history_depth;
+    /**
+     * @brief Control the ResourceLimitsQos of the implied DataReader that stores the data within the durability service.
+     * Specifies the maximum number of data-samples the DataWriter (or DataReader) can manage across all the instances
+     * associated with it. Represents the maximum samples the middleware can store for any one DataWriter (or DataReader).
+     * It is inconsistent for this value to be less than max_samples_per_instance. <br>
+     * By default, -1 (Length Unlimited).
+     */
+    int32_t max_samples;
+    /**
+     * @brief Control the ResourceLimitsQos of the implied DataReader that stores the data within the durability service.
+     * Represents the maximum number of instances DataWriter (or DataReader) can manage. <br>
+     * By default, -1 (Length Unlimited).
+     */
+    int32_t max_instances;
+    /**
+     * @brief Control the ResourceLimitsQos of the implied DataReader that stores the data within the durability service.
+     * Represents the maximum number of samples of any one instance a DataWriter(or DataReader) can manage.
+     * It is inconsistent for this value to be greater than max_samples. <br>
+     * By default, -1 (Length Unlimited).
+     */
+    int32_t max_samples_per_instance;
+};
+
+/**
+ * Specifies the maximum duration of validity of the data written by the DataWriter.
+ * @note Mutable Qos Policy
+ */
+class LifespanQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI LifespanQosPolicy()
+        : Parameter_t(PID_LIFESPAN, PARAMETER_TIME_LENGTH)
+        , QosPolicy(true)
+        , duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~LifespanQosPolicy() = default;
+
+    bool operator ==(
+            const LifespanQosPolicy& b) const
+    {
+        return (this->duration == b.duration) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        LifespanQosPolicy reset = LifespanQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //! Period of validity. <br> By default, c_TimeInfinite.
+    fastrtps::Duration_t duration;
+};
+
+/**
+ * Specifies the value of the “strength” used to arbitrate among multiple DataWriter objects that attempt to modify the same
+ * instance of a data-object (identified by Topic + key).This policy only applies if the OWNERSHIP QoS policy is of kind
+ * EXCLUSIVE.
+ * @note Mutable Qos Policy
+ */
+class OwnershipStrengthQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI OwnershipStrengthQosPolicy()
+        : Parameter_t(PID_OWNERSHIP_STRENGTH, 4)
+        , QosPolicy(false)
+        , value(0)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~OwnershipStrengthQosPolicy() = default;
+
+    bool operator ==(
+            const OwnershipStrengthQosPolicy& b) const
+    {
+        return (this->value == b.value) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        OwnershipStrengthQosPolicy reset = OwnershipStrengthQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //! Strength <br> By default, 0.
+    uint32_t value;
+};
+
+
+/**
+ * This policy is a hint to the infrastructure as to how to set the priority of the underlying transport used to send the data.
+ * @warning This QosPolicy can be defined and is transmitted to the rest of the network but is not implemented in this version.
+ * @note Mutable Qos Policy
+ */
+class TransportPriorityQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!Priority <br> By default, 0.
+    uint32_t value;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TransportPriorityQosPolicy()
+        : Parameter_t(PID_TRANSPORT_PRIORITY, 4)
+        , QosPolicy(false)
+        , value(0)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TransportPriorityQosPolicy() = default;
+
+    bool operator ==(
+            const TransportPriorityQosPolicy& b) const
+    {
+        return (this->value == b.value) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        TransportPriorityQosPolicy reset = TransportPriorityQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+/**
+ * Enum PublishModeQosPolicyKind, different kinds of publication synchronism
+ */
+typedef enum PublishModeQosPolicyKind : fastrtps::rtps::octet
+{
+    SYNCHRONOUS_PUBLISH_MODE,    //!< Synchronous publication mode (default for writers).
+    ASYNCHRONOUS_PUBLISH_MODE    //!< Asynchronous publication mode.
+} PublishModeQosPolicyKind_t;
+
+/**
+ * Class PublishModeQosPolicy, defines the publication mode for a specific writer.
+ */
+class PublishModeQosPolicy : public QosPolicy
+{
+public:
+
+    //!PublishModeQosPolicyKind <br> By default, SYNCHRONOUS_PUBLISH_MODE.
+    PublishModeQosPolicyKind kind;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI PublishModeQosPolicy()
+        : kind(SYNCHRONOUS_PUBLISH_MODE)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~PublishModeQosPolicy() = default;
+
+    inline void clear() override
+    {
+        PublishModeQosPolicy reset = PublishModeQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+/**
+ * Enum DataRepresentationId, different kinds of topic data representation
+ */
+typedef enum DataRepresentationId : int16_t
+{
+    XCDR_DATA_REPRESENTATION = 0,   //!< Extended CDR Encoding version 1
+    XML_DATA_REPRESENTATION = 1,    //!< XML Data Representation (Unsupported)
+    XCDR2_DATA_REPRESENTATION = 2    //!< Extended CDR Encoding version 2
+} DataRepresentationId_t;
+
+/**
+ * With multiple standard data Representations available, and vendor-specific extensions possible, DataWriters and
+ * DataReaders must be able to negotiate which data representation(s) to use. This negotiation shall occur based on
+ * DataRepresentationQosPolicy.
+ * @warning If a writer’s offered representation is contained within a reader’s sequence, the offer satisfies the
+ * request and the policies are compatible. Otherwise, they are incompatible.
+ * @note Immutable Qos Policy
+ */
+class DataRepresentationQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!List of DataRepresentationId. <br> By default, empty list.
+    std::vector<DataRepresentationId_t> m_value;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DataRepresentationQosPolicy()
+        : Parameter_t(PID_DATA_REPRESENTATION, 0)
+        , QosPolicy(true)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DataRepresentationQosPolicy() override = default;
+
+    /**
+     * Compares the given policy to check if it's equal.
+     * @param b QoS Policy.
+     * @return True if the policy is equal.
+     */
+    bool operator ==(
+            const DataRepresentationQosPolicy& b) const
+    {
+        return (this->m_value == b.m_value) &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        DataRepresentationQosPolicy reset = DataRepresentationQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+enum TypeConsistencyKind : uint16_t
+{
+    /**
+     * The DataWriter and the DataReader must support the same data type in order for them to communicate.
+     */
+    DISALLOW_TYPE_COERCION,
+    /**
+     * The DataWriter and the DataReader need not support the same data type in order for them to communicate as long as
+     * the reader’s type is assignable from the writer’s type.
+     */
+    ALLOW_TYPE_COERCION
+};
+
+/**
+ * The TypeConsistencyEnforcementQosPolicy defines the rules for determining whether the type used to publish a given data
+ * stream is consistent with that used to subscribe to it. It applies to DataReaders.
+ * @note Immutable Qos Policy
+ */
+class TypeConsistencyEnforcementQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!TypeConsistencyKind. <br> By default, ALLOW_TYPE_COERCION.
+    TypeConsistencyKind m_kind;
+    /**
+     * @brief This option controls whether sequence bounds are taken into consideration for type assignability. If the
+     * option is set to TRUE, sequence bounds (maximum lengths) are not considered as part of the type assignability.
+     * This means that a T2 sequence type with maximum length L2 would be assignable to a T1 sequence type with maximum
+     * length L1, even if L2 is greater than L1. If the option is set to false, then sequence bounds are taken into
+     * consideration for type assignability and in order for T1 to be assignable from T2 it is required that L1>= L2. <br>
+     * By default, true.
+     */
+    bool m_ignore_sequence_bounds;
+    /**
+     * @brief This option controls whether string bounds are taken into consideration for type assignability. If the option
+     *  is set to TRUE, string bounds (maximum lengths) are not considered as part of the type assignability. This means
+     * that a T2 string type with maximum length L2 would be assignable to a T1 string type with maximum length L1, even
+     * if L2 is greater than L1. If the option is set to false, then string bounds are taken into consideration for type
+     * assignability and in order for T1 to be assignable from T2 it is required that L1>= L2. <br>
+     * By default, true.
+     */
+    bool m_ignore_string_bounds;
+    /**
+     * @brief This option controls whether member names are taken into consideration for type assignability. If the option
+     * is set to TRUE, member names are considered as part of assignability in addition to member IDs (so that members with
+     * the same ID also have the same name). If the option is set to FALSE, then member names are not ignored. <br>
+     * By default, false.
+     */
+    bool m_ignore_member_names;
+    /**
+     * @brief This option controls whether type widening is allowed. If the option is set to FALSE, type widening is
+     * permitted. If the option is set to TRUE,it shall cause a wider type to not be assignable to a narrower type. <br>
+     * By default, false.
+     */
+    bool m_prevent_type_widening;
+    /**
+     * @brief This option requires type information to be available in order to complete matching between a DataWriter and
+     * DataReader when set to TRUE, otherwise matching can occur without complete type information when set to FALSE. <br>
+     * By default, false.
+     */
+    bool m_force_type_validation;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TypeConsistencyEnforcementQosPolicy()
+        : Parameter_t(PID_TYPE_CONSISTENCY_ENFORCEMENT, 8) // 2 + 5 + 1 alignment byte
+        , QosPolicy(true)
+    {
+        m_kind = ALLOW_TYPE_COERCION;
+        m_ignore_sequence_bounds = true;
+        m_ignore_string_bounds = true;
+        m_ignore_member_names = false;
+        m_prevent_type_widening = false;
+        m_force_type_validation = false;
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TypeConsistencyEnforcementQosPolicy() override = default;
+
+    bool operator ==(
+            const TypeConsistencyEnforcementQosPolicy& b) const
+    {
+        return m_kind == b.m_kind &&
+               m_ignore_sequence_bounds == b.m_ignore_sequence_bounds &&
+               m_ignore_string_bounds == b.m_ignore_string_bounds &&
+               m_ignore_member_names == b.m_ignore_member_names &&
+               m_prevent_type_widening == b.m_prevent_type_widening &&
+               m_force_type_validation == b.m_force_type_validation &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        TypeConsistencyEnforcementQosPolicy reset = TypeConsistencyEnforcementQosPolicy();
+        std::swap(*this, reset);
+    }
+
+};
+
+/**
+ * Class DisablePositiveACKsQosPolicy to disable sending of positive ACKs
+ * @note Immutable Qos Policy
+ */
+class DisablePositiveACKsQosPolicy : public Parameter_t, public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DisablePositiveACKsQosPolicy()
+        : Parameter_t(PID_DISABLE_POSITIVE_ACKS, PARAMETER_BOOL_LENGTH)
+        , QosPolicy(true)
+        , enabled(false)
+        , duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~DisablePositiveACKsQosPolicy() = default;
+
+    bool operator ==(
+            const DisablePositiveACKsQosPolicy& b) const
+    {
+        return enabled == b.enabled &&
+               Parameter_t::operator ==(b) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        DisablePositiveACKsQosPolicy reset = DisablePositiveACKsQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    //! True if this QoS is enabled. <br> By default, false
+    bool enabled;
+    //! The duration to keep samples for (not serialized as not needed by reader). <br> By default, c_TimeInfinite
+    fastrtps::Duration_t duration;
+};
+
+/**
+ * Class TypeIdV1
+ */
+class TypeIdV1 : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!Type Identifier
+    fastrtps::types::TypeIdentifier m_type_identifier;
+
+
+    /**
+     * @brief Constructor without parameters
+     */
+    RTPS_DllAPI TypeIdV1()
+        : Parameter_t(PID_TYPE_IDV1, 0)
+        , QosPolicy(false)
+        , m_type_identifier()
+    {
+    }
+
+    /**
+     * @brief Copy constructor
+     * @param type Another instance of TypeIdV1
+     */
+    RTPS_DllAPI TypeIdV1(
+            const TypeIdV1& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , m_type_identifier(type.m_type_identifier)
+    {
+    }
+
+    /**
+     * @brief Constructor using a TypeIndentifier
+     * @param identifier TypeIdentifier to be set
+     */
+    RTPS_DllAPI TypeIdV1(
+            const fastrtps::types::TypeIdentifier& identifier)
+        : Parameter_t(PID_TYPE_IDV1, 0)
+        , QosPolicy(false)
+        , m_type_identifier(identifier)
+    {
+    }
+
+    /**
+     * @brief Move constructor
+     * @param type Another instance of TypeIdV1
+     */
+    RTPS_DllAPI TypeIdV1(
+            TypeIdV1&& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , m_type_identifier(std::move(type.m_type_identifier))
+    {
+    }
+
+    RTPS_DllAPI TypeIdV1& operator =(
+            const TypeIdV1& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        m_type_identifier = type.m_type_identifier;
+
+        return *this;
+    }
+
+    RTPS_DllAPI TypeIdV1& operator =(
+            TypeIdV1&& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        m_type_identifier = std::move(type.m_type_identifier);
+
+        return *this;
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TypeIdV1() override = default;
+
+    inline void clear() override
+    {
+        *this = TypeIdV1();
+    }
+
+    RTPS_DllAPI TypeIdV1& operator =(
+            const fastrtps::types::TypeIdentifier& type_id)
+    {
+        m_type_identifier = type_id;
+        return *this;
+    }
+
+    /**
+     * @brief Getter for the TypeIndentifier
+     * @return TypeIdentifier reference
+     */
+    RTPS_DllAPI const fastrtps::types::TypeIdentifier& get() const
+    {
+        return m_type_identifier;
+    }
+
+};
+
+/**
+ * Class TypeObjectV1
+ */
+class TypeObjectV1 : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!Type Object
+    fastrtps::types::TypeObject m_type_object;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TypeObjectV1()
+        : Parameter_t(PID_TYPE_OBJECTV1, 0)
+        , QosPolicy(false)
+        , m_type_object()
+    {
+    }
+
+    /**
+     * @brief Copy constructor
+     * @param type Another instance of TypeObjectV1
+     */
+    RTPS_DllAPI TypeObjectV1(
+            const TypeObjectV1& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , m_type_object(type.m_type_object)
+    {
+    }
+
+    /**
+     * @brief Constructor using a TypeObject
+     * @param type TypeObject to be set
+     */
+    RTPS_DllAPI TypeObjectV1(
+            const fastrtps::types::TypeObject& type)
+        : Parameter_t(PID_TYPE_OBJECTV1, 0)
+        , QosPolicy(false)
+        , m_type_object(type)
+    {
+    }
+
+    /**
+     * @brief Move constructor
+     * @param type Another instance of TypeObjectV1
+     */
+    RTPS_DllAPI TypeObjectV1(
+            TypeObjectV1&& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , m_type_object(std::move(type.m_type_object))
+    {
+    }
+
+    RTPS_DllAPI TypeObjectV1& operator =(
+            const TypeObjectV1& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        m_type_object = type.m_type_object;
+
+        return *this;
+    }
+
+    RTPS_DllAPI TypeObjectV1& operator =(
+            TypeObjectV1&& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        m_type_object = std::move(type.m_type_object);
+
+        return *this;
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TypeObjectV1() override = default;
+
+    inline void clear() override
+    {
+        *this = TypeObjectV1();
+    }
+
+    RTPS_DllAPI TypeObjectV1& operator =(
+            const fastrtps::types::TypeObject& type_object)
+    {
+        m_type_object = type_object;
+        return *this;
+    }
+
+    /**
+     * @brief Getter for the TypeObject
+     * @return TypeObject reference
+     */
+    RTPS_DllAPI const fastrtps::types::TypeObject& get() const
+    {
+        return m_type_object;
+    }
+
+};
+
+namespace xtypes {
+
+/**
+ * Class xtypes::TypeInformation
+ */
+class TypeInformation : public Parameter_t, public QosPolicy
+{
+public:
+
+    //!Type Information
+    fastrtps::types::TypeInformation type_information;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TypeInformation()
+        : Parameter_t(PID_TYPE_INFORMATION, 0)
+        , QosPolicy(false)
+        , type_information()
+        , assigned_(false)
+    {
+    }
+
+    /**
+     * @brief Copy constructor
+     * @param type Another instance of TypeInformation
+     */
+    RTPS_DllAPI TypeInformation(
+            const TypeInformation& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , type_information(type.type_information)
+        , assigned_(type.assigned_)
+    {
+    }
+
+    /**
+     * @brief Constructor using a fastrtps::types::TypeInformation
+     * @param info fastrtps::types::TypeInformation to be set
+     */
+    RTPS_DllAPI TypeInformation(
+            const fastrtps::types::TypeInformation& info)
+        : Parameter_t(PID_TYPE_INFORMATION, 0)
+        , QosPolicy(false)
+        , type_information(info)
+        , assigned_(true)
+    {
+    }
+
+    /**
+     * @brief Move Constructor
+     * @param type Another instance of TypeInformation
+     */
+    RTPS_DllAPI TypeInformation(
+            TypeInformation&& type)
+        : Parameter_t(type.Pid, type.length)
+        , QosPolicy(type.send_always_)
+        , type_information(std::move(type.type_information))
+        , assigned_(type.assigned_)
+    {
+    }
+
+    RTPS_DllAPI TypeInformation& operator =(
+            const TypeInformation& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        type_information = type.type_information;
+        assigned_ = type.assigned_;
+
+        return *this;
+    }
+
+    RTPS_DllAPI TypeInformation& operator =(
+            TypeInformation&& type)
+    {
+        Pid = type.Pid;
+        length = type.length;
+        send_always_ = type.send_always_;
+
+        type_information = std::move(type.type_information);
+        assigned_ = type.assigned_;
+
+        return *this;
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TypeInformation() override = default;
+
+    inline void clear() override
+    {
+        *this = TypeInformation();
+    }
+
+    /**
+     * @brief Check if it is assigned
+     * @return true if assigned, false if not
+     */
+    RTPS_DllAPI bool assigned() const
+    {
+        return assigned_;
+    }
+
+    /**
+     * @brief Setter for assigned boolean
+     * @param value Boolean to be set
+     */
+    RTPS_DllAPI void assigned(
+            bool value)
+    {
+        assigned_ = value;
+    }
+
+    RTPS_DllAPI TypeInformation& operator =(
+            const fastrtps::types::TypeInformation& type_info)
+    {
+        type_information = type_info;
+        assigned_ = true;
+        return *this;
+    }
+
+private:
+
+    //!Boolean that states if the TypeInformation has been asigned manually or not.
+    bool assigned_;
+};
+
+} // namespace xtypes
+
+//!Holds allocation limits affecting collections managed by a participant.
+using ParticipantResourceLimitsQos = fastrtps::rtps::RTPSParticipantAllocationAttributes;
+
+//! Property policies
+using PropertyPolicyQos = fastrtps::rtps::PropertyPolicy;
+
+//! Qos Policy that configures the wire protocol
+class WireProtocolConfigQos : public QosPolicy
+{
+
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI WireProtocolConfigQos()
+        : QosPolicy(false)
+        , participant_id(-1)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~WireProtocolConfigQos() = default;
+
+    bool operator ==(
+            const WireProtocolConfigQos& b) const
+    {
+        return (this->prefix == b.prefix) &&
+               (this->participant_id == b.participant_id) &&
+               (this->builtin == b.builtin) &&
+               (this->port == b.port) &&
+               (this->throughput_controller == b.throughput_controller) &&
+               (this->default_unicast_locator_list == b.default_unicast_locator_list) &&
+               (this->default_multicast_locator_list == b.default_multicast_locator_list) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        WireProtocolConfigQos reset = WireProtocolConfigQos();
+        std::swap(*this, reset);
+    }
+
+    //! Optionally allows user to define the GuidPrefix_t
+    fastrtps::rtps::GuidPrefix_t prefix;
+
+    //!Participant ID <br> By default, -1.
+    int32_t participant_id;
+
+    //! Builtin parameters.
+    fastrtps::rtps::BuiltinAttributes builtin;
+
+    //!Port Parameters
+    fastrtps::rtps::PortParameters port;
+
+    //!Throughput controller parameters. Leave default for uncontrolled flow.
+    fastrtps::rtps::ThroughputControllerDescriptor throughput_controller;
+
+    /**
+     * Default list of Unicast Locators to be used for any Endpoint defined inside this RTPSParticipant in the case
+     * that it was defined with NO UnicastLocators. At least ONE locator should be included in this list.
+     */
+    fastrtps::rtps::LocatorList_t default_unicast_locator_list;
+
+    /**
+     * Default list of Multicast Locators to be used for any Endpoint defined inside this RTPSParticipant in the
+     * case that it was defined with NO UnicastLocators. This is usually left empty.
+     */
+    fastrtps::rtps::LocatorList_t default_multicast_locator_list;
+};
+
+//! Qos Policy to configure the transport layer
+class TransportConfigQos : public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TransportConfigQos()
+        : QosPolicy(false)
+        , use_builtin_transports(true)
+        , send_socket_buffer_size(0)
+        , listen_socket_buffer_size(0)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TransportConfigQos() = default;
+
+    bool operator ==(
+            const TransportConfigQos& b) const
+    {
+        return (this->user_transports == b.user_transports) &&
+               (this->use_builtin_transports == b.use_builtin_transports) &&
+               (this->send_socket_buffer_size == b.send_socket_buffer_size) &&
+               (this->listen_socket_buffer_size == b.listen_socket_buffer_size) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        TransportConfigQos reset = TransportConfigQos();
+        std::swap(*this, reset);
+    }
+
+    //!User defined transports to use alongside or in place of builtins.
+    std::vector<std::shared_ptr<fastdds::rtps::TransportDescriptorInterface> > user_transports;
+
+    //!Set as false to disable the default UDPv4 implementation. <br> By default, true.
+    bool use_builtin_transports;
+
+    /*!
+     * @brief Send socket buffer size for the send resource. Zero value indicates to use default system buffer size. <br>
+     * By default, 0.
+     */
+    uint32_t send_socket_buffer_size;
+
+    /*! Listen socket buffer for all listen resources. Zero value indicates to use default system buffer size. <br>
+     * By default, 0.
+     */
+    uint32_t listen_socket_buffer_size;
+};
+
+//!Qos Policy to configure the endpoint
+class RTPSEndpointQos
+{
+public:
+
+    RTPS_DllAPI RTPSEndpointQos()
+        : user_defined_id(-1)
+        , entity_id(-1)
+        , history_memory_policy(fastrtps::rtps::PREALLOCATED_MEMORY_MODE)
+    {
+    }
+
+    virtual RTPS_DllAPI ~RTPSEndpointQos() = default;
+
+    bool operator ==(
+            const RTPSEndpointQos& b) const
+    {
+        return (this->unicast_locator_list == b.unicast_locator_list) &&
+               (this->multicast_locator_list == b.multicast_locator_list) &&
+               (this->remote_locator_list == b.remote_locator_list) &&
+               (this->user_defined_id == b.user_defined_id) &&
+               (this->entity_id == b.entity_id) &&
+               (this->history_memory_policy == b.history_memory_policy);
+    }
+
+    //!Unicast locator list
+    fastrtps::rtps::LocatorList_t unicast_locator_list;
+
+    //!Multicast locator list
+    fastrtps::rtps::LocatorList_t multicast_locator_list;
+
+    //!Remote locator list
+    fastrtps::rtps::LocatorList_t remote_locator_list;
+
+    //!User Defined ID, used for StaticEndpointDiscovery. <br> By default, -1.
+    int16_t user_defined_id;
+
+    //!Entity ID, if the user wants to specify the EntityID of the endpoint. <br> By default, -1.
+    int16_t entity_id;
+
+    //!Underlying History memory policy. <br> By default, PREALLOCATED_MEMORY_MODE.
+    fastrtps::rtps::MemoryManagementPolicy_t history_memory_policy;
+};
+
+//!Qos Policy to configure the limit of the writer resources
+class WriterResourceLimitsQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI WriterResourceLimitsQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~WriterResourceLimitsQos() = default;
+
+    bool operator ==(
+            const WriterResourceLimitsQos& b) const
+    {
+        return (this->matched_subscriber_allocation == b.matched_subscriber_allocation);
+    }
+
+    //!Matched subscribers allocation limits.
+    fastrtps::ResourceLimitedContainerConfig matched_subscriber_allocation;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_

+ 88 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp

@@ -0,0 +1,88 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ReaderDataLifecycleQosPolicy.hpp
+ */
+
+#ifndef _FASTDDS_READERDATALIFECYCLEQOSPOLICY_HPP_
+#define _FASTDDS_READERDATALIFECYCLEQOSPOLICY_HPP_
+
+#include <fastdds/rtps/common/Time_t.h>
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+using eprosima::fastrtps::Duration_t;
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief Specifies the behavior of the DataReader with regards to the lifecycle of the data-instances it manages.
+//! @warning This Qos Policy will be implemented in future releases.
+//! @note Mutable Qos Policy
+class ReaderDataLifecycleQosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    ReaderDataLifecycleQosPolicy()
+        : autopurge_no_writer_samples_delay(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+        , autopurge_disposed_samples_delay(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~ReaderDataLifecycleQosPolicy()
+    {
+    }
+
+    bool operator ==(
+            const ReaderDataLifecycleQosPolicy& b) const
+    {
+        return (this->autopurge_no_writer_samples_delay == b.autopurge_no_writer_samples_delay) &&
+               (this->autopurge_disposed_samples_delay == b.autopurge_disposed_samples_delay);
+    }
+
+    inline void clear()
+    {
+        ReaderDataLifecycleQosPolicy reset = ReaderDataLifecycleQosPolicy();
+        std::swap(*this, reset);
+    }
+
+public:
+
+    /**
+     * @brief Indicates the duration the DataReader must retain information regarding instances that have the
+     * instance_state NOT_ALIVE_NO_WRITERS. <br>
+     * By default, c_TimeInfinite.
+     */
+    Duration_t autopurge_no_writer_samples_delay;
+    /**
+     * @brief Indicates the duration the DataReader must retain information regarding instances that have the
+     * instance_state NOT_ALIVE_DISPOSED. <br>
+     * By default, c_TimeInfinite.
+     */
+    Duration_t autopurge_disposed_samples_delay;
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_READERDATALIFECYCLEQOSPOLICY_HPP_

+ 70 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp

@@ -0,0 +1,70 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WriterDataLifecycleQosPolicy.hpp
+ */
+
+#ifndef _FASTDDS_WRITERDATALIFECYCLEQOSPOLICY_HPP_
+#define _FASTDDS_WRITERDATALIFECYCLEQOSPOLICY_HPP_
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief Specifies the behavior of the DataWriter with regards to the lifecycle of the data-instances it manages.
+//! @warning This Qos Policy will be implemented in future releases.
+//! @note Mutable Qos Policy
+class WriterDataLifecycleQosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    WriterDataLifecycleQosPolicy()
+        : autodispose_unregistered_instances(true)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~WriterDataLifecycleQosPolicy()
+    {
+    }
+
+    bool operator ==(
+            const WriterDataLifecycleQosPolicy& b) const
+    {
+        return (this->autodispose_unregistered_instances == b.autodispose_unregistered_instances);
+    }
+
+public:
+
+    /**
+     * @brief Controls whether a DataWriter will automatically dispose instances each time they are unregistered.
+     * The setting autodispose_unregistered_instances = TRUE indicates that unregistered instances will also be considered
+     * disposed. <br>
+     * By default, true.
+     */
+    bool autodispose_unregistered_instances;
+
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_WRITERDATALIFECYCLEQOSPOLICY_HPP_

+ 56 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/BaseStatus.hpp

@@ -0,0 +1,56 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file BaseStatus.hpp
+ */
+
+#ifndef _FASTDDS_BASE_STATUS_HPP_
+#define _FASTDDS_BASE_STATUS_HPP_
+
+#include <cstdint>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A struct storing the base status
+struct BaseStatus
+{
+    //!Total cumulative count
+    int32_t total_count = 0;
+
+    //!Increment since the last time the status was read
+    int32_t total_count_change = 0;
+};
+
+//!Alias of BaseStatus
+using SampleLostStatus = BaseStatus;
+//!Alias of BaseStatus
+using LivelinessLostStatus = BaseStatus;
+//!Alias of BaseStatus
+using InconsistentTopicStatus = BaseStatus;
+
+} //namespace dds
+} //namespace fastdds
+
+namespace fastrtps {
+
+using LivelinessLostStatus = fastdds::dds::BaseStatus;
+
+}
+
+} //namespace eprosima
+
+#endif // _FASTDDS_BASE_STATUS_HPP_

+ 65 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/DeadlineMissedStatus.hpp

@@ -0,0 +1,65 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DeadlineMissedStatus.hpp
+ */
+
+#ifndef _FASTDDS_DDS_QOS_DEADLINEMISSEDSTATUS_HPP_
+#define _FASTDDS_DDS_QOS_DEADLINEMISSEDSTATUS_HPP_
+
+#include <fastdds/rtps/common/InstanceHandle.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A struct storing the deadline status
+//! @ingroup DEADLINE_MODULE
+struct DeadlineMissedStatus
+{
+    //! @brief Constructor
+    DeadlineMissedStatus()
+        : total_count()
+        , total_count_change()
+        , last_instance_handle()
+    {
+    }
+
+    //! @brief Destructor
+    ~DeadlineMissedStatus()
+    {
+    }
+
+    //! @brief Total cumulative number of offered deadline periods epased during which a writer failed to provide data
+    //! @details Missed deadlines accumulate, that is, each deadline period the total_count will be incremented by 1
+    uint32_t total_count;
+
+    //! @brief The change in total_count since the last time the listener was called or the status was read
+    uint32_t total_count_change;
+
+    //! @brief Handle to the last instance missing the deadline
+    fastrtps::rtps::InstanceHandle_t last_instance_handle;
+};
+
+//! Typedef of DeadlineMissedStatus
+typedef DeadlineMissedStatus OfferedDeadlineMissedStatus;
+//! Typedef of DeadlineMissedStatus
+typedef DeadlineMissedStatus RequestedDeadlineMissedStatus;
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_DEADLINEMISSEDSTATUS_HPP_

+ 83 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp

@@ -0,0 +1,83 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file IncompatibleQosStatus.hpp
+ */
+
+#ifndef _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_
+#define _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_
+
+#include <cstdint>
+#include <vector>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//!Alias of uint32_t
+using QosPolicyId_t = uint32_t;
+
+/**
+ * @brief A struct storing the id of the incompatible QoS Policy and the number of times it fails
+ */
+struct QosPolicyCount
+{
+    //!Constructor
+    QosPolicyCount(
+            QosPolicyId_t id,
+            int32_t c)
+        : policy_id(id)
+        , count(c)
+    {
+    }
+
+    //! @brief The id of the policy
+    QosPolicyId_t policy_id;
+
+    //! @brief Total number of times that the concerned writer discovered a reader for the same topic
+    //! @details The requested QoS is incompatible with the one offered by the writer
+    int32_t count;
+};
+
+//!Alias of std::vector<QosPolicyCount>
+using QosPolicyCountSeq = std::vector<QosPolicyCount>;
+
+//! @brief A struct storing the requested incompatible QoS status
+struct IncompatibleQosStatus
+{
+    //! @brief Total cumulative number of times the concerned writer discovered a reader for the same topic
+    //! @details The requested QoS is incompatible with the one offered by the writer
+    int32_t total_count = 0;
+
+    //! @brief The change in total_count since the last time the listener was called or the status was read
+    int32_t total_count_change = 0;
+
+    //! @brief The id of the policy that was found to be incompatible the last time an incompatibility is detected
+    QosPolicyId_t last_policy_id;
+
+    //! @brief A list of QosPolicyCount
+    QosPolicyCountSeq policies;
+};
+
+//!Alias of IncompatibleQosStatus
+using RequestedIncompatibleQosStatus = IncompatibleQosStatus;
+//!Alias of IncompatibleQosStatus
+using OfferedIncompatibleQosStatus = IncompatibleQosStatus;
+
+} //end of namespace dds
+} //end of namespace fastdds
+} //end of namespace eprosima
+
+#endif // _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_

+ 59 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/LivelinessChangedStatus.hpp

@@ -0,0 +1,59 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file LivelinessChangedStatus.hpp
+ */
+
+#ifndef _FASTDDS_DDS_QOS_LIVELINESSCHANGEDSTATUS_HPP_
+#define _FASTDDS_DDS_QOS_LIVELINESSCHANGEDSTATUS_HPP_
+
+#include <fastdds/rtps/common/InstanceHandle.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A struct storing the liveliness changed status
+struct LivelinessChangedStatus
+{
+    //! @brief The total number of currently active publishers that write the topic read by the subscriber
+    //! @details This count increases when a newly matched publisher asserts its liveliness for the first time
+    //! or when a publisher previously considered to be not alive reasserts its liveliness. The count decreases
+    //! when a publisher considered alive fails to assert its liveliness and becomes not alive, whether because
+    //! it was deleted normally or for some other reason
+    int32_t alive_count = 0;
+
+    //! @brief The total count of current publishers that write the topic read by the subscriber that are no longer
+    //! asserting their liveliness
+    //! @details This count increases when a publisher considered alive fails to assert its liveliness and becomes
+    //! not alive for some reason other than the normal deletion of that publisher. It decreases when a previously
+    //! not alive publisher either reasserts its liveliness or is deleted normally
+    int32_t not_alive_count = 0;
+
+    //! @brief The change in the alive_count since the last time the listener was called or the status was read
+    int32_t alive_count_change = 0;
+
+    //! @brief The change in the not_alive_count since the last time the listener was called or the status was read
+    int32_t not_alive_count_change = 0;
+
+    //! @brief Handle to the last publisher whose change in liveliness caused this status to change
+    fastrtps::rtps::InstanceHandle_t last_publication_handle;
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_LIVELINESSCHANGEDSTATUS_HPP_

+ 55 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/MatchedStatus.hpp

@@ -0,0 +1,55 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file MatchedStatus.hpp
+ */
+
+#ifndef _MATCHED_STATUS_HPP_
+#define _MATCHED_STATUS_HPP_
+
+#include <cstdint>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A structure storing the subscription status
+struct MatchedStatus
+{
+    //! @brief Constructor
+    MatchedStatus() = default;
+
+    //! @brief Destructor
+    ~MatchedStatus() = default;
+
+    //! @brief Total cumulative count the concerned reader discovered a match with a writer
+    //! @details It found a writer for the same topic with a requested QoS that is compatible with that offered by the reader
+    int32_t total_count = 0;
+
+    //! @brief The change in total_count since the last time the listener was called or the status was read
+    int32_t total_count_change = 0;
+
+    //! @brief The number of writers currently matched to the concerned reader
+    int32_t current_count = 0;
+
+    //! @brief The change in current_count since the last time the listener was called or the status was read
+    int32_t current_count_change = 0;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif //_MATCHED_STATUS_HPP_

+ 41 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/PublicationMatchedStatus.hpp

@@ -0,0 +1,41 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PublicationMatchedStatus.hpp
+*/
+
+#ifndef _PUBLICATION_MATCHED_STATUS_HPP_
+#define _PUBLICATION_MATCHED_STATUS_HPP_
+
+#include <cstdint>
+#include <fastrtps/rtps/common/InstanceHandle.h>
+#include <fastdds/dds/core/status/MatchedStatus.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A structure storing the publication status
+struct PublicationMatchedStatus: public MatchedStatus
+{
+	//! @brief Handle to the last reader that matched the writer causing the status to change
+	eprosima::fastrtps::rtps::InstanceHandle_t last_subscription_handle;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif //_PUBLICATION_MATCHED_STATUS_HPP_

+ 71 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/SampleRejectedStatus.hpp

@@ -0,0 +1,71 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SampleRejectedStatus.hpp
+ */
+
+#ifndef _FASTDDS_DDS_QOS_SAMPLEREJECTEDSTATUS_HPP_
+#define _FASTDDS_DDS_QOS_SAMPLEREJECTEDSTATUS_HPP_
+
+#include <cstdint>
+#include <fastdds/rtps/common/InstanceHandle.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! An enum with the possible values for the sample rejected reason
+enum SampleRejectedStatusKind
+{
+    //!Default value
+    NOT_REJECTED,
+    //! Exceeds the max_instance limit
+    REJECTED_BY_INSTANCES_LIMIT,
+    //! Exceeds the max_samples limit
+    REJECTED_BY_SAMPLES_LIMIT,
+    //! Exceeds the max_samples_per_instance limit
+    REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT
+};
+
+//! @brief A struct storing the sample lost status
+struct SampleRejectedStatus
+{
+    /**
+     * Total cumulative count of samples rejected by the DataReader.
+     */
+    uint32_t total_count = 0;
+
+    /**
+     * The incremental number of samples rejected since the last time the listener was called or the status was read.
+     */
+    uint32_t total_count_change = 0;
+
+    /**
+     * Reason for rejecting the last sample rejected.
+     * If no samples have been rejected, the reason is the special value NOT_REJECTED.
+     */
+    SampleRejectedStatusKind last_reason = NOT_REJECTED;
+
+    /**
+     * Handle to the instance being updated by the last sample that was rejected.
+     */
+    fastrtps::rtps::InstanceHandle_t last_instance_handle;
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_SAMPLEREJECTEDSTATUS_HPP_

+ 254 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/StatusMask.hpp

@@ -0,0 +1,254 @@
+/*
+ * Copyright 2010, Object Management Group, Inc.
+ * Copyright 2010, PrismTech, Corp.
+ * Copyright 2010, Real-Time Innovations, Inc.
+ * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima).
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _FASTDDS_STATUSMASK_HPP_
+#define _FASTDDS_STATUSMASK_HPP_
+
+#include <bitset>
+#include <sstream>
+
+//!Alias of size_t(16)
+#define FASTDDS_STATUS_COUNT size_t(16)
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * @brief
+ * StatusMask is a bitmap or bitset field.
+ *
+ * This bitset is used to:
+ * - determine which listener functions to call
+ * - set conditions in dds::core::cond::StatusCondition
+ * - indicate status changes when calling dds::core::Entity::status_changes
+ */
+class StatusMask : public std::bitset<FASTDDS_STATUS_COUNT>
+{
+public:
+
+    /**
+     * Convenience typedef for std::bitset<FASTDDS_STATUS_COUNT>.
+     */
+    typedef std::bitset<FASTDDS_STATUS_COUNT> MaskType;
+
+    /**
+     * Construct an StatusMask with no flags set.
+     */
+    StatusMask()
+        : std::bitset<FASTDDS_STATUS_COUNT>()
+    {
+    }
+
+    /**
+     * Construct an StatusMask with an uint32_t bit mask.
+     *
+     * @param mask the bit array to initialize the bitset with
+     */
+    explicit StatusMask(
+            uint32_t mask)
+        : std::bitset<FASTDDS_STATUS_COUNT>(mask)
+    {
+    }
+
+    /**
+     * Shift (merge) given StatusMask bits into this StatusMask bitset.
+     *
+     * @return StatusMask this
+     */
+    inline StatusMask& operator <<(
+            const StatusMask& mask)
+    {
+        *this |= mask;
+        return *this;
+    }
+
+    /**
+     * Get all StatusMasks
+     *
+     * @return StatusMask all
+     */
+    inline static StatusMask all()
+    {
+        return StatusMask(0x80007fe7u);
+    }
+
+    /**
+     * Get no StatusMasks
+     *
+     * @return StatusMask none
+     */
+    inline static StatusMask none()
+    {
+        return StatusMask(0u);
+    }
+
+public:
+
+    /**
+     * Get the StatusMask associated with dds::core::status::InconsistentTopicStatus
+     *
+     * @return StatusMask inconsistent_topic
+     */
+    inline static StatusMask inconsistent_topic()
+    {
+        return StatusMask(0x00000001 << 0u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::OfferedDeadlineMissedStatus
+     *
+     * @return StatusMask offered_deadline_missed
+     */
+    inline static StatusMask offered_deadline_missed()
+    {
+        return StatusMask(0x00000001 << 1u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::RequestedDeadlineMissedStatus
+     *
+     * @return StatusMask requested_deadline_missed
+     */
+    inline static StatusMask requested_deadline_missed()
+    {
+        return StatusMask(0x00000001 << 2u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::OfferedIncompatibleQosStatus
+     *
+     * @return StatusMask offered_incompatible_qos
+     */
+    inline static StatusMask offered_incompatible_qos()
+    {
+        return StatusMask(0x00000001 << 5u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::RequestedIncompatibleQosStatus
+     *
+     * @return StatusMask requested_incompatible_qos
+     */
+    inline static StatusMask requested_incompatible_qos()
+    {
+        return StatusMask(0x00000001 << 6u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::SampleLostStatus
+     *
+     * @return StatusMask sample_lost
+     */
+    inline static StatusMask sample_lost()
+    {
+        return StatusMask(0x00000001 << 7u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::SampleRejectedStatus
+     *
+     * @return StatusMask sample_rejected
+     */
+    inline static StatusMask sample_rejected()
+    {
+        return StatusMask(0x00000001 << 8u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::data_on_readers
+     *
+     * @return StatusMask data_on_readers
+     */
+    inline static StatusMask data_on_readers()
+    {
+        return StatusMask(0x00000001 << 9u);
+    }
+
+    /**
+     * get the statusmask associated with dds::core::status::data_available
+     *
+     * @return statusmask data_available
+     */
+    inline static StatusMask data_available()
+    {
+        return StatusMask(0x00000001 << 10u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::LivelinessLostStatus
+     *
+     * @return StatusMask liveliness_lost
+     */
+    inline static StatusMask liveliness_lost()
+    {
+        return StatusMask(0x00000001 << 11u);
+    }
+
+    /**
+     * Get the StatusMask associated with dds::core::status::LivelinessChangedStatus
+     *
+     * @return StatusMask liveliness_changed
+     */
+    inline static StatusMask liveliness_changed()
+    {
+        return StatusMask(0x00000001 << 12u);
+    }
+
+    /**
+     * Get the statusmask associated with dds::core::status::PublicationMatchedStatus
+     *
+     * @return StatusMask publication_matched
+     */
+    inline static StatusMask publication_matched()
+    {
+        return StatusMask(0x00000001 << 13u);
+    }
+
+    /**
+     * Get the statusmask associated with dds::core::status::SubscriptionMatchedStatus
+     *
+     * @return StatusMask subscription_matched
+     */
+    inline static StatusMask subscription_matched()
+    {
+        return StatusMask(0x00000001 << 14u);
+    }
+
+    /**
+     * @brief Checks if the status passed as parameter is 1 in the actual StatusMask
+     * @param status Status that need to be checked
+     * @return true if the status is active and false if not
+     */
+    bool is_active(
+            StatusMask status) const
+    {
+        MaskType r = *this & status;
+        return r == status;
+    }
+
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+
+#endif //_FASTDDS_STATUSMASK_HPP_

+ 42 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/core/status/SubscriptionMatchedStatus.hpp

@@ -0,0 +1,42 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SubscriptionMatchedStatus.hpp
+*/
+
+#ifndef _SUBSCRIPTION_MATCHED_STATUS_HPP_
+#define _SUBSCRIPTION_MATCHED_STATUS_HPP_
+
+#include <cstdint>
+
+#include <fastrtps/rtps/common/InstanceHandle.h>
+#include <fastdds/dds/core/status/MatchedStatus.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! @brief A structure storing the subscription status
+struct SubscriptionMatchedStatus: public MatchedStatus
+{
+	//! @brief Handle to the last writer that matched the reader causing the status change
+	eprosima::fastrtps::rtps::InstanceHandle_t last_publication_handle;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif //_SUBCRIPTION_MATCHED_STATUS_HPP_

+ 612 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipant.hpp

@@ -0,0 +1,612 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DomainParticipant.hpp
+ *
+ */
+
+#ifndef _FASTDDS_DOMAIN_PARTICIPANT_HPP_
+#define _FASTDDS_DOMAIN_PARTICIPANT_HPP_
+
+#include <fastdds/dds/topic/TypeSupport.hpp>
+#include <fastdds/dds/topic/Topic.hpp>
+#include <fastrtps/types/TypeIdentifier.h>
+
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/common/SampleIdentity.h>
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+#include <fastrtps/types/TypesBase.h>
+#include <fastdds/dds/core/status/StatusMask.hpp>
+#include <fastdds/dds/core/Entity.hpp>
+#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
+
+#include <utility>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace dds {
+namespace domain {
+class DomainParticipant;
+}
+}
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+class ResourceEvent;
+} // namespace rtps
+
+namespace types {
+class TypeInformation;
+} // namespace types
+
+class ParticipantAttributes;
+class PublisherAttributes;
+class SubscriberAttributes;
+
+} //namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class DomainParticipantImpl;
+class DomainParticipantListener;
+class Publisher;
+class PublisherQos;
+class PublisherListener;
+class Subscriber;
+class SubscriberQos;
+class SubscriberListener;
+class TopicQos;
+
+/**
+ * Class DomainParticipant used to group Publishers and Subscribers into a single working unit.
+ * @ingroup FASTDDS_MODULE
+ */
+class DomainParticipant : public Entity
+{
+public:
+
+    /**
+     * This operation returns the value of the DomainParticipant QoS policies
+     * @param qos DomainParticipantQos reference where the qos is going to be returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            DomainParticipantQos& qos) const;
+
+    /**
+     * @brief This operation returns the value of the DomainParticipant QoS policies
+     * @return A reference to the DomainParticipantQos
+     */
+    RTPS_DllAPI const DomainParticipantQos& get_qos() const;
+
+    /**
+     * @brief This operation enables the DomainParticipant
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t enable() override;
+
+    /**
+     * This operation sets the value of the DomainParticipant QoS policies.
+     * @param qos DomainParticipantQos to be set
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const DomainParticipantQos& qos) const;
+
+    /**
+     * Allows modifying the DomainParticipantListener.
+     * @param listener
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            DomainParticipantListener* listener);
+
+    /**
+     * Allows accessing the DomainParticipantListener.
+     * @return DomainParticipantListener pointer
+     */
+    RTPS_DllAPI const DomainParticipantListener* get_listener() const;
+
+    /**
+     * Create a Publisher in this Participant.
+     * @param qos QoS of the Publisher.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Publisher.
+     */
+    RTPS_DllAPI Publisher* create_publisher(
+            const PublisherQos& qos,
+            PublisherListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Create a Publisher in this Participant.
+     * @param profile_name Publisher profile name.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Publisher.
+     */
+    RTPS_DllAPI Publisher* create_publisher_with_profile(
+            const std::string& profile_name,
+            PublisherListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Deletes an existing Publisher.
+     * @param publisher to be deleted.
+     * @return RETCODE_PRECONDITION_NOT_MET if the publisher does not belong to this participant or if it has active DataWriters,
+     * RETCODE_OK if it is correctly deleted and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t delete_publisher(
+            Publisher* publisher);
+
+    /**
+     * Create a Subscriber in this Participant.
+     * @param qos QoS of the Subscriber.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Subscriber.
+     */
+    RTPS_DllAPI Subscriber* create_subscriber(
+            const SubscriberQos& qos,
+            SubscriberListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Create a Subscriber in this Participant.
+     * @param profile_name Subscriber profile name.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Subscriber.
+     */
+    RTPS_DllAPI Subscriber* create_subscriber_with_profile(
+            const std::string& profile_name,
+            SubscriberListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Deletes an existing Subscriber.
+     * @param subscriber to be deleted.
+     * @return RETCODE_PRECONDITION_NOT_MET if the subscriber does not belong to this participant or if it has active DataReaders,
+     * RETCODE_OK if it is correctly deleted and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t delete_subscriber(
+            Subscriber* subscriber);
+
+    /**
+     * Register a type in this participant.
+     * @param type TypeSupport.
+     * @param type_name The name that will be used to identify the Type.
+     * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there is another TypeSupport
+     * with the same name and RETCODE_OK if it is correctly registered.
+     */
+    RTPS_DllAPI ReturnCode_t register_type(
+            TypeSupport type,
+            const std::string& type_name);
+
+    /**
+     * Register a type in this participant.
+     * @param type TypeSupport.
+     * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there is another TypeSupport
+     * with the same name and RETCODE_OK if it is correctly registered.
+     */
+    RTPS_DllAPI ReturnCode_t register_type(
+            TypeSupport type);
+
+    /**
+     * Unregister a type in this participant.
+     * @param typeName Name of the type
+     * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there are entities using that
+     * TypeSupport and RETCODE_OK if it is correctly unregistered.
+     */
+    RTPS_DllAPI ReturnCode_t unregister_type(
+            const std::string& typeName);
+
+    /**
+     * Create a Topic in this Participant.
+     * @param topic_name Name of the Topic.
+     * @param type_name Data type of the Topic.
+     * @param qos QoS of the Topic.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Topic.
+     */
+    RTPS_DllAPI Topic* create_topic(
+            const std::string& topic_name,
+            const std::string& type_name,
+            const TopicQos& qos,
+            TopicListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Create a Topic in this Participant.
+     * @param topic_name Name of the Topic.
+     * @param type_name Data type of the Topic.
+     * @param profile_name Topic profile name.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask that holds statuses the listener responds to (default: all)
+     * @return Pointer to the created Topic.
+     */
+    RTPS_DllAPI Topic* create_topic_with_profile(
+            const std::string& topic_name,
+            const std::string& type_name,
+            const std::string& profile_name,
+            TopicListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Deletes an existing Topic.
+     * @param topic to be deleted.
+     * @return RETCODE_BAD_PARAMETER if the topic passed is a nullptr, RETCODE_PRECONDITION_NOT_MET if the topic does not belong to
+     * this participant or if it is referenced by any entity and ETCODE_OK if the Topic was deleted.
+     */
+    RTPS_DllAPI ReturnCode_t delete_topic(
+            Topic* topic);
+
+    /**
+     * Looks up an existing, locally created @ref TopicDescription, based on its name.
+     * May be called on a disabled participant.
+     *
+     * @param topic_name Name of the @ref TopicDescription to search for.
+     *
+     * @return Pointer to the topic description, if it has been created locally. Otherwise, nullptr is returned.
+     *
+     * @remark UNSAFE. It is unsafe to lookup a topic description while another thread is creating a topic.
+     */
+    RTPS_DllAPI TopicDescription* lookup_topicdescription(
+            const std::string& topic_name) const;
+
+    /* TODO
+       Subscriber* get_builtin_subscriber();
+     */
+
+    /* TODO
+       bool ignore_participant(
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /* TODO
+       bool ignore_topic(
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /* TODO
+       bool ignore_publication(
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /* TODO
+       bool ignore_subscription(
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /**
+     * This operation retrieves the domain_id used to create the DomainParticipant.
+     * The domain_id identifies the DDS domain to which the DomainParticipant belongs.
+     * @return The Participant's domain_id
+     */
+    RTPS_DllAPI DomainId_t get_domain_id() const;
+
+    /* TODO
+       bool delete_contained_entities();
+     */
+
+    /**
+     * This operation manually asserts the liveliness of the DomainParticipant.
+     * This is used in combination with the LIVELINESS QoS policy to indicate to the Service that the entity
+     * remains active.
+     *
+     * This operation needs to only be used if the DomainParticipant contains DataWriter entities with
+     * the LIVELINESS set to MANUAL_BY_PARTICIPANT and it only affects the liveliness of those DataWriter entities.
+     * Otherwise, it has no effect.
+     *
+     * @note Writing data via the write operation on a DataWriter asserts liveliness on the DataWriter itself and its
+     * DomainParticipant. Consequently the use of assert_liveliness is only needed if the application is not
+     * writing data regularly.
+     * @return RETCODE_OK if the liveliness was asserted, RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t assert_liveliness();
+
+    /**
+     * This operation sets a default value of the Publisher QoS policies which will be used for newly created
+     * Publisher entities in the case where the QoS policies are defaulted in the create_publisher operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not,
+     * the operation will have no effect and return false.
+     *
+     * The special value PUBLISHER_QOS_DEFAULT may be passed to this operation to indicate that the default QoS
+     * should be reset back to the initial values the factory would use, that is the values that would be used
+     * if the set_default_publisher_qos operation had never been called.
+     * @param qos PublisherQos to be set
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_publisher_qos(
+            const PublisherQos& qos);
+
+    /**
+     * This operation retrieves the default value of the Publisher QoS, that is, the QoS policies which will be used
+     * for newly created Publisher entities in the case where the QoS policies are defaulted in the
+     * create_publisher operation.
+     *
+     * The values retrieved get_default_publisher_qos will match the set of values specified on the last successful
+     * call to set_default_publisher_qos, or else, if the call was never made, the default values.
+     * @return Current default publisher qos.
+     */
+    RTPS_DllAPI const PublisherQos& get_default_publisher_qos() const;
+
+    /**
+     * This operation retrieves the default value of the Publisher QoS, that is, the QoS policies which will be used
+     * for newly created Publisher entities in the case where the QoS policies are defaulted in the
+     * create_publisher operation.
+     *
+     * The values retrieved get_default_publisher_qos will match the set of values specified on the last successful
+     * call to set_default_publisher_qos, or else, if the call was never made, the default values.
+     * @param qos PublisherQos reference where the default_publisher_qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_publisher_qos(
+            PublisherQos& qos) const;
+
+    /**
+     * This operation sets a default value of the Subscriber QoS policies that will be used for newly created
+     * Subscriber entities in the case where the QoS policies are defaulted in the create_subscriber operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not,
+     * the operation will have no effect and return false.
+     *
+     * The special value SUBSCRIBER_QOS_DEFAULT may be passed to this operation to indicate that the default QoS
+     * should be reset back to the initial values the factory would use, that is the values that would be used
+     * if the set_default_subscriber_qos operation had never been called.
+     * @param qos SubscriberQos to be set
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_subscriber_qos(
+            const SubscriberQos& qos);
+
+    /**
+     * This operation retrieves the default value of the Subscriber QoS, that is, the QoS policies which will be used
+     * for newly created Subscriber entities in the case where the QoS policies are defaulted in the
+     * create_subscriber operation.
+     *
+     * The values retrieved get_default_subscriber_qos will match the set of values specified on the last successful
+     * call to set_default_subscriber_qos, or else, if the call was never made, the default values.
+     * @return Current default subscriber qos.
+     */
+    RTPS_DllAPI const SubscriberQos& get_default_subscriber_qos() const;
+
+    /**
+     * This operation retrieves the default value of the Subscriber QoS, that is, the QoS policies which will be used
+     * for newly created Subscriber entities in the case where the QoS policies are defaulted in the
+     * create_subscriber operation.
+     *
+     * The values retrieved get_default_subscriber_qos will match the set of values specified on the last successful
+     * call to set_default_subscriber_qos, or else, if the call was never made, the default values.
+     * @param qos SubscriberQos reference where the default_subscriber_qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_subscriber_qos(
+            SubscriberQos& qos) const;
+
+
+    /**
+     * This operation sets a default value of the Topic QoS policies which will be used for newly created
+     * Topic entities in the case where the QoS policies are defaulted in the create_topic operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not, the operation
+     * will have no effect and return INCONSISTENT_POLICY.
+     *
+     * The special value TOPIC_QOS_DEFAULT may be passed to this operation to indicate that the default QoS
+     * should be reset back to the initial values the factory would use, that is the values that would be used
+     * if the set_default_topic_qos operation had never been called.
+     * @param qos TopicQos to be set
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_topic_qos(
+            const TopicQos& qos);
+
+    /**
+     * This operation retrieves the default value of the Topic QoS, that is, the QoS policies that will be used
+     * for newly created Topic entities in the case where the QoS policies are defaulted in the create_topic
+     * operation.
+     *
+     * The values retrieved get_default_topic_qos will match the set of values specified on the last successful
+     * call to set_default_topic_qos, or else, TOPIC_QOS_DEFAULT if the call was never made.
+     * @return Current default topic qos.
+     */
+    RTPS_DllAPI const TopicQos& get_default_topic_qos() const;
+
+    /**
+     * This operation retrieves the default value of the Topic QoS, that is, the QoS policies that will be used
+     * for newly created Topic entities in the case where the QoS policies are defaulted in the create_topic
+     * operation.
+     *
+     * The values retrieved get_default_topic_qos will match the set of values specified on the last successful
+     * call to set_default_topic_qos, or else, TOPIC_QOS_DEFAULT if the call was never made.
+     * @param qos TopicQos reference where the default_topic_qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_topic_qos(
+            TopicQos& qos) const;
+
+    /* TODO
+       bool get_discovered_participants(
+            std::vector<fastrtps::rtps::InstanceHandle_t>& participant_handles) const;
+     */
+
+    /* TODO
+       bool get_discovered_participant_data(
+            ParticipantBuiltinTopicData& participant_data,
+            const fastrtps::rtps::InstanceHandle_t& participant_handle) const;
+     */
+
+    /* TODO
+       bool get_discovered_topics(
+            std::vector<fastrtps::rtps::InstanceHandle_t>& topic_handles) const;
+     */
+
+    /* TODO
+       bool get_discovered_topic_data(
+            TopicBuiltinTopicData& topic_data,
+            const fastrtps::rtps::InstanceHandle_t& topic_handle) const;
+     */
+
+    /**
+     * This operation checks whether or not the given handle represents an Entity that was created from the
+     * DomainParticipant.
+     * @param handle InstanceHandle of the entity to look for.
+     * @param recursive The containment applies recursively. That is, it applies both to entities
+     * (TopicDescription, Publisher, or Subscriber) created directly using the DomainParticipant as well as
+     * entities created using a contained Publisher, or Subscriber as the factory, and so forth. (default: true)
+     * @return True if entity is contained. False otherwise.
+     */
+    RTPS_DllAPI bool contains_entity(
+            const fastrtps::rtps::InstanceHandle_t& handle,
+            bool recursive = true) const;
+
+    /**
+     * This operation returns the current value of the time that the service uses to time-stamp data-writes
+     * and to set the reception-timestamp for the data-updates it receives.
+     * @param current_time Time_t reference where the current time is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_current_time(
+            fastrtps::Time_t& current_time) const;
+
+    /**
+     * This method gives access to a registered type based on its name.
+     * @param type_name Name of the type
+     * @return TypeSupport corresponding to the type_name
+     */
+    RTPS_DllAPI TypeSupport find_type(
+            const std::string& type_name) const;
+
+    /**
+     * Returns the DomainParticipant's handle.
+     * @return InstanceHandle of this DomainParticipant.
+     */
+    RTPS_DllAPI const fastrtps::rtps::InstanceHandle_t& get_instance_handle() const;
+
+    // From here legacy RTPS methods.
+
+    /**
+     * @brief Getter for the Participant GUID
+     * @return A reference to the GUID
+     */
+    RTPS_DllAPI const fastrtps::rtps::GUID_t& guid() const;
+
+    /**
+     * @brief Getter for the participant names
+     * @return Vector with the names
+     */
+    RTPS_DllAPI std::vector<std::string> get_participant_names() const;
+
+    /**
+     * This method can be used when using a StaticEndpointDiscovery mechanism different that the one
+     * included in FastRTPS, for example when communicating with other implementations.
+     * It indicates the Participant that an Endpoint from the XML has been discovered and
+     * should be activated.
+     * @param partguid Participant GUID_t.
+     * @param userId User defined ID as shown in the XML file.
+     * @param kind EndpointKind (WRITER or READER)
+     * @return True if correctly found and activated.
+     */
+    RTPS_DllAPI bool new_remote_endpoint_discovered(
+            const fastrtps::rtps::GUID_t& partguid,
+            uint16_t userId,
+            fastrtps::rtps::EndpointKind_t kind);
+
+    /**
+     * @brief Getter for the resource event
+     * @return A reference to the resource event
+     */
+    RTPS_DllAPI fastrtps::rtps::ResourceEvent& get_resource_event() const;
+
+    /**
+     * When a DomainParticipant receives an incomplete list of TypeIdentifiers in a
+     * PublicationBuiltinTopicData or SubscriptionBuiltinTopicData, it may request the additional type
+     * dependencies by invoking the getTypeDependencies operation.
+     * @param in TypeIdentifier sequence
+     * @return SampleIdentity
+     */
+    RTPS_DllAPI fastrtps::rtps::SampleIdentity get_type_dependencies(
+            const fastrtps::types::TypeIdentifierSeq& in) const;
+
+    /**
+     * A DomainParticipant may invoke the operation getTypes to retrieve the TypeObjects associated with a
+     * list of TypeIdentifiers.
+     * @param in TypeIdentifier sequence
+     * @return SampleIdentity
+     */
+    RTPS_DllAPI fastrtps::rtps::SampleIdentity get_types(
+            const fastrtps::types::TypeIdentifierSeq& in) const;
+
+    /**
+     * Helps the user to solve all dependencies calling internally to the typelookup service
+     * and registers the resulting dynamic type.
+     * The registration will be perform asynchronously and the user will be notified through the
+     * given callback, which receives the type_name as unique argument.
+     * If the type is already registered, the function will return true, but the callback will not be called.
+     * If the given type_information is enough to build the type without using the typelookup service,
+     * it will return true and the callback will be never called.
+     * @param type_information
+     * @param type_name
+     * @param callback
+     * @return true if type is already available (callback will not be called). false if type isn't available yet
+     * (the callback will be called if negotiation is success, and ignored in other case).
+     */
+    RTPS_DllAPI ReturnCode_t register_remote_type(
+            const fastrtps::types::TypeInformation& type_information,
+            const std::string& type_name,
+            std::function<void(const std::string& name, const fastrtps::types::DynamicType_ptr type)>& callback);
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~DomainParticipant();
+
+    /**
+     * @brief Check if the Participant has any Publisher, Subscriber or Topic
+     * @return true if any, false otherwise.
+     */
+    bool has_active_entities();
+
+private:
+
+    RTPS_DllAPI DomainParticipant(
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI DomainParticipant(
+            DomainId_t domain_id,
+            const DomainParticipantQos& qos,
+            DomainParticipantListener* listener,
+            const StatusMask& mask = StatusMask::all());
+
+    DomainParticipantImpl* impl_;
+
+    friend class DomainParticipantFactory;
+
+    friend class DomainParticipantImpl;
+
+    friend class ::dds::domain::DomainParticipant;
+};
+
+} // namespace dds
+} // namespace fastdds
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_DOMAIN_PARTICIPANT_HPP_ */

+ 233 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipantFactory.hpp

@@ -0,0 +1,233 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DomainParticipantFactory.hpp
+ *
+ */
+
+#ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_
+#define _FASTDDS_DOMAINPARTICIPANT_HPP_
+
+#include <fastrtps/attributes/ParticipantAttributes.h>
+#include <fastrtps/types/TypesBase.h>
+#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
+#include <fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp>
+#include <fastdds/dds/core/status/StatusMask.hpp>
+
+#include <mutex>
+#include <map>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DomainParticipantListener;
+class DomainParticipant;
+class DomainParticipantImpl;
+
+/**
+ * Class DomainParticipantFactory
+ *  @ingroup FASTDDS_MODULE
+ */
+class DomainParticipantFactory
+{
+
+public:
+
+    /**
+     * Returns the DomainParticipantFactory singleton.
+     * @return The DomainParticipantFactory singleton.
+     */
+    RTPS_DllAPI static DomainParticipantFactory* get_instance();
+
+    /**
+     * Create a Participant.
+     * @param domain_id Domain Id.
+     * @param qos DomainParticipantQos Reference.
+     * @param listener DomainParticipantListener Pointer (default: nullptr)
+     * @param mask StatusMask Reference (default: all)
+     * @return DomainParticipant pointer. (nullptr if not created.)
+     */
+    RTPS_DllAPI DomainParticipant* create_participant(
+            DomainId_t domain_id,
+            const DomainParticipantQos& qos,
+            DomainParticipantListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * Create a Participant.
+     * @param domain_id Domain Id.
+     * @param profile_name Participant profile name.
+     * @param listener DomainParticipantListener Pointer (default: nullptr)
+     * @param mask StatusMask Reference (default: all)
+     * @return DomainParticipant pointer. (nullptr if not created.)
+     */
+    RTPS_DllAPI DomainParticipant* create_participant_with_profile(
+            DomainId_t domain_id,
+            const std::string& profile_name,
+            DomainParticipantListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * This operation retrieves a previously created DomainParticipant belonging to specified domain_id.
+     * If no such DomainParticipant exists, the operation will return 'nullptr'.
+     * If multiple DomainParticipant entities belonging to that domain_id exist,
+     * then the operation will return one of them. It is not specified which one.
+     * @param domain_id
+     * @return previously created DomainParticipant within the specified domain
+     */
+    RTPS_DllAPI DomainParticipant* lookup_participant(
+            DomainId_t domain_id) const;
+
+    /**
+     * Returns all participants that belongs to the specified domain_id.
+     * @param domain_id
+     * @return previously created DomainParticipants within the specified domain
+     */
+    RTPS_DllAPI std::vector<DomainParticipant*> lookup_participants(
+            DomainId_t domain_id) const;
+
+    /**
+     * @brief This operation retrieves the default value of the DomainParticipant QoS, that is, the QoS policies which will
+     * be used for newly created DomainParticipant entities in the case where the QoS policies are defaulted in the
+     * create_participant operation.
+     * The values retrieved get_default_participant_qos will match the set of values specified on the last successful call
+     * to set_default_participant_qos, or else, if the call was never made, the default values.
+     * @param qos DomainParticipantQos where the qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_participant_qos(
+            DomainParticipantQos& qos) const;
+
+    /**
+     * @brief This operation retrieves the default value of the DomainParticipant QoS, that is, the QoS policies which will
+     * be used for newly created DomainParticipant entities in the case where the QoS policies are defaulted in the
+     * create_participant operation.
+     * The values retrieved get_default_participant_qos will match the set of values specified on the last successful call
+     * to set_default_participant_qos, or else, if the call was never made, the default values.
+     * @return A reference to the default DomainParticipantQos
+     */
+    RTPS_DllAPI const DomainParticipantQos& get_default_participant_qos() const;
+
+    /**
+     * @brief This operation sets a default value of the DomainParticipant QoS policies which will be used for
+     * newly created DomainParticipant entities in the case where the QoS policies are defaulted in the
+     * create_participant operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not, the operation
+     * will have no effect and return INCONSISTENT_POLICY.
+     *
+     * The special value PARTICIPANT_QOS_DEFAULT may be passed to this operation to indicate that the default
+     * QoS should be reset back to the initial values the factory would use, that is the values that would be
+     * used if the set_default_participant_qos operation had never been called.
+     *
+     * @param qos DomainParticipantQos to be set
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_participant_qos(
+            const DomainParticipantQos& qos);
+
+    /**
+     * Remove a Participant and all associated publishers and subscribers.
+     * @param part Pointer to the participant.
+     * @return RETCODE_PRECONDITION_NOT_MET if the participant has active entities, RETCODE_OK if the participant is correctly
+     * deleted and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t delete_participant(
+            DomainParticipant* part);
+
+    /**
+     * Load profiles from default XML file.
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t load_profiles();
+
+    /**
+     * Load profiles from XML file.
+     * @param xml_profile_file XML profile file.
+     * @return RETCODE_OK if it is correctly loaded, RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t load_XML_profiles_file(
+            const std::string& xml_profile_file);
+
+    /**
+     * This operation returns the value of the DomainParticipantFactory QoS policies.
+     * @param qos DomaParticipantFactoryQos reference where the qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            DomainParticipantFactoryQos& qos) const;
+
+    /**
+     * This operation sets the value of the DomainParticipantFactory QoS policies. These policies
+     * control the behavior of the object a factory for entities.
+     *
+     * Note that despite having QoS, the DomainParticipantFactory is not an Entity.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not,
+     * the operation will have no effect and return INCONSISTENT_POLICY.
+     * @param qos DomainParticipantFactoryQos to be set.
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const DomainParticipantFactoryQos& qos);
+
+private:
+
+    friend class DomainParticipantFactoryReleaser;
+    friend class DomainParticipant;
+
+    std::map<DomainId_t, std::vector<DomainParticipantImpl*> > participants_;
+
+    DomainParticipantFactory();
+
+    virtual ~DomainParticipantFactory();
+
+    void reset_default_participant_qos();
+
+    static bool delete_instance();
+
+    static void set_qos(
+            DomainParticipantFactoryQos& to,
+            const DomainParticipantFactoryQos& from,
+            bool first_time);
+
+    static ReturnCode_t check_qos(
+            const DomainParticipantFactoryQos& qos);
+
+    static bool can_qos_be_updated(
+            const DomainParticipantFactoryQos& to,
+            const DomainParticipantFactoryQos& from);
+
+    void participant_has_been_deleted(
+            DomainParticipantImpl* part);
+
+    mutable std::mutex mtx_participants_;
+
+    mutable bool default_xml_profiles_loaded;
+
+    DomainParticipantFactoryQos factory_qos_;
+
+    DomainParticipantQos default_participant_qos_;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_DOMAINPARTICIPANT_HPP_*/

+ 169 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/domain/DomainParticipantListener.hpp

@@ -0,0 +1,169 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DomainParticipantListener.hpp
+ *
+ */
+
+#ifndef __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__
+#define __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__
+
+#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.h>
+#include <fastdds/rtps/reader/ReaderDiscoveryInfo.h>
+#include <fastdds/rtps/writer/WriterDiscoveryInfo.h>
+#include <fastdds/dds/publisher/PublisherListener.hpp>
+#include <fastdds/dds/subscriber/SubscriberListener.hpp>
+#include <fastdds/dds/topic/TopicListener.hpp>
+
+#include <fastrtps/types/TypeIdentifier.h>
+#include <fastrtps/types/TypeObject.h>
+#include <fastrtps/types/DynamicTypePtr.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+
+/**
+ * Class DomainParticipantListener, overrides behaviour towards certain events.
+ * @ingroup FASTDDS_MODULE
+ */
+class DomainParticipantListener :
+    public PublisherListener,
+    public SubscriberListener,
+    public TopicListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    DomainParticipantListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~DomainParticipantListener()
+    {
+    }
+
+    /*!
+     * This method is called when a new Participant is discovered, or a previously discovered participant changes
+     * its QOS or is removed.
+     * @param participant Pointer to the Participant which discovered the remote participant.
+     * @param info Remote participant information. User can take ownership of the object.
+     */
+    virtual void on_participant_discovery(
+            DomainParticipant* participant,
+            fastrtps::rtps::ParticipantDiscoveryInfo&& info)
+    {
+        (void)participant, (void)info;
+    }
+
+#if HAVE_SECURITY
+    /*!
+     * This method is called when a new Participant is authenticated.
+     * @param participant Pointer to the authenticated Participant.
+     * @param info Remote participant authentication information. User can take ownership of the object.
+     */
+    virtual void onParticipantAuthentication(
+            DomainParticipant* participant,
+            fastrtps::rtps::ParticipantAuthenticationInfo&& info)
+    {
+        (void)participant, (void)info;
+    }
+
+#endif
+
+    /*!
+     * This method is called when a new Subscriber is discovered, or a previously discovered subscriber changes
+     * its QOS or is removed.
+     * @param participant Pointer to the Participant which discovered the remote subscriber.
+     * @param info Remote subscriber information. User can take ownership of the object.
+     */
+    virtual void on_subscriber_discovery(
+            DomainParticipant* participant,
+            fastrtps::rtps::ReaderDiscoveryInfo&& info)
+    {
+        (void)participant, (void)info;
+    }
+
+    /*!
+     * This method is called when a new Publisher is discovered, or a previously discovered publisher changes
+     * its QOS or is removed.
+     * @param participant Pointer to the Participant which discovered the remote publisher.
+     * @param info Remote publisher information. User can take ownership of the object.
+     */
+    virtual void on_publisher_discovery(
+            DomainParticipant* participant,
+            fastrtps::rtps::WriterDiscoveryInfo&& info)
+    {
+        (void)participant, (void)info;
+    }
+
+    /*!
+     * This method is called when a participant discovers a new Type
+     * The ownership of all object belongs to the caller so if needs to be used after the
+     * method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature.
+     * For example:
+     * fastrtps::types::TypeIdentifier new_type_id = *identifier;
+     */
+    virtual void on_type_discovery(
+            DomainParticipant* participant,
+            const fastrtps::rtps::SampleIdentity& request_sample_id,
+            const fastrtps::string_255& topic,
+            const fastrtps::types::TypeIdentifier* identifier,
+            const fastrtps::types::TypeObject* object,
+            fastrtps::types::DynamicType_ptr dyn_type)
+    {
+        (void)participant, (void)request_sample_id, (void)topic, (void)identifier, (void)object, (void)dyn_type;
+    }
+
+    /*!
+     * This method is called when the typelookup client received a reply to a getTypeDependencies request.
+     * The user may want to retrieve these new types using the getTypes request and create a new
+     * DynamicType using the retrieved TypeObject.
+     */
+    virtual void on_type_dependencies_reply(
+            DomainParticipant* participant,
+            const fastrtps::rtps::SampleIdentity& request_sample_id,
+            const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies)
+    {
+        (void)participant, (void)request_sample_id, (void)dependencies;
+    }
+
+    /*!
+     * This method is called when a participant receives a TypeInformation while discovering another participant.
+     */
+    virtual void on_type_information_received(
+            DomainParticipant* participant,
+            const fastrtps::string_255 topic_name,
+            const fastrtps::string_255 type_name,
+            const fastrtps::types::TypeInformation& type_information)
+    {
+        (void)participant, (void)topic_name, (void)type_name, (void)type_information;
+    }
+
+    // TODO: Methods in DomainParticipantListener (p.33 - DDS)
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__

+ 97 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp

@@ -0,0 +1,97 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DomainParticipantFactoryQos.hpp
+ *
+ */
+
+#ifndef _FASTDDS_PARTICIPANTFACTORYQOS_HPP_
+#define _FASTDDS_PARTICIPANTFACTORYQOS_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class DomainParticipantFactoryQos, contains all the possible Qos that can be set for a determined participant.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class DomainParticipantFactoryQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DomainParticipantFactoryQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~DomainParticipantFactoryQos()
+    {
+    }
+
+    bool operator ==(
+            const DomainParticipantFactoryQos& b) const
+    {
+        return (this->entity_factory_ == b.entity_factory());
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    const EntityFactoryQosPolicy& entity_factory() const
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    EntityFactoryQosPolicy& entity_factory()
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Setter for EntityFactoryQosPolicy
+     * @param entity_factory EntityFactoryQosPolicy
+     */
+    void entity_factory(
+            const EntityFactoryQosPolicy& entity_factory)
+    {
+        entity_factory_ = entity_factory;
+    }
+
+private:
+
+    //!EntityFactoryQosPolicy, implemented in the library.
+    EntityFactoryQosPolicy entity_factory_;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_PARTICIPANTFACTORYQOS_HPP_ */

+ 293 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp

@@ -0,0 +1,293 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DomainParticipantQos.hpp
+ *
+ */
+
+#ifndef _FASTDDS_PARTICIPANTQOS_HPP_
+#define _FASTDDS_PARTICIPANTQOS_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class DomainParticipantQos, contains all the possible Qos that can be set for a determined participant.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class DomainParticipantQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DomainParticipantQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~DomainParticipantQos()
+    {
+    }
+
+    bool operator ==(
+            const DomainParticipantQos& b) const
+    {
+        return (this->user_data_ == b.user_data()) &&
+               (this->entity_factory_ == b.entity_factory()) &&
+               (this->allocation_ == b.allocation()) &&
+               (this->properties_ == b.properties()) &&
+               (this->wire_protocol_ == b.wire_protocol()) &&
+               (this->transport_ == b.transport()) &&
+               (this->name_ == b.name());
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy reference
+     */
+    const UserDataQosPolicy& user_data() const
+    {
+        return user_data_;
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy reference
+     */
+    UserDataQosPolicy& user_data()
+    {
+        return user_data_;
+    }
+
+    /**
+     * Setter for UserDataQosPolicy
+     * @param value UserDataQosPolicy
+     */
+    void user_data(
+            const UserDataQosPolicy& value)
+    {
+        user_data_ = value;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    const EntityFactoryQosPolicy& entity_factory() const
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    EntityFactoryQosPolicy& entity_factory()
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Setter for EntityFactoryQosPolicy
+     * @param value EntityFactoryQosPolicy
+     */
+    void entity_factory(
+            const EntityFactoryQosPolicy& value)
+    {
+        entity_factory_ = value;
+    }
+
+    /**
+     * Getter for ParticipantResourceLimitsQos
+     * @return ParticipantResourceLimitsQos reference
+     */
+    const ParticipantResourceLimitsQos& allocation() const
+    {
+        return allocation_;
+    }
+
+    /**
+     * Getter for ParticipantResourceLimitsQos
+     * @return ParticipantResourceLimitsQos reference
+     */
+    ParticipantResourceLimitsQos& allocation()
+    {
+        return allocation_;
+    }
+
+    /**
+     * Setter for ParticipantResourceLimitsQos
+     * @param allocation ParticipantResourceLimitsQos
+     */
+    void allocation(
+            const ParticipantResourceLimitsQos& allocation)
+    {
+        allocation_ = allocation;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos reference
+     */
+    const PropertyPolicyQos& properties() const
+    {
+        return properties_;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos reference
+     */
+    PropertyPolicyQos& properties()
+    {
+        return properties_;
+    }
+
+    /**
+     * Setter for PropertyPolicyQos
+     * @param properties PropertyPolicyQos
+     */
+    void properties(
+            const PropertyPolicyQos& properties)
+    {
+        properties_ = properties;
+    }
+
+    /**
+     * Getter for WireProtocolConfigQos
+     * @return WireProtocolConfigQos reference
+     */
+    const WireProtocolConfigQos& wire_protocol() const
+    {
+        return wire_protocol_;
+    }
+
+    /**
+     * Getter for WireProtocolConfigQos
+     * @return WireProtocolConfigQos reference
+     */
+    WireProtocolConfigQos& wire_protocol()
+    {
+        return wire_protocol_;
+    }
+
+    /**
+     * Setter for WireProtocolConfigQos
+     * @param wire_protocol WireProtocolConfigQos
+     */
+    void wire_protocol(
+            const WireProtocolConfigQos& wire_protocol)
+    {
+        wire_protocol_ = wire_protocol;
+    }
+
+    /**
+     * Getter for TransportConfigQos
+     * @return TransportConfigQos reference
+     */
+    const TransportConfigQos& transport() const
+    {
+        return transport_;
+    }
+
+    /**
+     * Getter for TransportConfigQos
+     * @return TransportConfigQos reference
+     */
+    TransportConfigQos& transport()
+    {
+        return transport_;
+    }
+
+    /**
+     * Setter for TransportConfigQos
+     * @param transport TransportConfigQos
+     */
+    void transport(
+            const TransportConfigQos& transport)
+    {
+        transport_ = transport;
+    }
+
+    /**
+     * Getter for the Participant name
+     * @return name
+     */
+    const fastrtps::string_255& name() const
+    {
+        return name_;
+    }
+
+    /**
+     * Getter for the Participant name
+     * @return name
+     */
+    fastrtps::string_255& name()
+    {
+        return name_;
+    }
+
+    /**
+     * Setter for the Participant name
+     * @return value New name to be set
+     */
+    void name(
+            const fastrtps::string_255& value)
+    {
+        name_ = value;
+    }
+
+private:
+
+    //!UserData Qos, implemented in the library.
+    UserDataQosPolicy user_data_;
+
+    //!EntityFactory Qos, implemented in the library.
+    EntityFactoryQosPolicy entity_factory_;
+
+    //!Participant allocation limits
+    ParticipantResourceLimitsQos allocation_;
+
+    //!Property policies
+    PropertyPolicyQos properties_;
+
+    //!Wire Protocol options
+    WireProtocolConfigQos wire_protocol_;
+
+    //!Transport options
+    TransportConfigQos transport_;
+
+    //!Name of the participant.
+    fastrtps::string_255 name_ = "RTPSParticipant";
+
+};
+
+RTPS_DllAPI extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT;
+
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_PARTICIPANTQOS_HPP_ */

+ 60 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/log/Colors.hpp

@@ -0,0 +1,60 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Colors.hpp
+ */
+
+#ifndef _FASTRTPS_LOG_COLORS_H_
+#define _FASTRTPS_LOG_COLORS_H_
+
+
+#if defined(_WIN32)
+    #define C_DEF ""
+    #define C_RED ""
+    #define C_B_RED ""
+    #define C_GREEN ""
+    #define C_B_GREEN ""
+    #define C_YELLOW ""
+    #define C_B_YELLOW ""
+    #define C_BLUE ""
+    #define C_B_BLUE ""
+    #define C_MAGENTA ""
+    #define C_B_MAGENTA ""
+    #define C_CYAN ""
+    #define C_B_CYAN ""
+    #define C_WHITE ""
+    #define C_B_WHITE ""
+    #define C_BRIGHT ""
+#else
+    #define C_DEF "\033[m"
+    #define C_RED "\033[31m"
+    #define C_B_RED "\033[31;1m"
+    #define C_GREEN "\033[32m"
+    #define C_B_GREEN "\033[32;1m"
+    #define C_YELLOW "\033[33m"
+    #define C_B_YELLOW "\033[33;1m"
+    #define C_BLUE "\033[34m"
+    #define C_B_BLUE "\033[34;1m"
+    #define C_MAGENTA "\033[35m"
+    #define C_B_MAGENTA "\033[35;1m"
+    #define C_CYAN "\033[36m"
+    #define C_B_CYAN "\033[36;1m"
+    #define C_WHITE "\033[37m"
+    #define C_B_WHITE "\033[37;1m"
+    #define C_BRIGHT "\033[1m"
+#endif
+
+
+#endif /* _FASTRTPS_LOG_COLORS_H_ */

+ 77 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/log/FileConsumer.hpp

@@ -0,0 +1,77 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file FileConsumer.hpp
+ *
+ */
+
+#ifndef _FASTDDS_FILE_CONSUMER_HPP_
+#define _FASTDDS_FILE_CONSUMER_HPP_
+
+#include <fastdds/dds/log/Log.hpp>
+
+#include <fstream>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Log consumer that writes the log events to a file.
+ *
+ * @file FileConsumer.hpp
+ */
+class FileConsumer : public LogConsumer
+{
+public:
+
+    //! Default constructor: filename = "output.log", append = false.
+    RTPS_DllAPI FileConsumer();
+
+    /** Constructor with parameters.
+     * @param filename path of the output file where the log will be wrote.
+     * @param append indicates if the consumer must append the content in the filename.
+     */
+    RTPS_DllAPI FileConsumer(
+            const std::string& filename,
+            bool append = false);
+
+    /** \internal
+     * Called by Log to ask us to consume the Entry.
+     * @param Log::Entry to consume.
+     */
+    RTPS_DllAPI virtual void Consume(
+            const Log::Entry&);
+
+    virtual ~FileConsumer();
+
+private:
+
+    void print_header(
+            const Log::Entry&);
+
+    void print_context(
+            const Log::Entry&);
+
+    std::string output_file_;
+    std::ofstream file_;
+    bool append_;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_FILE_CONSUMER_HPP_

+ 321 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/log/Log.hpp

@@ -0,0 +1,321 @@
+
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef _FASTDDS_LOG_LOG_HPP_
+#define _FASTDDS_LOG_LOG_HPP_
+
+#include <fastrtps/utils/DBQueue.h>
+#include <fastrtps/fastrtps_dll.h>
+#include <thread>
+#include <sstream>
+#include <atomic>
+#include <regex>
+
+/**
+ * eProsima log layer. Logging categories and verbosities can be specified dynamically at runtime. However, even on a category
+ * not covered by the current verbosity level, there is some overhead on calling a log macro. For maximum performance, you can
+ * opt out of logging any particular level by defining the following symbols:
+ *
+ * * define LOG_NO_ERROR
+ * * define LOG_NO_WARNING
+ * * define LOG_NO_INFO
+ *
+ * Additionally. the lowest level (Info) is disabled by default on release branches.
+ */
+
+// Logging API:
+
+//! Logs an info message. Disable it through Log::SetVerbosity, define LOG_NO_INFO, or being in a release branch
+#define logInfo(cat, msg) logInfo_(cat, msg)
+//! Logs a warning. Disable reporting through Log::SetVerbosity or define LOG_NO_WARNING
+#define logWarning(cat, msg) logWarning_(cat, msg)
+//! Logs an error. Disable reporting through define LOG_NO_ERROR
+#define logError(cat, msg) logError_(cat, msg)
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class LogConsumer;
+
+/**
+ * Logging utilities.
+ * Logging is accessed through the three macros above, and configuration on the log output
+ * can be achieved through static methods on the class. Logging at various levels can be
+ * disabled dynamically (through the Verbosity level) or statically (through the LOG_NO_[VERB]
+ * macros) for maximum performance.
+ * @ingroup COMMON_MODULE
+ */
+class Log
+{
+public:
+
+    /**
+     * Types of log entry.
+     * * Error: Maximum priority. Can only be disabled statically through LOG_NO_ERROR.
+     * * Warning: Medium priority.  Can be disabled statically and dynamically.
+     * * Info: Low priority. Useful for debugging. Disabled by default on release branches.
+     */
+    enum Kind
+    {
+        Error,
+        Warning,
+        Info,
+    };
+
+    /**
+     * Registers an user defined consumer to route log output.
+     * There is a default stdout consumer active as default.
+     * @param consumer r-value to a consumer unique_ptr. It will be invalidated after the call.
+     */
+    RTPS_DllAPI static void RegisterConsumer(
+            std::unique_ptr<LogConsumer>&& consumer);
+
+    //! Removes all registered consumers, including the default stdout.
+    RTPS_DllAPI static void ClearConsumers();
+
+    //! Enables the reporting of filenames in log entries. Disabled by default.
+    RTPS_DllAPI static void ReportFilenames(
+            bool);
+
+    //! Enables the reporting of function names in log entries. Enabled by default when supported.
+    RTPS_DllAPI static void ReportFunctions(
+            bool);
+
+    //! Sets the verbosity level, allowing for messages equal or under that priority to be logged.
+    RTPS_DllAPI static void SetVerbosity(
+            Log::Kind);
+
+    //! Returns the current verbosity level.
+    RTPS_DllAPI static Log::Kind GetVerbosity();
+
+    //! Sets a filter that will pattern-match against log categories, dropping any unmatched categories.
+    RTPS_DllAPI static void SetCategoryFilter(
+            const std::regex&);
+
+    //! Sets a filter that will pattern-match against filenames, dropping any unmatched categories.
+    RTPS_DllAPI static void SetFilenameFilter(
+            const std::regex&);
+
+    //! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories.
+    RTPS_DllAPI static void SetErrorStringFilter(
+            const std::regex&);
+
+    //! Returns the logging engine to configuration defaults.
+    RTPS_DllAPI static void Reset();
+
+    //! Waits until no more log info is availabel
+    RTPS_DllAPI static void Flush();
+
+    //! Stops the logging thread. It will re-launch on the next call to a successful log macro.
+    RTPS_DllAPI static void KillThread();
+
+    // Note: In VS2013, if you're linking this class statically, you will have to call KillThread before leaving
+    // main, due to an unsolved MSVC bug.
+
+    struct Context
+    {
+        const char* filename;
+        int line;
+        const char* function;
+        const char* category;
+    };
+
+    struct Entry
+    {
+        std::string message;
+        Log::Context context;
+        Log::Kind kind;
+        std::string timestamp;
+    };
+
+    /**
+     * Not recommended to call this method directly! Use the following macros:
+     *  * logInfo(cat, msg);
+     *  * logWarning(cat, msg);
+     *  * logError(cat, msg);
+     */
+    RTPS_DllAPI static void QueueLog(
+            const std::string& message,
+            const Log::Context&,
+            Log::Kind);
+
+private:
+
+    struct Resources
+    {
+        fastrtps::DBQueue<Entry> logs;
+        std::vector<std::unique_ptr<LogConsumer> > consumers;
+        std::unique_ptr<std::thread> logging_thread;
+
+        // Condition variable segment.
+        std::condition_variable cv;
+        std::mutex cv_mutex;
+        bool logging;
+        bool work;
+        int current_loop;
+
+        // Context configuration.
+        std::mutex config_mutex;
+        bool filenames;
+        bool functions;
+        std::unique_ptr<std::regex> category_filter;
+        std::unique_ptr<std::regex> filename_filter;
+        std::unique_ptr<std::regex> error_string_filter;
+
+        std::atomic<Log::Kind> verbosity;
+
+        Resources();
+
+        ~Resources();
+    };
+
+    static struct Resources resources_;
+
+    // Applies transformations to the entries compliant with the options selected (such as
+    // erasure of certain context information, or filtering by category. Returns false
+    // if the log entry is blacklisted.
+    static bool preprocess(
+            Entry&);
+
+    static void run();
+
+    static void get_timestamp(
+            std::string&);
+};
+
+/**
+ * Consumes a log entry to output it somewhere.
+ */
+class LogConsumer
+{
+public:
+
+    virtual ~LogConsumer()
+    {
+    }
+
+    virtual void Consume(
+            const Log::Entry&) = 0;
+
+protected:
+
+    void print_timestamp(
+            std::ostream& stream,
+            const Log::Entry&,
+            bool color) const;
+
+    void print_header(
+            std::ostream& stream,
+            const Log::Entry&,
+            bool color) const;
+
+    void print_context(
+            std::ostream& stream,
+            const Log::Entry&,
+            bool color) const;
+
+    void print_message(
+            std::ostream& stream,
+            const Log::Entry&,
+            bool color) const;
+
+    void print_new_line(
+            std::ostream& stream,
+            bool color) const;
+};
+
+#if defined(WIN32)
+#define __func__ __FUNCTION__
+#endif
+
+#ifndef LOG_NO_ERROR
+#define logError_(cat, msg)                                                                          \
+    {                                                                                                \
+        using namespace eprosima::fastdds::dds;                                                      \
+        std::stringstream ss;                                                                        \
+        ss << msg;                                                                                   \
+        Log::QueueLog(ss.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Error); \
+    }
+#elif (defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG))
+#define logError_(cat, msg)        \
+    {                              \
+        auto tmp_lambda = [&]()    \
+                {                          \
+                    std::stringstream ss;  \
+                    ss << msg;             \
+                };                         \
+        (void)tmp_lambda;          \
+    }
+#else
+#define logError_(cat, msg)
+#endif
+
+#ifndef LOG_NO_WARNING
+#define logWarning_(cat, msg)                                                                              \
+    {                                                                                                      \
+        using namespace eprosima::fastdds::dds;                                                            \
+        if (Log::GetVerbosity() >= Log::Kind::Warning)                                                     \
+        {                                                                                                  \
+            std::stringstream ss;                                                                          \
+            ss << msg;                                                                                     \
+            Log::QueueLog(ss.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Warning); \
+        }                                                                                                  \
+    }
+#elif (defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG))
+#define logWarning_(cat, msg)      \
+    {                              \
+        auto tmp_lambda = [&]()    \
+                {                          \
+                    std::stringstream ss;  \
+                    ss << msg;             \
+                };                         \
+        (void)tmp_lambda;          \
+    }
+#else
+#define logWarning_(cat, msg)
+#endif
+
+#if (defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG)) && (defined(_DEBUG) || defined(__DEBUG)) && \
+    (!defined(LOG_NO_INFO))
+#define logInfo_(cat, msg)                                                                              \
+    {                                                                                                   \
+        using namespace eprosima::fastdds::dds;                                                         \
+        if (Log::GetVerbosity() >= Log::Kind::Info)                                                     \
+        {                                                                                               \
+            std::stringstream ss;                                                                       \
+            ss << msg;                                                                                  \
+            Log::QueueLog(ss.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Info); \
+        }                                                                                               \
+    }
+#elif (defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG))
+#define logInfo_(cat, msg)         \
+    {                              \
+        auto tmp_lambda = [&]()    \
+                {                          \
+                    std::stringstream ss;  \
+                    ss << msg;             \
+                };                         \
+        (void)tmp_lambda;          \
+    }
+#else
+#define logInfo_(cat, msg)
+#endif
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif

+ 46 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/log/StdoutConsumer.hpp

@@ -0,0 +1,46 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _FASTDDS_STDOUT_CONSUMER_HPP_
+#define _FASTDDS_STDOUT_CONSUMER_HPP_
+
+#include <fastdds/dds/log/Log.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class StdoutConsumer : public LogConsumer
+{
+public:
+
+    virtual ~StdoutConsumer() {}
+
+    RTPS_DllAPI virtual void Consume(
+            const Log::Entry&);
+
+private:
+
+    void print_header(
+            const Log::Entry&) const;
+
+    void print_context(
+            const Log::Entry&) const;
+};
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif

+ 309 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/DataWriter.hpp

@@ -0,0 +1,309 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataWriter.hpp
+ */
+
+#ifndef _FASTRTPS_DATAWRITER_HPP_
+#define _FASTRTPS_DATAWRITER_HPP_
+
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastrtps/qos/DeadlineMissedStatus.h>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+#include <fastrtps/types/TypesBase.h>
+#include <fastdds/dds/core/Entity.hpp>
+#include <fastdds/dds/core/status/StatusMask.hpp>
+#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace eprosima {
+namespace fastrtps {
+
+class TopicAttributes;
+
+namespace rtps {
+
+class WriteParams;
+class WriterAttributes;
+struct InstanceHandle_t;
+struct GUID_t;
+
+} // namespace rtps
+
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class PublisherListener;
+class PublisherImpl;
+class Publisher;
+
+class TypeSupport;
+
+class DataWriterImpl;
+class DataWriterListener;
+class DataWriterQos;
+class Topic;
+
+/**
+ * Class DataWriter, contains the actual implementation of the behaviour of the DataWriter.
+ * @ingroup FASTDDS_MODULE
+ */
+class DataWriter : public DomainEntity
+{
+    friend class PublisherImpl;
+    friend class DataWriterImpl;
+
+    /**
+     * Create a data writer, assigning its pointer to the associated writer.
+     * Don't use directly, create Publisher using DomainRTPSParticipant static function.
+     */
+    RTPS_DllAPI DataWriter(
+            DataWriterImpl* impl,
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI DataWriter(
+            Publisher* pub,
+            Topic* topic,
+            const DataWriterQos& qos = DATAWRITER_QOS_DEFAULT,
+            DataWriterListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+public:
+
+    RTPS_DllAPI virtual ~DataWriter();
+
+    /**
+     * @brief This operation enables the DataWriter
+     * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the Publisher creating this
+     *         DataWriter is not enabled.
+     */
+    RTPS_DllAPI ReturnCode_t enable() override;
+
+    /**
+     * Write data to the topic.
+     * @param data Pointer to the data
+     * @return True if correct, false otherwise
+     */
+    RTPS_DllAPI bool write(
+            void* data);
+
+    /**
+     * Write data with params to the topic.
+     * @param data Pointer to the data
+     * @param params Extra write parameters.
+     * @return True if correct, false otherwise
+     */
+    RTPS_DllAPI bool write(
+            void* data,
+            fastrtps::rtps::WriteParams& params);
+
+    /**
+     * Write data with handle.
+     *
+     * The special value HANDLE_NIL can be used for the parameter handle.This indicates that the identity of the
+     * instance should be automatically deduced from the instance_data (by means of the key).
+     *
+     * @param data Pointer to the data
+     * @param handle InstanceHandle_t.
+     * @return RETCODE_PRECONDITION_NOT_MET if the handle introduced does not match with the one associated to the data,
+     * RETCODE_OK if the data is correctly sent and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t write(
+            void* data,
+            const fastrtps::rtps::InstanceHandle_t& handle);
+
+    /*!
+     * @brief Informs that the application will be modifying a particular instance.
+     * It gives an opportunity to the middleware to pre-configure itself to improve performance.
+     * @param[in] instance Sample used to get the instance's key.
+     * @return Handle containing the instance's key.
+     * This handle could be used in successive `write` or `dispose` operations.
+     * In case of error, HANDLE_NIL will be returned.
+     */
+    RTPS_DllAPI fastrtps::rtps::InstanceHandle_t register_instance(
+            void* instance);
+
+    /*!
+     * @brief This operation reverses the action of `register_instance`.
+     * It should only be called on an instance that is currently registered.
+     * Informs the middleware that the DataWriter is not intending to modify any more of that data instance.
+     * Also indicates that the middleware can locally remove all information regarding that instance.
+     * @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
+     * @param[in] handle Instance's key to be unregistered.
+     * @return Returns the operation's result.
+     * If the operation finishes successfully, ReturnCode_t::RETCODE_OK is returned.
+     */
+    RTPS_DllAPI ReturnCode_t unregister_instance(
+            void* instance,
+            const fastrtps::rtps::InstanceHandle_t& handle);
+
+    /**
+     * Returns the DataWriter's GUID
+     * @return Reference to the DataWriter GUID
+     */
+    RTPS_DllAPI const fastrtps::rtps::GUID_t& guid();
+
+    /**
+     * Returns the DataWriter's InstanceHandle
+     * @return Copy of the DataWriter InstanceHandle
+     */
+    RTPS_DllAPI fastrtps::rtps::InstanceHandle_t get_instance_handle() const;
+
+    /**
+     * Get data type associated to the DataWriter
+     * @return Copy of the TypeSupport
+     */
+    RTPS_DllAPI TypeSupport get_type() const;
+
+    /**
+     * Waits the current thread until all writers have received their acknowledgments.
+     * @param max_wait Maximum blocking time for this operation
+     * @return RETCODE_OK if the DataWriter receive the acknowledgments before the time expires and RETCODE_ERROR otherwise
+     */
+    RTPS_DllAPI ReturnCode_t wait_for_acknowledgments(
+            const fastrtps::Duration_t& max_wait);
+
+    /**
+     * @brief Returns the offered deadline missed status
+     * @param status Deadline missed status struct
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_offered_deadline_missed_status(
+            fastrtps::OfferedDeadlineMissedStatus& status);
+
+    /**
+     * Establishes the DataWriterQos for this DataWriter.
+     * @param qos DataWriterQos to be set
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const DataWriterQos& qos);
+
+    /**
+     * Retrieves the DataWriterQos for this DataWriter.
+     * @return Reference to the current DataWriterQos
+     */
+    RTPS_DllAPI const DataWriterQos& get_qos() const;
+
+    /**
+     * Fills the DataWriterQos with the values of this DataWriter.
+     * @param qos DataWriterQos object where the qos is returned.
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            DataWriterQos& qos) const;
+
+    /**
+     * Retrieves the topic for this DataWriter.
+     * @return Pointer to the associated Topic
+     */
+    RTPS_DllAPI Topic* get_topic() const;
+
+    /**
+     * Retrieves the listener for this DataWriter.
+     * @return Pointer to the DataWriterListener
+     */
+    RTPS_DllAPI const DataWriterListener* get_listener() const;
+
+    /**
+     * Establishes the listener for this DataWriter.
+     * @param listener Pointer to DataWriterListener to be set
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            DataWriterListener* listener);
+
+    /* TODO
+       bool get_key_value(
+            void* key_holder,
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /**
+     * @brief This operation requests the middleware to delete the data (the actual deletion is postponed until there is no
+     * more use for that data in the whole system). In general, applications are made aware of the deletion by means of
+     * operations on the DataReader objects that already knew that instance. This operation does not modify the value of
+     * the instance. The instance parameter is passed just for the purposes of identifying the instance.
+     * When this operation is used, the Service will automatically supply the value of the source_timestamp that is made
+     * available to DataReader objects by means of the source_timestamp attribute inside the SampleInfo. The constraints
+     * on the values of the handle parameter and the corresponding error behavior are the same specified for the
+     * unregister_instance operation.
+     * @param[in] data Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
+     * @param[in] handle InstanceHandle of the data
+     * @return RETCODE_PRECONDITION_NOT_MET if the handle introduced does not match with the one associated to the data,
+     * RETCODE_OK if the data is correctly sent and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t dispose(
+            void* data,
+            const fastrtps::rtps::InstanceHandle_t& handle);
+
+    /**
+     * @brief Returns the liveliness lost status
+     * @param status Liveliness lost status struct
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_liveliness_lost_status(
+            LivelinessLostStatus& status);
+
+    /* TODO
+       bool get_offered_incompatible_qos_status(
+            OfferedIncompatibleQosStatus& status)
+       {
+        // Not implemented
+        (void)status;
+        return false;
+       }
+     */
+
+    /**
+     * @brief Getter for the Publisher that creates this DataWriter
+     * @return Pointer to the Publisher
+     */
+    RTPS_DllAPI const Publisher* get_publisher() const;
+
+    /**
+     * @brief This operation manually asserts the liveliness of the DataWriter. This is used in combination with the
+     * LivelinessQosPolicy to indicate to the Service that the entity remains active.
+     * This operation need only be used if the LIVELINESS setting is either MANUAL_BY_PARTICIPANT or MANUAL_BY_TOPIC.
+     * Otherwise, it has no effect.
+     * @note Writing data via the write operation on a DataWriter asserts liveliness on the DataWriter itself and its
+     * DomainParticipant. Consequently the use of assert_liveliness is only needed if the application is not writing data
+     * regularly.
+     * @return RETCODE_OK if asserted, RETCODE_ERROR otherwise
+     */
+    RTPS_DllAPI ReturnCode_t assert_liveliness();
+
+    /**
+     * @brief Clears the DataWriter history
+     * @param removed size_t pointer to return the size of the data removed
+     * @return RETCODE_OK if the samples are removed and RETCODE_ERROR otherwise
+     */
+    RTPS_DllAPI ReturnCode_t clear_history(
+            size_t* removed);
+
+private:
+
+    DataWriterImpl* impl_;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif //_FASTRTPS_DATAWRITER_HPP_

+ 114 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/DataWriterListener.hpp

@@ -0,0 +1,114 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataWriterListener.hpp
+ */
+
+#ifndef _FASTRTPS_DATAWRITERLISTENER_HPP_
+#define _FASTRTPS_DATAWRITERLISTENER_HPP_
+
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+#include <fastdds/dds/core/status/PublicationMatchedStatus.hpp>
+#include <fastdds/dds/core/status/IncompatibleQosStatus.hpp>
+#include <fastdds/dds/core/status/DeadlineMissedStatus.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DataWriter;
+
+/**
+ * Class DataWriterListener, allows the end user to implement callbacks triggered by certain events.
+ * @ingroup FASTDDS_MODULE
+ */
+class RTPS_DllAPI DataWriterListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    DataWriterListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~DataWriterListener()
+    {
+    }
+
+    /**
+     * This method is called when the Publisher is matched (or unmatched) against an endpoint.
+     * @param writer Pointer to the associated Publisher
+     * @param info Information regarding the matched subscriber
+     */
+    virtual void on_publication_matched(
+            DataWriter* writer,
+            const PublicationMatchedStatus& info)
+    {
+        (void)writer;
+        (void)info;
+    }
+
+    /**
+     * A method called when a deadline is missed
+     * @param writer Pointer to the associated Publisher
+     * @param status The deadline missed status
+     */
+    virtual void on_offered_deadline_missed(
+            DataWriter* writer,
+            const OfferedDeadlineMissedStatus& status)
+    {
+        (void)writer;
+        (void)status;
+    }
+
+    /**
+     * A method called when an incompatible QoS is offered
+     * @param writer Pointer to the associated Publisher
+     * @param status The deadline missed status
+     */
+    virtual void on_offered_incompatible_qos(
+            DataWriter* writer,
+            const OfferedIncompatibleQosStatus& status)
+    {
+        (void)writer;
+        (void)status;
+    }
+
+    /**
+     * @brief Method called when the livelivess of a publisher is lost
+     * @param writer The publisher
+     * @param status The liveliness lost status
+     */
+    virtual void on_liveliness_lost(
+            DataWriter* writer,
+            const LivelinessLostStatus& status)
+    {
+        (void)writer;
+        (void)status;
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTRTPS_DATAWRITERLISTENER_HPP_ */

+ 303 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/Publisher.hpp

@@ -0,0 +1,303 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Publisher.hpp
+ *
+ */
+
+#ifndef _FASTDDS_PUBLISHER_HPP_
+#define _FASTDDS_PUBLISHER_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastrtps/attributes/PublisherAttributes.h>
+#include <fastrtps/types/TypesBase.h>
+#include <fastdds/dds/core/Entity.hpp>
+#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
+#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace dds {
+namespace pub {
+class Publisher;
+}
+}
+
+namespace eprosima {
+namespace fastrtps {
+
+class TopicAttributes;
+
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+class PublisherListener;
+class PublisherImpl;
+class DataWriter;
+class DataWriterListener;
+class Topic;
+
+/**
+ * Class Publisher, used to send data to associated subscribers.
+ * @ingroup FASTDDS_MODULE
+ */
+class Publisher : public DomainEntity
+{
+    friend class PublisherImpl;
+    friend class DomainParticipantImpl;
+
+    /**
+     * Create a publisher, assigning its pointer to the associated writer.
+     * Don't use directly, create Publisher using create_publisher from Participant.
+     */
+    RTPS_DllAPI Publisher(
+            PublisherImpl* p,
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI Publisher(
+            DomainParticipant* dp,
+            const PublisherQos& qos = PUBLISHER_QOS_DEFAULT,
+            PublisherListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+public:
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~Publisher();
+
+    /**
+     * @brief This operation enables the Publisher
+     * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the participant creating this
+     *         Publisher is not enabled.
+     */
+    RTPS_DllAPI ReturnCode_t enable() override;
+
+    /**
+     * Allows accessing the Publisher Qos.
+     * @return PublisherQos reference
+     */
+    RTPS_DllAPI const PublisherQos& get_qos() const;
+
+    /**
+     * Retrieves the Publisher Qos.
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            PublisherQos& qos) const;
+
+    /**
+     * Allows modifying the Publisher Qos.
+     * The given Qos must be supported by the PublisherQos.
+     * @param qos PublisherQos to be set
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const PublisherQos& qos);
+
+    /**
+     * Retrieves the attached PublisherListener.
+     * @return PublisherListener pointer
+     */
+    RTPS_DllAPI const PublisherListener* get_listener() const;
+
+    /**
+     * Modifies the PublisherListener.
+     * @param listener PublisherListener pointer
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            PublisherListener* listener);
+
+    /**
+     * This operation creates a DataWriter. The returned DataWriter will be attached and belongs to the Publisher.
+     * @param topic Topic the DataWriter will be listening
+     * @param qos QoS of the DataWriter.
+     * @param listener Pointer to the listener (default: nullptr).
+     * @param mask StatusMask (default: all).
+     * @return Pointer to the created DataWriter. nullptr if failed.
+     */
+    RTPS_DllAPI DataWriter* create_datawriter(
+            Topic* topic,
+            const DataWriterQos& qos,
+            DataWriterListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * This operation creates a DataWriter. The returned DataWriter will be attached and belongs to the Publisher.
+     * @param topic Topic the DataWriter will be listening
+     * @param profile_name DataWriter profile name.
+     * @param listener Pointer to the listener (default: nullptr).
+     * @param mask StatusMask (default: all).
+     * @return Pointer to the created DataWriter. nullptr if failed.
+     */
+    RTPS_DllAPI DataWriter* create_datawriter_with_profile(
+            Topic* topic,
+            const std::string& profile_name,
+            DataWriterListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * This operation deletes a DataWriter that belongs to the Publisher.
+     *
+     * The delete_datawriter operation must be called on the same Publisher object used to create the DataWriter.
+     * If delete_datawriter is called on a different Publisher, the operation will have no effect and it will
+     * return false.
+     *
+     * The deletion of the DataWriter will automatically unregister all instances.
+     * Depending on the settings of the WRITER_DATA_LIFECYCLE QosPolicy, the deletion of the DataWriter
+     * may also dispose all instances.
+     * @param writer DataWriter to delete
+     * @return RETCODE_PRECONDITION_NOT_MET if it does not belong to this Publisher, RETCODE_OK if it is correctly deleted and
+     * RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t delete_datawriter(
+            DataWriter* writer);
+
+    /**
+     * This operation retrieves a previously created DataWriter belonging to the Publisher that is attached to a
+     * Topic with a matching topic_name. If no such DataWriter exists, the operation will return nullptr.
+     *
+     * If multiple DataWriter attached to the Publisher satisfy this condition, then the operation will return
+     * one of them. It is not specified which one.
+     * @param topic_name Name of the Topic
+     * @return Pointer to a previously created DataWriter associated to a Topic with the requested topic_name
+     */
+    RTPS_DllAPI DataWriter* lookup_datawriter(
+            const std::string& topic_name) const;
+
+    /**
+     * Fills the given vector with all the datawriters of this publisher.
+     * @param writers Vector where the DataWriters are returned
+     * @return true
+     */
+    RTPS_DllAPI bool get_datawriters(
+            std::vector<DataWriter*>& writers) const;
+
+    /**
+     * This operation checks if the publisher has DataWriters
+     * @return true if the publisher has one or several DataWriters, false otherwise
+     */
+    RTPS_DllAPI bool has_datawriters() const;
+
+    /* TODO
+       bool suspend_publications();
+     */
+
+    /* TODO
+       bool resume_publications();
+     */
+
+    /* TODO
+       bool begin_coherent_changes();
+     */
+
+    /* TODO
+       bool end_coherent_changes();
+     */
+
+    /**
+     * This operation blocks the calling thread until either all data written by the reliable DataWriter entities
+     * is acknowledged by all matched reliable DataReader entities, or else the duration specified by the max_wait
+     * parameter elapses, whichever happens first. A return value of true indicates that all the samples written
+     * have been acknowledged by all reliable matched data readers; a return value of false indicates that max_wait
+     * elapsed before all the data was acknowledged.
+     * @param max_wait Maximum blocking time for this operation
+     * @return RETCODE_TIMEOUT if the function takes more than the maximum blocking time established, RETCODE_OK if the
+     * Publisher receives the acknowledgments and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t wait_for_acknowledgments(
+            const fastrtps::Duration_t& max_wait);
+
+    /**
+     * This operation returns the DomainParticipant to which the Publisher belongs.
+     * @return Pointer to the DomainParticipant
+     */
+    RTPS_DllAPI const DomainParticipant* get_participant() const;
+
+    /* TODO
+       bool delete_contained_entities();
+     */
+
+    /**
+     * This operation sets a default value of the DataWriter QoS policies which will be used for newly created
+     * DataWriter entities in the case where the QoS policies are defaulted in the create_datawriter operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not, the operation
+     * will have no effect and return false.
+     *
+     * The special value DATAWRITER_QOS_DEFAULT may be passed to this operation to indicate that the default QoS
+     * should be reset back to the initial values the factory would use, that is the values that would be used
+     * if the set_default_datawriter_qos operation had never been called.
+     * @param qos DataWriterQos to be set
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_datawriter_qos(
+            const DataWriterQos& qos);
+
+    /**
+     * This operation returns the default value of the DataWriter QoS, that is, the QoS policies which will be used
+     * for newly created DataWriter entities in the case where the QoS policies are defaulted in the
+     * create_datawriter operation.
+     *
+     * The values retrieved by get_default_datawriter_qos will match the set of values specified on the last
+     * successful call to set_default_datawriter_qos, or else, if the call was never made, the default values.
+     * @return Current default WriterQos
+     */
+    RTPS_DllAPI const DataWriterQos& get_default_datawriter_qos() const;
+
+    /**
+     * This operation retrieves the default value of the DataWriter QoS, that is, the QoS policies which will be used
+     * for newly created DataWriter entities in the case where the QoS policies are defaulted in the
+     * create_datawriter operation.
+     *
+     * The values retrieved by get_default_datawriter_qos will match the set of values specified on the last
+     * successful call to set_default_datawriter_qos, or else, if the call was never made, the default values.
+     * @param qos Reference to the current default WriterQos.
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_datawriter_qos(
+            DataWriterQos& qos) const;
+
+    /* TODO
+       bool copy_from_topic_qos(
+            WriterQos& writer_qos,
+            const fastrtps::TopicAttributes& topic_qos) const;
+     */
+
+    /**
+     * Returns the Publisher's handle.
+     * @return InstanceHandle of this Publisher.
+     */
+    RTPS_DllAPI const fastrtps::rtps::InstanceHandle_t& get_instance_handle() const;
+
+private:
+
+    PublisherImpl* impl_;
+
+    friend class ::dds::pub::Publisher;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_PUBLISHER_HPP_ */

+ 62 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/PublisherListener.hpp

@@ -0,0 +1,62 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PublisherListener.hpp
+ */
+
+#ifndef _FASTDDS_PUBLISHERLISTENER_HPP_
+#define _FASTDDS_PUBLISHERLISTENER_HPP_
+
+#include <fastrtps/qos/DeadlineMissedStatus.h>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+#include <fastdds/dds/core/status/PublicationMatchedStatus.hpp>
+#include <fastdds/dds/publisher/DataWriterListener.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class Publisher;
+
+/**
+ * Class PublisherListener, allows the end user to implement callbacks triggered by certain events.
+ * It inherits all the DataWriterListener callbacks.
+ * @ingroup FASTDDS_MODULE
+ */
+class PublisherListener : public DataWriterListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI PublisherListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~PublisherListener()
+    {
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_PUBLISHERLISTENER_HPP_ */

+ 810 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/DataWriterQos.hpp

@@ -0,0 +1,810 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataWriterQos.hpp
+ */
+
+
+#ifndef _FASTDDS_DATAWRITERQOS_HPP
+#define _FASTDDS_DATAWRITERQOS_HPP
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+#include <fastdds/dds/publisher/qos/WriterQos.hpp>
+#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
+#include <fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp>
+#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
+#include <fastdds/dds/publisher/qos/WriterQos.hpp>
+#include <fastdds/dds/topic/qos/TopicQos.hpp>
+#include <fastdds/rtps/attributes/WriterAttributes.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+//! Qos Policy to configure the DisablePositiveACKsQos and the writer timing attributes
+class RTPSReliableWriterQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI RTPSReliableWriterQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~RTPSReliableWriterQos() = default;
+
+    bool operator ==(
+            const RTPSReliableWriterQos& b) const
+    {
+        return (this->times == b.times) &&
+               (this->disable_positive_acks == b.disable_positive_acks);
+    }
+
+    //!Writer Timing Attributes
+    fastrtps::rtps::WriterTimes times;
+
+    //!Disable positive acks QoS, implemented in the library.
+    DisablePositiveACKsQosPolicy disable_positive_acks;
+};
+
+/**
+ * Class DataWriterQos, containing all the possible Qos that can be set for a determined DataWriter.
+ * Although these values can be  and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class DataWriterQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DataWriterQos();
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI ~DataWriterQos() = default;
+
+    RTPS_DllAPI bool operator ==(
+            const DataWriterQos& b) const
+    {
+        return (this->durability_ == b.durability()) &&
+               (this->durability_service_ == b.durability_service()) &&
+               (this->deadline_ == b.deadline()) &&
+               (this->latency_budget_ == b.latency_budget()) &&
+               (this->liveliness_ == b.liveliness()) &&
+               (this->reliability_ == b.reliability()) &&
+               (this->destination_order_ == b.destination_order()) &&
+               (this->history_ == b.history()) &&
+               (this->resource_limits_ == b.resource_limits()) &&
+               (this->transport_priority_ == b.transport_priority()) &&
+               (this->lifespan_ == b.lifespan()) &&
+               (this->user_data_ == b.user_data()) &&
+               (this->ownership_ == b.ownership()) &&
+               (this->ownership_strength_ == b.ownership_strength()) &&
+               (this->writer_data_lifecycle_ == b.writer_data_lifecycle()) &&
+               (this->publish_mode_ == b.publish_mode()) &&
+               (this->representation_ == b.representation()) &&
+               (this->properties_ == b.properties()) &&
+               (this->reliable_writer_qos_ == b.reliable_writer_qos()) &&
+               (this->endpoint_ == b.endpoint()) &&
+               (this->writer_resource_limits_ == b.writer_resource_limits()) &&
+               (this->throughput_controller_ == b.throughput_controller());
+    }
+
+    RTPS_DllAPI WriterQos get_writerqos(
+            const PublisherQos& pqos,
+            const TopicQos& tqos) const;
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQosPolicy reference
+     */
+    RTPS_DllAPI DurabilityQosPolicy& durability()
+    {
+        return durability_;
+    }
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQosPolicy reference
+     */
+    RTPS_DllAPI const DurabilityQosPolicy& durability() const
+    {
+        return durability_;
+    }
+
+    /**
+     * Setter for DurabilityQosPolicy
+     * @param durability new value for the DurabilityQosPolicy
+     */
+    RTPS_DllAPI void durability(
+            const DurabilityQosPolicy& durability)
+    {
+        durability_ = durability;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQosPolicy reference
+     */
+    RTPS_DllAPI DurabilityServiceQosPolicy& durability_service()
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQosPolicy reference
+     */
+    RTPS_DllAPI const DurabilityServiceQosPolicy& durability_service() const
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Setter for DurabilityServiceQosPolicy
+     * @param durability_service new value for the DurabilityServiceQosPolicy
+     */
+    RTPS_DllAPI void durability_service(
+            const DurabilityServiceQosPolicy& durability_service)
+    {
+        durability_service_ = durability_service;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQosPolicy reference
+     */
+    RTPS_DllAPI DeadlineQosPolicy& deadline()
+    {
+        return deadline_;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQosPolicy reference
+     */
+    RTPS_DllAPI const DeadlineQosPolicy& deadline() const
+    {
+        return deadline_;
+    }
+
+    /**
+     * Setter for DeadlineQosPolicy
+     * @param deadline new value for the DeadlineQosPolicy
+     */
+    RTPS_DllAPI void deadline(
+            const DeadlineQosPolicy& deadline)
+    {
+        deadline_ = deadline;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQosPolicy reference
+     */
+    RTPS_DllAPI LatencyBudgetQosPolicy& latency_budget()
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQosPolicy reference
+     */
+    RTPS_DllAPI const LatencyBudgetQosPolicy& latency_budget() const
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Setter for LatencyBudgetQosPolicy
+     * @param latency_budget new value for the LatencyBudgetQosPolicy
+     */
+    RTPS_DllAPI void latency_budget(
+            const LatencyBudgetQosPolicy& latency_budget)
+    {
+        latency_budget_ = latency_budget;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQosPolicy reference
+     */
+    RTPS_DllAPI LivelinessQosPolicy& liveliness()
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQosPolicy reference
+     */
+    RTPS_DllAPI const LivelinessQosPolicy& liveliness() const
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Setter for LivelinessQosPolicy
+     * @param liveliness new value for the LivelinessQosPolicy
+     */
+    RTPS_DllAPI void liveliness(
+            const LivelinessQosPolicy& liveliness)
+    {
+        liveliness_ = liveliness;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQosPolicy reference
+     */
+    RTPS_DllAPI ReliabilityQosPolicy& reliability()
+    {
+        return reliability_;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQosPolicy reference
+     */
+    RTPS_DllAPI const ReliabilityQosPolicy& reliability() const
+    {
+        return reliability_;
+    }
+
+    /**
+     * Setter for ReliabilityQosPolicy
+     * @param reliability new value for the ReliabilityQosPolicy
+     */
+    RTPS_DllAPI void reliability(
+            const ReliabilityQosPolicy& reliability)
+    {
+        reliability_ = reliability;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQosPolicy reference
+     */
+    RTPS_DllAPI DestinationOrderQosPolicy& destination_order()
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQosPolicy reference
+     */
+    RTPS_DllAPI const DestinationOrderQosPolicy& destination_order() const
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Setter for DestinationOrderQosPolicy
+     * @param destination_order new value for the DestinationOrderQosPolicy
+     */
+    RTPS_DllAPI void destination_order(
+            const DestinationOrderQosPolicy& destination_order)
+    {
+        destination_order_ = destination_order;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQosPolicy reference
+     */
+    RTPS_DllAPI HistoryQosPolicy& history()
+    {
+        return history_;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQosPolicy reference
+     */
+    RTPS_DllAPI const HistoryQosPolicy& history() const
+    {
+        return history_;
+    }
+
+    /**
+     * Setter for HistoryQosPolicy
+     * @param history new value for the HistoryQosPolicy
+     */
+    RTPS_DllAPI void history(
+            const HistoryQosPolicy& history)
+    {
+        history_ = history;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQosPolicy reference
+     */
+    RTPS_DllAPI ResourceLimitsQosPolicy& resource_limits()
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQosPolicy reference
+     */
+    RTPS_DllAPI const ResourceLimitsQosPolicy& resource_limits() const
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Setter for ResourceLimitsQosPolicy
+     * @param resource_limits new value for the ResourceLimitsQosPolicy
+     */
+    RTPS_DllAPI void resource_limits(
+            const ResourceLimitsQosPolicy& resource_limits)
+    {
+        resource_limits_ = resource_limits;
+    }
+
+    /**
+     * Getter for TransportPriorityQosPolicy
+     * @return TransportPriorityQosPolicy reference
+     */
+    RTPS_DllAPI TransportPriorityQosPolicy& transport_priority()
+    {
+        return transport_priority_;
+    }
+
+    /**
+     * Getter for TransportPriorityQosPolicy
+     * @return TransportPriorityQosPolicy reference
+     */
+    RTPS_DllAPI const TransportPriorityQosPolicy& transport_priority() const
+    {
+        return transport_priority_;
+    }
+
+    /**
+     * Setter for TransportPriorityQosPolicy
+     * @param transport_priority new value for the TransportPriorityQosPolicy
+     */
+    RTPS_DllAPI void transport_priority(
+            const TransportPriorityQosPolicy& transport_priority)
+    {
+        transport_priority_ = transport_priority;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQosPolicy reference
+     */
+    RTPS_DllAPI LifespanQosPolicy& lifespan()
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQosPolicy reference
+     */
+    RTPS_DllAPI const LifespanQosPolicy& lifespan() const
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Setter for LifespanQosPolicy
+     * @param lifespan new value for the LifespanQosPolicy
+     */
+    RTPS_DllAPI void lifespan(
+            const LifespanQosPolicy& lifespan)
+    {
+        lifespan_ = lifespan;
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy reference
+     */
+    RTPS_DllAPI UserDataQosPolicy& user_data()
+    {
+        return user_data_;
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy reference
+     */
+    RTPS_DllAPI const UserDataQosPolicy& user_data() const
+    {
+        return user_data_;
+    }
+
+    /**
+     * Setter for UserDataQosPolicy
+     * @param user_data new value for the UserDataQosPolicy
+     */
+    RTPS_DllAPI void user_data(
+            const UserDataQosPolicy& user_data)
+    {
+        user_data_ = user_data;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQosPolicy reference
+     */
+    RTPS_DllAPI OwnershipQosPolicy& ownership()
+    {
+        return ownership_;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQosPolicy reference
+     */
+    RTPS_DllAPI const OwnershipQosPolicy& ownership() const
+    {
+        return ownership_;
+    }
+
+    /**
+     * Setter for OwnershipQosPolicy
+     * @param ownership new value for the OwnershipQosPolicy
+     */
+    RTPS_DllAPI void ownership(
+            const OwnershipQosPolicy& ownership)
+    {
+        ownership_ = ownership;
+    }
+
+    /**
+     * Getter for OwnershipStrengthQosPolicy
+     * @return OwnershipStrengthQosPolicy reference
+     */
+    RTPS_DllAPI OwnershipStrengthQosPolicy& ownership_strength()
+    {
+        return ownership_strength_;
+    }
+
+    /**
+     * Getter for OwnershipStrengthQosPolicy
+     * @return OwnershipStrengthQosPolicy reference
+     */
+    RTPS_DllAPI const OwnershipStrengthQosPolicy& ownership_strength() const
+    {
+        return ownership_strength_;
+    }
+
+    /**
+     * Setter for OwnershipStrengthQosPolicy
+     * @param ownership_strength new value for the OwnershipStrengthQosPolicy
+     */
+    RTPS_DllAPI void ownership_strength(
+            const OwnershipStrengthQosPolicy& ownership_strength)
+    {
+        ownership_strength_ = ownership_strength;
+    }
+
+    /**
+     * Getter for WriterDataLifecycleQosPolicy
+     * @return WriterDataLifecycleQosPolicy reference
+     */
+    RTPS_DllAPI WriterDataLifecycleQosPolicy& writer_data_lifecycle()
+    {
+        return writer_data_lifecycle_;
+    }
+
+    /**
+     * Getter for WriterDataLifecycleQosPolicy
+     * @return WriterDataLifecycleQosPolicy reference
+     */
+    RTPS_DllAPI const WriterDataLifecycleQosPolicy& writer_data_lifecycle() const
+    {
+        return writer_data_lifecycle_;
+    }
+
+    /**
+     * Setter for WriterDataLifecycleQosPolicy
+     * @param writer_data_lifecycle new value for the WriterDataLifecycleQosPolicy
+     */
+    RTPS_DllAPI void writer_data_lifecycle(
+            const WriterDataLifecycleQosPolicy& writer_data_lifecycle)
+    {
+        writer_data_lifecycle_ = writer_data_lifecycle;
+    }
+
+    /**
+     * Getter for PublishModeQosPolicy
+     * @return PublishModeQosPolicy reference
+     */
+    RTPS_DllAPI PublishModeQosPolicy& publish_mode()
+    {
+        return publish_mode_;
+    }
+
+    /**
+     * Getter for PublishModeQosPolicy
+     * @return PublishModeQosPolicy reference
+     */
+    RTPS_DllAPI const PublishModeQosPolicy& publish_mode() const
+    {
+        return publish_mode_;
+    }
+
+    /**
+     * Setter for PublishModeQosPolicy
+     * @param publish_mode new value for the PublishModeQosPolicy
+     */
+    RTPS_DllAPI void publish_mode(
+            const PublishModeQosPolicy& publish_mode)
+    {
+        publish_mode_ = publish_mode;
+    }
+
+    /**
+     * Getter for DataRepresentationQosPolicy
+     * @return DataRepresentationQosPolicy reference
+     */
+    RTPS_DllAPI DataRepresentationQosPolicy& representation()
+    {
+        return representation_;
+    }
+
+    /**
+     * Getter for DataRepresentationQosPolicy
+     * @return DataRepresentationQosPolicy reference
+     */
+    RTPS_DllAPI const DataRepresentationQosPolicy& representation() const
+    {
+        return representation_;
+    }
+
+    /**
+     * Setter for DataRepresentationQosPolicy
+     * @param representation new value for the DataRepresentationQosPolicy
+     */
+    RTPS_DllAPI void representation(
+            const DataRepresentationQosPolicy& representation)
+    {
+        representation_ = representation;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos reference
+     */
+    RTPS_DllAPI PropertyPolicyQos& properties()
+    {
+        return properties_;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos reference
+     */
+    RTPS_DllAPI const PropertyPolicyQos& properties() const
+    {
+        return properties_;
+    }
+
+    /**
+     * Setter for PropertyPolicyQos
+     * @param properties new value for the PropertyPolicyQos
+     */
+    RTPS_DllAPI void properties(
+            const PropertyPolicyQos& properties)
+    {
+        properties_ = properties;
+    }
+
+    /**
+     * Getter for RTPSReliableWriterQos
+     * @return RTPSReliableWriterQos reference
+     */
+    RTPS_DllAPI RTPSReliableWriterQos& reliable_writer_qos()
+    {
+        return reliable_writer_qos_;
+    }
+
+    /**
+     * Getter for RTPSReliableWriterQos
+     * @return RTPSReliableWriterQos reference
+     */
+    RTPS_DllAPI const RTPSReliableWriterQos& reliable_writer_qos() const
+    {
+        return reliable_writer_qos_;
+    }
+
+    /**
+     * Setter for RTPSReliableWriterQos
+     * @param reliable_writer_qos new value for the RTPSReliableWriterQos
+     */
+    RTPS_DllAPI void reliable_writer_qos(
+            const RTPSReliableWriterQos& reliable_writer_qos)
+    {
+        reliable_writer_qos_ = reliable_writer_qos;
+    }
+
+    /**
+     * Getter for RTPSEndpointQos
+     * @return RTPSEndpointQos reference
+     */
+    RTPS_DllAPI RTPSEndpointQos& endpoint()
+    {
+        return endpoint_;
+    }
+
+    /**
+     * Getter for RTPSEndpointQos
+     * @return RTPSEndpointQos reference
+     */
+    RTPS_DllAPI const RTPSEndpointQos& endpoint() const
+    {
+        return endpoint_;
+    }
+
+    /**
+     * Setter for RTPSEndpointQos
+     * @param endpoint new value for the RTPSEndpointQos
+     */
+    RTPS_DllAPI void endpoint(
+            const RTPSEndpointQos& endpoint)
+    {
+        endpoint_ = endpoint;
+    }
+
+    /**
+     * Getter for WriterResourceLimitsQos
+     * @return WriterResourceLimitsQos reference
+     */
+    RTPS_DllAPI WriterResourceLimitsQos& writer_resource_limits()
+    {
+        return writer_resource_limits_;
+    }
+
+    /**
+     * Getter for WriterResourceLimitsQos
+     * @return WriterResourceLimitsQos reference
+     */
+    RTPS_DllAPI const WriterResourceLimitsQos& writer_resource_limits() const
+    {
+        return writer_resource_limits_;
+    }
+
+    /**
+     * Setter for WriterResourceLimitsQos
+     * @param writer_resource_limits new value for the WriterResourceLimitsQos
+     */
+    RTPS_DllAPI void writer_resource_limits(
+            const WriterResourceLimitsQos& writer_resource_limits)
+    {
+        writer_resource_limits_ = writer_resource_limits;
+    }
+
+    /**
+     * Getter for ThroughputControllerDescriptor
+     * @return ThroughputControllerDescriptor reference
+     */
+    RTPS_DllAPI fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller()
+    {
+        return throughput_controller_;
+    }
+
+    /**
+     * Getter for ThroughputControllerDescriptor
+     * @return ThroughputControllerDescriptor reference
+     */
+    RTPS_DllAPI const fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller() const
+    {
+        return throughput_controller_;
+    }
+
+    /**
+     * Setter for ThroughputControllerDescriptor
+     * @param throughput_controller new value for the ThroughputControllerDescriptor
+     */
+    RTPS_DllAPI void throughput_controller(
+            const fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller)
+    {
+        throughput_controller_ = throughput_controller;
+    }
+
+private:
+
+    //!Durability Qos, implemented in the library.
+    DurabilityQosPolicy durability_;
+
+    //!Durability Service Qos, NOT implemented in the library.
+    DurabilityServiceQosPolicy durability_service_;
+
+    //!Deadline Qos, implemented in the library.
+    DeadlineQosPolicy deadline_;
+
+    //!Latency Budget Qos, NOT implemented in the library.
+    LatencyBudgetQosPolicy latency_budget_;
+
+    //!Liveliness Qos, implemented in the library.
+    LivelinessQosPolicy liveliness_;
+
+    //!Reliability Qos, implemented in the library.
+    ReliabilityQosPolicy reliability_;
+
+    //!Destination Order Qos, NOT implemented in the library.
+    DestinationOrderQosPolicy destination_order_;
+
+    //!History Qos, implemented in the library.
+    HistoryQosPolicy history_;
+
+    //!Resource Limits Qos, implemented in the library.
+    ResourceLimitsQosPolicy resource_limits_;
+
+    //!Transport Priority Qos, NOT implemented in the library.
+    TransportPriorityQosPolicy transport_priority_;
+
+    //!Lifespan Qos, implemented in the library.
+    LifespanQosPolicy lifespan_;
+
+    //!User Data Qos, implemented in the library.
+    UserDataQosPolicy user_data_;
+
+    //!Ownership Qos, implemented in the library.
+    OwnershipQosPolicy ownership_;
+
+    //!Ownership Strength Qos, implemented in the library.
+    OwnershipStrengthQosPolicy ownership_strength_;
+
+    //!Writer Data Lifecycle Qos, NOT implemented in the library.
+    WriterDataLifecycleQosPolicy writer_data_lifecycle_;
+
+    //!Publication Mode Qos, implemented in the library.
+    PublishModeQosPolicy publish_mode_;
+
+    //!Data Representation Qos, implemented in the library.
+    DataRepresentationQosPolicy representation_;
+
+    //!Property policies
+    PropertyPolicyQos properties_;
+
+    //!RTPS Reliable Writer Qos
+    RTPSReliableWriterQos reliable_writer_qos_;
+
+    //!RTPS Endpoint Qos
+    RTPSEndpointQos endpoint_;
+
+    //!Writer Resource Limits Qos
+    WriterResourceLimitsQos writer_resource_limits_;
+
+    //!Throughput controller
+    fastrtps::rtps::ThroughputControllerDescriptor throughput_controller_;
+};
+
+RTPS_DllAPI extern const DataWriterQos DATAWRITER_QOS_DEFAULT;
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_DATAWRITERQOS_HPP

+ 197 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/PublisherQos.hpp

@@ -0,0 +1,197 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PublisherQos.hpp
+ */
+
+
+#ifndef _FASTDDS_PUBLISHERQOS_HPP_
+#define _FASTDDS_PUBLISHERQOS_HPP_
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+#include <fastrtps/attributes/PublisherAttributes.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class PublisherQos, containing all the possible Qos that can be set for a determined Publisher.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been
+ * implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class PublisherQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI PublisherQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~PublisherQos() = default;
+
+    bool operator ==(
+            const PublisherQos& b) const
+    {
+        return (this->presentation_ == b.presentation()) &&
+               (this->partition_ == b.partition()) &&
+               (this->group_data_ == b.group_data()) &&
+               (this->entity_factory_ == b.entity_factory());
+    }
+
+    /**
+     * Getter for PresentationQosPolicy
+     * @return PresentationQosPolicy reference
+     */
+    const PresentationQosPolicy& presentation() const
+    {
+        return presentation_;
+    }
+
+    /**
+     * Getter for PresentationQosPolicy
+     * @return PresentationQosPolicy reference
+     */
+    PresentationQosPolicy& presentation()
+    {
+        return presentation_;
+    }
+
+    /**
+     * Setter for PresentationQosPolicy
+     * @param presentation PresentationQosPolicy
+     */
+    void presentation(
+            const PresentationQosPolicy& presentation)
+    {
+        presentation_ = presentation;
+    }
+
+    /**
+     * Getter for PartitionQosPolicy
+     * @return PartitionQosPolicy reference
+     */
+    const PartitionQosPolicy& partition() const
+    {
+        return partition_;
+    }
+
+    /**
+     * Getter for PartitionQosPolicy
+     * @return PartitionQosPolicy reference
+     */
+    PartitionQosPolicy& partition()
+    {
+        return partition_;
+    }
+
+    /**
+     * Setter for PartitionQosPolicy
+     * @param partition PartitionQosPolicy
+     */
+    void partition(
+            const PartitionQosPolicy& partition)
+    {
+        partition_ = partition;
+    }
+
+    /**
+     * Getter for GroupDataQosPolicy
+     * @return GroupDataQosPolicy reference
+     */
+    const GroupDataQosPolicy& group_data() const
+    {
+        return group_data_;
+    }
+
+    /**
+     * Getter for GroupDataQosPolicy
+     * @return GroupDataQosPolicy reference
+     */
+    GroupDataQosPolicy& group_data()
+    {
+        return group_data_;
+    }
+
+    /**
+     * Setter for GroupDataQosPolicy
+     * @param group_data GroupDataQosPolicy
+     */
+    void group_data(
+            const GroupDataQosPolicy& group_data)
+    {
+        group_data_ = group_data;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    const EntityFactoryQosPolicy& entity_factory() const
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    EntityFactoryQosPolicy& entity_factory()
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Setter for EntityFactoryQosPolicy
+     * @param entity_factory EntityFactoryQosPolicy
+     */
+    void entity_factory(
+            const EntityFactoryQosPolicy& entity_factory)
+    {
+        entity_factory_ = entity_factory;
+    }
+
+private:
+
+    //!Presentation Qos, NOT implemented in the library.
+    PresentationQosPolicy presentation_;
+
+    //!Partition Qos, implemented in the library.
+    PartitionQosPolicy partition_;
+
+    //!Group Data Qos, implemented in the library.
+    GroupDataQosPolicy group_data_;
+
+    //!Entity Factory Qos, implemented in the library
+    EntityFactoryQosPolicy entity_factory_;
+
+};
+
+RTPS_DllAPI extern const PublisherQos PUBLISHER_QOS_DEFAULT;
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_PUBLISHERQOS_HPP_

+ 151 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/publisher/qos/WriterQos.hpp

@@ -0,0 +1,151 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WriterQos.hpp
+ *
+ */
+
+#ifndef _FASTDDS_DDS_QOS_WRITERQOS_HPP_
+#define _FASTDDS_DDS_QOS_WRITERQOS_HPP_
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class WriterQos, containing all the possible Qos that can be set for a determined Publisher.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTRTPS_ATTRIBUTES_MODULE
+ */
+class WriterQos
+{
+public:
+
+    RTPS_DllAPI WriterQos();
+    RTPS_DllAPI virtual ~WriterQos();
+
+    bool operator ==(
+            const WriterQos& b) const
+    {
+        return (this->m_durability == b.m_durability) &&
+               (this->m_durabilityService == b.m_durabilityService) &&
+               (this->m_deadline == b.m_deadline) &&
+               (this->m_latencyBudget == b.m_latencyBudget) &&
+               (this->m_liveliness == b.m_liveliness) &&
+               (this->m_reliability == b.m_reliability) &&
+               (this->m_lifespan == b.m_lifespan) &&
+               (this->m_userData == b.m_userData) &&
+               (this->m_timeBasedFilter == b.m_timeBasedFilter) &&
+               (this->m_ownership == b.m_ownership) &&
+               (this->m_ownershipStrength == b.m_ownershipStrength) &&
+               (this->m_destinationOrder == b.m_destinationOrder) &&
+               (this->m_presentation == b.m_presentation) &&
+               (this->m_partition == b.m_partition) &&
+               (this->m_topicData == b.m_topicData) &&
+               (this->m_groupData == b.m_groupData) &&
+               (this->m_publishMode == b.m_publishMode) &&
+               (this->m_disablePositiveACKs == b.m_disablePositiveACKs) &&
+               (this->representation == b.representation);
+    }
+
+    //!Durability Qos, implemented in the library.
+    DurabilityQosPolicy m_durability;
+
+    //!Durability Service Qos, NOT implemented in the library.
+    DurabilityServiceQosPolicy m_durabilityService;
+
+    //!Deadline Qos, implemented in the library.
+    DeadlineQosPolicy m_deadline;
+
+    //!Latency Budget Qos, NOT implemented in the library.
+    LatencyBudgetQosPolicy m_latencyBudget;
+
+    //!Liveliness Qos, implemented in the library.
+    LivelinessQosPolicy m_liveliness;
+
+    //!Reliability Qos, implemented in the library.
+    ReliabilityQosPolicy m_reliability;
+
+    //!Lifespan Qos, NOT implemented in the library.
+    LifespanQosPolicy m_lifespan;
+
+    //!UserData Qos, NOT implemented in the library.
+    UserDataQosPolicy m_userData;
+
+    //!Time Based Filter Qos, NOT implemented in the library.
+    TimeBasedFilterQosPolicy m_timeBasedFilter;
+
+    //!Ownership Qos, NOT implemented in the library.
+    OwnershipQosPolicy m_ownership;
+
+    //!Owenership Strength Qos, NOT implemented in the library.
+    OwnershipStrengthQosPolicy m_ownershipStrength;
+
+    //!Destination Order Qos, NOT implemented in the library.
+    DestinationOrderQosPolicy m_destinationOrder;
+
+    //!Presentation Qos, NOT implemented in the library.
+    PresentationQosPolicy m_presentation;
+
+    //!Partition Qos, implemented in the library.
+    PartitionQosPolicy m_partition;
+
+    //!Topic Data Qos, NOT implemented in the library.
+    TopicDataQosPolicy m_topicData;
+
+    //!Group Data Qos, NOT implemented in the library.
+    GroupDataQosPolicy m_groupData;
+
+    //!Publication Mode Qos, implemented in the library.
+    PublishModeQosPolicy m_publishMode;
+
+    //!Data Representation Qos, implemented in the library.
+    DataRepresentationQosPolicy representation;
+
+    //!Disable positive acks QoS, implemented in the library.
+    DisablePositiveACKsQosPolicy m_disablePositiveACKs;
+
+    /**
+     * Set Qos from another class
+     * @param qos Reference from a WriterQos object.
+     * @param first_time Boolean indicating whether is the first time (If not some parameters cannot be set).
+     */
+    RTPS_DllAPI void setQos(
+            const WriterQos& qos,
+            bool first_time);
+
+    /**
+     * Check if the Qos values are compatible between each other.
+     * @return True if correct.
+     */
+    RTPS_DllAPI bool checkQos() const;
+
+    RTPS_DllAPI bool canQosBeUpdated(
+            const WriterQos& qos) const;
+
+    void clear();
+};
+
+//RTPS_DllAPI extern const WriterQos DATAWRITER_QOS_DEFAULT;
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_WRITERQOS_HPP_

+ 305 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/DataReader.hpp

@@ -0,0 +1,305 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataReader.hpp
+ *
+ */
+
+#ifndef _FASTRTPS_DATAREADER_HPP_
+#define _FASTRTPS_DATAREADER_HPP_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastrtps/qos/DeadlineMissedStatus.h>
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/dds/core/status/StatusMask.hpp>
+#include <fastdds/dds/core/Entity.hpp>
+#include <fastrtps/types/TypesBase.h>
+
+
+#include <vector>
+#include <cstdint>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace dds {
+namespace sub {
+
+class DataReader;
+
+} // namespace sub
+} // namespace dds
+
+namespace eprosima {
+namespace fastrtps {
+
+class TopicAttributes;
+
+namespace rtps {
+class ReaderAttributes;
+struct GUID_t;
+struct InstanceHandle_t;
+} // namespace rtps
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class Subscriber;
+class SubscriberImpl;
+class DataReaderImpl;
+class DataReaderListener;
+class TypeSupport;
+class DataReaderQos;
+class TopicDescription;
+struct LivelinessChangedStatus;
+struct SampleInfo;
+
+/**
+ * Class DataReader, contains the actual implementation of the behaviour of the Subscriber.
+ *  @ingroup FASTDDS_MODULE
+ */
+class DataReader : public DomainEntity
+{
+    friend class DataReaderImpl;
+    friend class SubscriberImpl;
+
+    /**
+     * Creates a DataReader. Don't use it directly, but through Subscriber.
+     */
+    RTPS_DllAPI DataReader(
+            DataReaderImpl* impl,
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI DataReader(
+            Subscriber* s,
+            TopicDescription* topic,
+            const DataReaderQos& qos,
+            DataReaderListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+public:
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~DataReader();
+
+    /**
+     * @brief This operation enables the DataReader
+     * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the Subscriber creating this
+     *         DataReader is not enabled.
+     */
+    RTPS_DllAPI ReturnCode_t enable() override;
+
+    /**
+     * Method to block the current thread until an unread message is available
+     * @param timeout Max blocking time for this operation
+     * @return true if there is new unread message, false if timeout
+     */
+    RTPS_DllAPI bool wait_for_unread_message(
+            const fastrtps::Duration_t& timeout);
+
+
+    /** @name Read or take data methods.
+     * Methods to read or take data from the History.
+     */
+
+    ///@{
+
+    /* TODO
+       RTPS_DllAPI bool read(
+            std::vector<void*>& data_values,
+            std::vector<SampleInfo>& sample_infos,
+            uint32_t max_samples);
+     */
+
+    /**
+     * @brief This operation copies the next, non-previously accessed Data value from the DataReader; the operation also
+     * copies the corresponding SampleInfo. The implied order among the samples stored in the DataReader is the same as for
+     * the read operation.
+     *
+     * The read_next_sample operation is semantically equivalent to the read operation where the input Data sequence has
+     * max_length=1, the sample_states=NOT_READ, the view_states=ANY_VIEW_STATE, and the instance_states=ANY_INSTANCE_STATE.
+     *
+     * The read_next_sample operation provides a simplified API to ‘read’ samples avoiding the need for the application to
+     * manage sequences and specify states.
+     *
+     * If there is no unread data in the DataReader, the operation will return NO_DATA and nothing is copied
+     * @param data Data pointer to store the sample
+     * @param info SampleInfo pointer to store the sample information
+     * @return RETCODE_NO_DATA if the history is empty, RETCODE_OK if the next sample is returned and RETCODE_ERROR otherwise
+     */
+    RTPS_DllAPI ReturnCode_t read_next_sample(
+            void* data,
+            SampleInfo* info);
+
+    /* TODO
+       RTPS_DllAPI bool take(
+            std::vector<void*>& data_values,
+            std::vector<SampleInfo>& sample_infos,
+            uint32_t max_samples);
+     */
+
+    /**
+     * @brief This operation copies the next, non-previously accessed Data value from the DataReader and ‘removes’ it from
+     * the DataReader so it is no longer accessible. The operation also copies the corresponding SampleInfo. This operation
+     * is analogous to the read_next_sample except for the fact that the sample is ‘removed’ from the DataReader.
+     *
+     * The take_next_sample operation is semantically equivalent to the take operation where the input sequence has
+     * max_length=1, the sample_states=NOT_READ, the view_states=ANY_VIEW_STATE, and the instance_states=ANY_INSTANCE_STATE.
+     *
+     * This operation provides a simplified API to ’take’ samples avoiding the need for the application to manage sequences
+     * and specify states.
+     *
+     * If there is no unread data in the DataReader, the operation will return NO_DATA and nothing is copied.
+     * @param data Data pointer to store the sample
+     * @param info SampleInfo pointer to store the sample information
+     * @return RETCODE_NO_DATA if the history is empty, RETCODE_OK if the next sample is returned and RETCODE_ERROR otherwise
+     */
+    RTPS_DllAPI ReturnCode_t take_next_sample(
+            void* data,
+            SampleInfo* info);
+
+    ///@}
+
+    /**
+     * @brief Returns information about the first untaken sample.
+     * @param [out] info Pointer to a SampleInfo_t structure to store first untaken sample information.
+     * @return RETCODE_OK if sample info was returned. RETCODE_NO_DATA if there is no sample to take.
+     */
+    RTPS_DllAPI ReturnCode_t get_first_untaken_info(
+            SampleInfo* info);
+
+    /**
+     * Get associated GUID
+     * @return Associated GUID
+     */
+    RTPS_DllAPI const fastrtps::rtps::GUID_t& guid();
+
+    /**
+     * @brief Getter for the associated InstanceHandle
+     * @return Copy of the InstanceHandle
+     */
+    RTPS_DllAPI fastrtps::rtps::InstanceHandle_t get_instance_handle() const;
+
+    /**
+     * Getter for the data type
+     * @return TypeSupport associated to the DataReader
+     */
+    TypeSupport type();
+
+    /**
+     * Get TopicDescription
+     * @return TopicDescription pointer
+     */
+    const TopicDescription* get_topicdescription() const;
+
+    /**
+     * @brief Get the requested deadline missed status
+     * @return The deadline missed status
+     */
+    RTPS_DllAPI ReturnCode_t get_requested_deadline_missed_status(
+            fastrtps::RequestedDeadlineMissedStatus& status);
+
+    /**
+     * @brief Setter for the DataReaderQos
+     * @param qos new value for the DataReaderQos
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const DataReaderQos& qos);
+
+    /**
+     * @brief Getter for the DataReaderQos
+     * @return Pointer to the DataReaderQos
+     */
+    RTPS_DllAPI const DataReaderQos& get_qos() const;
+
+    /**
+     * @brief Getter for the DataReaderQos
+     * @param qos DataReaderQos where the qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            DataReaderQos& qos) const;
+
+    /**
+     * @brief Setter for the DataReaderListener
+     * @param listener new value for the DataReaderListener
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            DataReaderListener* listener);
+
+    /**
+     * @brief Getter for the DataReaderListener
+     * @return Pointer to the DataReaderListener
+     */
+    RTPS_DllAPI const DataReaderListener* get_listener() const;
+
+    /* TODO
+       RTPS_DllAPI bool get_key_value(
+            void* data,
+            const fastrtps::rtps::InstanceHandle_t& handle);
+     */
+
+    /**
+     * @brief Get the liveliness changed status
+     * @param status LivelinessChangedStatus object where the status is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_liveliness_changed_status(
+            LivelinessChangedStatus& status) const;
+
+    /* TODO
+       RTPS_DllAPI bool get_requested_incompatible_qos_status(
+            fastrtps::RequestedIncompatibleQosStatus& status) const;
+     */
+
+    /* TODO
+       RTPS_DllAPI bool get_sample_lost_status(
+            fastrtps::SampleLostStatus& status) const;
+     */
+
+    /* TODO
+       RTPS_DllAPI bool get_sample_rejected_status(
+            fastrtps::SampleRejectedStatus& status) const;
+     */
+
+    /**
+     * @brief Getter for the Subscriber
+     * @return Subscriber pointer
+     */
+    RTPS_DllAPI const Subscriber* get_subscriber() const;
+
+    /* TODO
+       RTPS_DllAPI bool wait_for_historical_data(
+            const fastrtps::Duration_t& max_wait) const;
+     */
+
+private:
+
+    DataReaderImpl* impl_;
+
+    friend class ::dds::sub::DataReader;
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTRTPS_DATAREADER_HPP_*/

+ 152 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/DataReaderListener.hpp

@@ -0,0 +1,152 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataReaderListener.hpp
+ */
+
+#ifndef _FASTRTPS_DATAREADERLISTENER_HPP_
+#define _FASTRTPS_DATAREADERLISTENER_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastrtps/qos/DeadlineMissedStatus.h>
+#include <fastrtps/qos/LivelinessChangedStatus.h>
+#include <fastrtps/qos/SampleRejectedStatus.hpp>
+#include <fastdds/dds/core/status/IncompatibleQosStatus.hpp>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+#include <fastdds/dds/core/status/SubscriptionMatchedStatus.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DataReader;
+
+/**
+ * Class DataReaderListener, it should be used by the end user to implement specific callbacks to certain actions.
+ * @ingroup FASTDDS_MODULE
+ */
+class DataReaderListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DataReaderListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~DataReaderListener()
+    {
+    }
+
+    /**
+     * Virtual function to be implemented by the user containing the actions to be performed when a new  Data Message is received.
+     * @param reader DataReader
+     */
+    RTPS_DllAPI virtual void on_data_available(
+            DataReader* reader)
+    {
+        (void)reader;
+    }
+
+    /**
+     * Virtual method to be called when the subscriber is matched with a new Writer (or unmatched); i.e., when a writer publishing in the same topic is discovered.
+     * @param reader DataReader
+     * @param info The subscription matched status
+     */
+    RTPS_DllAPI virtual void on_subscription_matched(
+            DataReader* reader,
+            const fastdds::dds::SubscriptionMatchedStatus& info)
+    {
+        (void)reader;
+        (void)info;
+    }
+
+    /**
+     * Virtual method to be called when a topic misses the deadline period
+     * @param reader DataReader
+     * @param status The requested deadline missed status
+     */
+    RTPS_DllAPI virtual void on_requested_deadline_missed(
+            DataReader* reader,
+            const fastrtps::RequestedDeadlineMissedStatus& status)
+    {
+        (void)reader;
+        (void)status;
+    }
+
+    /**
+     * @brief Method called when the liveliness status associated to a subscriber changes
+     * @param reader The DataReader
+     * @param status The liveliness changed status
+     */
+    RTPS_DllAPI virtual void on_liveliness_changed(
+            DataReader* reader,
+            const fastrtps::LivelinessChangedStatus& status)
+    {
+        (void)reader;
+        (void)status;
+    }
+
+    /**
+     * @brief Method called when a sample was rejected.
+     * @param reader The DataReader
+     * @param status The rejected status
+     */
+    RTPS_DllAPI virtual void on_sample_rejected(
+            DataReader* reader,
+            const fastrtps::SampleRejectedStatus& status)
+    {
+        (void)reader;
+        (void)status;
+    }
+
+    /**
+     * @brief Method called an incompatible QoS was requested.
+     * @param reader The DataReader
+     * @param status The requested incompatible QoS status
+     */
+    RTPS_DllAPI virtual void on_requested_incompatible_qos(
+            DataReader* reader,
+            const RequestedIncompatibleQosStatus& status)
+    {
+        (void)reader;
+        (void)status;
+    }
+
+    /**
+     * @brief Method called when a sample was lost.
+     * @param reader The DataReader
+     * @param status The sample lost status
+     */
+    RTPS_DllAPI virtual void on_sample_lost(
+            DataReader* reader,
+            const SampleLostStatus& status)
+    {
+        (void)reader;
+        (void)status;
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTRTPS_DATAREADERLISTENER_HPP_ */

+ 109 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/SampleInfo.hpp

@@ -0,0 +1,109 @@
+// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SampleInfo.hpp
+ *
+ */
+
+#ifndef _FASTRTPS_SAMPLEINFO_HPP_
+#define _FASTRTPS_SAMPLEINFO_HPP_
+
+
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/InstanceHandle.h>
+#include <fastdds/rtps/common/SampleIdentity.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+
+enum SampleStateKind
+{
+    READ,
+    NOT_READ
+};
+
+enum ViewStateKind
+{
+    NEW,
+    NOT_NEW
+};
+
+enum InstanceStateKind
+{
+    ALIVE,
+    NOT_ALIVE_DISPOSED,
+    NOT_ALIVE_NO_WRITERS
+};
+
+/*!
+ * @brief SampleInfo is the information that accompanies each sample that is ‘read’ or ‘taken.’
+ */
+struct SampleInfo
+{
+    //! indicates whether or not the corresponding data sample has already been read
+    SampleStateKind sample_state;
+
+    //! indicates whether the DataReader has already seen samples for the most-current generation of the related instance.
+    ViewStateKind view_state;
+
+    //! indicates whether the instance is currently in existence or, if it has been disposed, the reason why it was disposed.
+    InstanceStateKind instance_state;
+
+    //! number of times the instance had become alive after it was disposed
+    int32_t disposed_generation_count;
+
+    //! number of times the instance had become alive after it was disposed because no writers
+    int32_t no_writers_generation_count;
+
+    //! number of samples related to the same instance that follow in the collection
+    int32_t sample_rank;
+
+    //! the generation difference between the time the sample was received, and the time the most recent sample in the collection was received.
+    int32_t generation_rank;
+
+    //! the generation difference between the time the sample was received, and the time the most recent sample was received.
+    //! The most recent sample used for the calculation may or may not be in the returned collection
+    int32_t absoulte_generation_rank;
+
+    //! time provided by the DataWriter when the sample was written
+    fastrtps::rtps::Time_t source_timestamp;
+
+    //! identifies locally the corresponding instance
+    fastrtps::rtps::InstanceHandle_t instance_handle;
+
+    //! identifies locally the DataWriter that modified the instance
+    //!
+    //! Is the same InstanceHandle_t that is returned by the operation get_matched_publications on the DataReader
+    fastrtps::rtps::InstanceHandle_t publication_handle;
+
+    //! whether the DataSample contains data or is only used to communicate of a change in the instance
+    bool valid_data;
+
+    //!Sample Identity (Extension for RPC)
+    fastrtps::rtps::SampleIdentity sample_identity;
+
+    //!Related Sample Identity (Extension for RPC)
+    fastrtps::rtps::SampleIdentity related_sample_identity;
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTRTPS_SAMPLEINFO_HPP_*/

+ 307 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/Subscriber.hpp

@@ -0,0 +1,307 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Subscriber.hpp
+ */
+
+
+#ifndef _FASTDDS_SUBSCRIBER_HPP_
+#define _FASTDDS_SUBSCRIBER_HPP_
+
+#include <fastrtps/attributes/SubscriberAttributes.h>
+
+#include <fastdds/dds/subscriber/DataReaderListener.hpp>
+#include <fastdds/dds/subscriber/qos/SubscriberQos.hpp>
+#include <fastrtps/types/TypesBase.h>
+#include <fastdds/dds/core/Entity.hpp>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace dds {
+namespace sub {
+
+class Subscriber;
+
+} // namespace sub
+} // namespace dds
+
+namespace eprosima {
+namespace fastrtps {
+
+class TopicAttributes;
+
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+class SubscriberListener;
+class SubscriberImpl;
+class DataReader;
+class DataReaderListener;
+class DataReaderQos;
+class TopicDescription;
+/**
+ * Class Subscriber, contains the public API that allows the user to control the reception of messages.
+ * This class should not be instantiated directly.
+ * DomainRTPSParticipant class should be used to correctly create this element.
+ * @ingroup FASTDDS_MODULE
+ */
+class Subscriber : public DomainEntity
+{
+    friend class SubscriberImpl;
+    friend class DomainParticipantImpl;
+
+    /**
+     * Constructor from a SubscriberImpl pointer
+     * @param pimpl Actual implementation of the subscriber
+     * @param mask StatusMask (default: all)
+     */
+    RTPS_DllAPI Subscriber(
+            SubscriberImpl* pimpl,
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI Subscriber(
+            DomainParticipant* dp,
+            const SubscriberQos& qos = SUBSCRIBER_QOS_DEFAULT,
+            SubscriberListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+public:
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~Subscriber()
+    {
+    }
+
+    /**
+     * @brief This operation enables the Subscriber
+     * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the participant creating this
+     *         Subscriber is not enabled.
+     */
+    RTPS_DllAPI ReturnCode_t enable() override;
+
+    /**
+     * Allows accessing the Subscriber Qos.
+     * @return SubscriberQos reference
+     */
+    RTPS_DllAPI const SubscriberQos& get_qos() const;
+
+    /**
+     * Retrieves the Subscriber Qos.
+     * @param qos SubscriberQos where the qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            SubscriberQos& qos) const;
+
+    /**
+     * Allows modifying the Subscriber Qos.
+     * The given Qos must be supported by the SubscriberQos.
+     * @param qos new value for SubscriberQos
+     * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not
+     * self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const SubscriberQos& qos);
+
+    /**
+     * Retrieves the attached SubscriberListener.
+     * @return Pointer to the SubscriberListener
+     */
+    RTPS_DllAPI const SubscriberListener* get_listener() const;
+
+    /**
+     * Modifies the SubscriberListener.
+     * @param listener new value for SubscriberListener
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            SubscriberListener* listener);
+
+    /**
+     * This operation creates a DataReader. The returned DataReader will be attached and belong to the Subscriber.
+     * @param topic Topic the DataReader will be listening.
+     * @param reader_qos QoS of the DataReader.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask (default: all)
+     * @return Pointer to the created DataReader. nullptr if failed.
+     */
+    RTPS_DllAPI DataReader* create_datareader(
+            TopicDescription* topic,
+            const DataReaderQos& reader_qos,
+            DataReaderListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * This operation creates a DataReader. The returned DataReader will be attached and belongs to the Subscriber.
+     * @param topic Topic the DataReader will be listening.
+     * @param profile_name DataReader profile name.
+     * @param listener Pointer to the listener (default: nullptr)
+     * @param mask StatusMask (default: all)
+     * @return Pointer to the created DataReader. nullptr if failed.
+     */
+    RTPS_DllAPI DataReader* create_datareader_with_profile(
+            TopicDescription* topic,
+            const std::string& profile_name,
+            DataReaderListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * This operation deletes a DataReader that belongs to the Subscriber.
+     *
+     * The delete_datareader operation must be called on the same Subscriber object used to create the DataReader.
+     * If delete_datareader is called on a different Subscriber, the operation will have no effect and it will
+     * return an error.
+     * @param reader DataReader to delete
+     * @return RETCODE_PRECONDITION_NOT_MET if the datareader does not belong to this subscriber, RETCODE_OK if it is correctly
+     * deleted and RETCODE_ERROR otherwise.
+     */
+    RTPS_DllAPI ReturnCode_t delete_datareader(
+            DataReader* reader);
+
+    /**
+     * This operation retrieves a previously-created DataReader belonging to the Subscriber that is attached to a
+     * Topic with a matching topic_name. If no such DataReader exists, the operation will return nullptr.
+     *
+     * If multiple DataReaders attached to the Subscriber satisfy this condition, then the operation will return
+     * one of them. It is not specified which one.
+     * @param topic_name Name of the topic associated to the DataReader
+     * @return Pointer to a previously created DataReader created on a Topic with that topic_name
+     */
+    RTPS_DllAPI DataReader* lookup_datareader(
+            const std::string& topic_name) const;
+
+    /**
+     * This operation allows the application to access the DataReader objects.
+     * @param readers Vector of DataReader where the list of existing readers is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_datareaders(
+            std::vector<DataReader*>& readers) const;
+
+    /**
+     * This operation checks if the subscriber has DataReaders
+     * @return true if the subscriber has one or several DataReaders, false in other case
+     */
+    RTPS_DllAPI bool has_datareaders() const;
+
+    /* TODO
+       bool begin_access();
+     */
+
+    /* TODO
+       bool end_access();
+     */
+
+    /**
+     * This operation invokes the operation on_data_available on the DataReaderListener objects attached to
+     * contained DataReader entities.
+     *
+     * This operation is typically invoked from the on_data_on_readers operation in the SubscriberListener.
+     * That way the SubscriberListener can delegate to the DataReaderListener objects the handling of the data.
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t notify_datareaders() const;
+
+    /* TODO
+       bool delete_contained_entities();
+     */
+
+    /**
+     * This operation sets a default value of the DataReader QoS policies which will be used for newly created
+     * DataReader entities in the case where the QoS policies are defaulted in the create_datareader operation.
+     *
+     * This operation will check that the resulting policies are self consistent; if they are not, the operation
+     * will have no effect and return false.
+     *
+     * The special value DATAREADER_QOS_DEFAULT may be passed to this operation to indicate that the default QoS
+     * should be reset back to the initial values the factory would use, that is the values that would be used
+     * if the set_default_datareader_qos operation had never been called.
+     * @param qos new value for DataReaderQos to set as default
+     * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.
+     */
+    RTPS_DllAPI ReturnCode_t set_default_datareader_qos(
+            const DataReaderQos& qos);
+
+    /**
+     * This operation returns the default value of the DataReader QoS, that is, the QoS policies which will be
+     * used for newly created DataReader entities in the case where the QoS policies are defaulted in the
+     * create_datareader operation.
+     *
+     * The values retrieved get_default_datareader_qos will match the set of values specified on the last successful
+     * call to get_default_datareader_qos, or else, if the call was never made, the default values.
+     * @return Current default DataReaderQos.
+     */
+    RTPS_DllAPI const DataReaderQos& get_default_datareader_qos() const;
+
+
+    /**
+     * This operation returns the default value of the DataReader QoS, that is, the QoS policies which will be
+     * used for newly created DataReader entities in the case where the QoS policies are defaulted in the
+     * create_datareader operation.
+     *
+     * The values retrieved get_default_datareader_qos will match the set of values specified on the last successful
+     * call to get_default_datareader_qos, or else, if the call was never made, the default values.
+     * @return Current default DataReaderQos.
+     */
+    RTPS_DllAPI DataReaderQos& get_default_datareader_qos();
+
+    /**
+     * This operation retrieves the default value of the DataReader QoS, that is, the QoS policies which will be
+     * used for newly created DataReader entities in the case where the QoS policies are defaulted in the
+     * create_datareader operation.
+     *
+     * The values retrieved get_default_datareader_qos will match the set of values specified on the last successful
+     * call to get_default_datareader_qos, or else, if the call was never made, the default values.
+     * @param qos DataReaderQos where the default_qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_default_datareader_qos(
+            DataReaderQos& qos) const;
+
+    /* TODO
+       bool copy_from_topic_qos(
+            DataReaderQos& reader_qos,
+            const fastrtps::TopicAttributes& topic_qos) const;
+     */
+
+    /**
+     * This operation returns the DomainParticipant to which the Subscriber belongs.
+     * @return DomainParticipant Pointer
+     */
+    RTPS_DllAPI const DomainParticipant* get_participant() const;
+
+    /**
+     * Returns the Subscriber's handle.
+     * @return InstanceHandle of this Subscriber.
+     */
+    RTPS_DllAPI const fastrtps::rtps::InstanceHandle_t& get_instance_handle() const;
+
+private:
+
+    SubscriberImpl* impl_;
+
+    friend class ::dds::sub::Subscriber;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_SUBSCRIBER_HPP_ */

+ 74 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/SubscriberListener.hpp

@@ -0,0 +1,74 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SubscriberListener.hpp
+ */
+
+#ifndef _FASTDDS_SUBLISTENER_HPP_
+#define _FASTDDS_SUBLISTENER_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastrtps/qos/DeadlineMissedStatus.h>
+#include <fastrtps/qos/LivelinessChangedStatus.h>
+#include <fastdds/dds/core/status/SubscriptionMatchedStatus.hpp>
+#include <fastdds/dds/subscriber/DataReaderListener.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class Subscriber;
+
+/**
+ * Class SubscriberListener, it should be used by the end user to implement specific callbacks to certain actions.
+ * It also inherits all DataReaderListener callbacks.
+ * @ingroup FASTDDS_MODULE
+ */
+class SubscriberListener : public DataReaderListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI SubscriberListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~SubscriberListener()
+    {
+    }
+
+    /**
+     * Virtual function to be implemented by the user containing the actions to be performed when a new
+     * Data Message is available on any reader.
+     * @param sub Subscriber
+     */
+    RTPS_DllAPI virtual void on_data_on_readers(
+            Subscriber* sub)
+    {
+        (void)sub;
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_SUBLISTENER_HPP_ */

+ 819 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp

@@ -0,0 +1,819 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DataReaderQos.hpp
+ */
+
+
+#ifndef _FASTDDS_DATAREADERQOS_HPP
+#define _FASTDDS_DATAREADERQOS_HPP
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
+#include <fastdds/dds/subscriber/qos/SubscriberQos.hpp>
+#include <fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp>
+
+#include <fastdds/rtps/attributes/ReaderAttributes.h>
+#include <fastrtps/attributes/TopicAttributes.h>
+
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+using TopicAttributesQos = fastrtps::TopicAttributes;
+
+//! Qos Policy to configure the DisablePositiveACKsQos and the reader attributes
+class RTPSReliableReaderQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI RTPSReliableReaderQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~RTPSReliableReaderQos() = default;
+
+    bool operator ==(
+            const RTPSReliableReaderQos& b) const
+    {
+        return (this->times == b.times) &&
+               (this->disable_positive_ACKs == b.disable_positive_ACKs);
+    }
+
+    inline void clear()
+    {
+        RTPSReliableReaderQos reset = RTPSReliableReaderQos();
+        std::swap(*this, reset);
+    }
+
+    /*!
+     * @brief Times associated with the Reliable Readers events.
+     */
+    fastrtps::rtps::ReaderTimes times;
+
+    /*!
+     * @brief Control the sending of positive ACKs
+     */
+    DisablePositiveACKsQosPolicy disable_positive_ACKs;
+};
+
+//! Qos Policy to configure the limit of the reader resources
+class ReaderResourceLimitsQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI ReaderResourceLimitsQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~ReaderResourceLimitsQos() = default;
+
+    bool operator ==(
+            const ReaderResourceLimitsQos& b) const
+    {
+        return (this->matched_publisher_allocation == b.matched_publisher_allocation);
+    }
+
+    inline void clear()
+    {
+        ReaderResourceLimitsQos reset = ReaderResourceLimitsQos();
+        std::swap(*this, reset);
+    }
+
+    //!Matched publishers allocation limits.
+    fastrtps::ResourceLimitedContainerConfig matched_publisher_allocation;
+};
+
+//! Qos Policy to configure the XTypes Qos associated to the DataReader
+class TypeConsistencyQos : public QosPolicy
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TypeConsistencyQos()
+        : QosPolicy(false)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual RTPS_DllAPI ~TypeConsistencyQos() = default;
+
+    bool operator ==(
+            const TypeConsistencyQos& b) const
+    {
+        return (this->type_consistency == b.type_consistency) &&
+               (this->representation == b.representation) &&
+               QosPolicy::operator ==(b);
+    }
+
+    inline void clear() override
+    {
+        TypeConsistencyQos reset = TypeConsistencyQos();
+        std::swap(*this, reset);
+    }
+
+    //!Type consistency enforcement Qos.
+    TypeConsistencyEnforcementQosPolicy type_consistency;
+
+    //!Data Representation Qos.
+    DataRepresentationQosPolicy representation;
+};
+
+/**
+ * Class DataReaderQos, containing all the possible Qos that can be set for a determined DataReader.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class DataReaderQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI DataReaderQos()
+        : expects_inline_qos_(false)
+    {
+    }
+
+    RTPS_DllAPI bool operator ==(
+            const DataReaderQos& b) const
+    {
+        return (durability_ == b.durability()) &&
+               (deadline_ == b.deadline()) &&
+               (latency_budget_ == b.latency_budget()) &&
+               (liveliness_ == b.liveliness()) &&
+               (reliability_ == b.reliability()) &&
+               (destination_order_ == b.destination_order()) &&
+               (history_ == b.history()) &&
+               (resource_limits_ == b.resource_limits()) &&
+               (user_data_ == b.user_data()) &&
+               (ownership_ == b.ownership()) &&
+               (time_based_filter_ == b.time_based_filter()) &&
+               (reader_data_lifecycle_ == b.reader_data_lifecycle()) &&
+               (lifespan_ == b.lifespan()) &&
+               (durability_service_ == b.durability_service()) &&
+               (reliable_reader_qos_ == b.reliable_reader_qos()) &&
+               (type_consistency_ == b.type_consistency()) &&
+               (expects_inline_qos_ == b.expects_inline_qos()) &&
+               (properties_ == b.properties()) &&
+               (endpoint_ == b.endpoint()) &&
+               (reader_resource_limits_ == b.reader_resource_limits());
+    }
+
+    RTPS_DllAPI ReaderQos get_readerqos(
+            const SubscriberQos& sqos) const;
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQosPolicy reference
+     */
+    RTPS_DllAPI DurabilityQosPolicy& durability()
+    {
+        return durability_;
+    }
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQosPolicy const reference
+     */
+    RTPS_DllAPI const DurabilityQosPolicy& durability() const
+    {
+        return durability_;
+    }
+
+    /**
+     * Setter for DurabilityQosPolicy
+     * @param new_value new value for the DurabilityQosPolicy
+     */
+    RTPS_DllAPI void durability(
+            const DurabilityQosPolicy& new_value)
+    {
+        durability_ = new_value;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQosPolicy reference
+     */
+    RTPS_DllAPI DeadlineQosPolicy& deadline()
+    {
+        return deadline_;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQosPolicy const reference
+     */
+    RTPS_DllAPI const DeadlineQosPolicy& deadline() const
+    {
+        return deadline_;
+    }
+
+    /**
+     * Setter for DeadlineQosPolicy
+     * @param new_value new value for the DeadlineQosPolicy
+     */
+    RTPS_DllAPI void deadline(
+            const DeadlineQosPolicy& new_value)
+    {
+        deadline_ = new_value;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQosPolicy reference
+     */
+    RTPS_DllAPI LatencyBudgetQosPolicy& latency_budget()
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQosPolicy const reference
+     */
+    RTPS_DllAPI const LatencyBudgetQosPolicy& latency_budget() const
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Setter for LatencyBudgetQosPolicy
+     * @param new_value new value for the LatencyBudgetQosPolicy
+     */
+    RTPS_DllAPI void latency_budget(
+            const LatencyBudgetQosPolicy& new_value)
+    {
+        latency_budget_ = new_value;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQosPolicy reference
+     */
+    RTPS_DllAPI LivelinessQosPolicy& liveliness()
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQosPolicy const reference
+     */
+    RTPS_DllAPI const LivelinessQosPolicy& liveliness() const
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Setter for LivelinessQosPolicy
+     * @param new_value new value for the LivelinessQosPolicy
+     */
+    RTPS_DllAPI void liveliness(
+            const LivelinessQosPolicy& new_value)
+    {
+        liveliness_ = new_value;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQosPolicy reference
+     */
+    RTPS_DllAPI ReliabilityQosPolicy& reliability()
+    {
+        return reliability_;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQosPolicy const reference
+     */
+    RTPS_DllAPI const ReliabilityQosPolicy& reliability() const
+    {
+        return reliability_;
+    }
+
+    /**
+     * Setter for ReliabilityQosPolicy
+     * @param new_value new value for the ReliabilityQosPolicy
+     */
+    RTPS_DllAPI void reliability(
+            const ReliabilityQosPolicy& new_value)
+    {
+        reliability_ = new_value;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQosPolicy reference
+     */
+    RTPS_DllAPI DestinationOrderQosPolicy& destination_order()
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQosPolicy const reference
+     */
+    RTPS_DllAPI const DestinationOrderQosPolicy& destination_order() const
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Setter for DestinationOrderQosPolicy
+     * @param new_value new value for the DestinationOrderQosPolicy
+     */
+    RTPS_DllAPI void destination_order(
+            const DestinationOrderQosPolicy& new_value)
+    {
+        destination_order_ = new_value;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQosPolicy reference
+     */
+    RTPS_DllAPI HistoryQosPolicy& history()
+    {
+        return history_;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQosPolicy const reference
+     */
+    RTPS_DllAPI const HistoryQosPolicy& history() const
+    {
+        return history_;
+    }
+
+    /**
+     * Setter for HistoryQosPolicy
+     * @param new_value new value for the HistoryQosPolicy
+     */
+    RTPS_DllAPI void history(
+            const HistoryQosPolicy& new_value)
+    {
+        history_ = new_value;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQosPolicy reference
+     */
+    RTPS_DllAPI ResourceLimitsQosPolicy& resource_limits()
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQosPolicy const reference
+     */
+    RTPS_DllAPI const ResourceLimitsQosPolicy& resource_limits() const
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Setter for ResourceLimitsQosPolicy
+     * @param new_value new value for the ResourceLimitsQosPolicy
+     */
+    RTPS_DllAPI void resource_limits(
+            const ResourceLimitsQosPolicy& new_value)
+    {
+        resource_limits_ = new_value;
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy reference
+     */
+    RTPS_DllAPI UserDataQosPolicy& user_data()
+    {
+        return user_data_;
+    }
+
+    /**
+     * Getter for UserDataQosPolicy
+     * @return UserDataQosPolicy const reference
+     */
+    RTPS_DllAPI const UserDataQosPolicy& user_data() const
+    {
+        return user_data_;
+    }
+
+    /**
+     * Setter for UserDataQosPolicy
+     * @param new_value new value for the UserDataQosPolicy
+     */
+    RTPS_DllAPI void user_data(
+            const UserDataQosPolicy& new_value)
+    {
+        user_data_ = new_value;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQosPolicy reference
+     */
+    RTPS_DllAPI OwnershipQosPolicy& ownership()
+    {
+        return ownership_;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQosPolicy const reference
+     */
+    RTPS_DllAPI const OwnershipQosPolicy& ownership() const
+    {
+        return ownership_;
+    }
+
+    /**
+     * Setter for OwnershipQosPolicy
+     * @param new_value new value for the OwnershipQosPolicy
+     */
+    RTPS_DllAPI void ownership(
+            const OwnershipQosPolicy& new_value)
+    {
+        ownership_ = new_value;
+    }
+
+    /**
+     * Getter for TimeBasedFilterQosPolicy
+     * @return TimeBasedFilterQosPolicy reference
+     */
+    RTPS_DllAPI TimeBasedFilterQosPolicy& time_based_filter()
+    {
+        return time_based_filter_;
+    }
+
+    /**
+     * Getter for TimeBasedFilterQosPolicy
+     * @return TimeBasedFilterQosPolicy const reference
+     */
+    RTPS_DllAPI const TimeBasedFilterQosPolicy& time_based_filter() const
+    {
+        return time_based_filter_;
+    }
+
+    /**
+     * Setter for TimeBasedFilterQosPolicy
+     * @param new_value new value for the TimeBasedFilterQosPolicy
+     */
+    RTPS_DllAPI void time_based_filter(
+            const TimeBasedFilterQosPolicy& new_value)
+    {
+        time_based_filter_ = new_value;
+    }
+
+    /**
+     * Getter for ReaderDataLifecycleQosPolicy
+     * @return ReaderDataLifecycleQosPolicy reference
+     */
+    RTPS_DllAPI ReaderDataLifecycleQosPolicy& reader_data_lifecycle()
+    {
+        return reader_data_lifecycle_;
+    }
+
+    /**
+     * Getter for ReaderDataLifecycleQosPolicy
+     * @return ReaderDataLifecycleQosPolicy const reference
+     */
+    RTPS_DllAPI const ReaderDataLifecycleQosPolicy& reader_data_lifecycle() const
+    {
+        return reader_data_lifecycle_;
+    }
+
+    /**
+     * Setter for ReaderDataLifecycleQosPolicy
+     * @param new_value new value for the ReaderDataLifecycleQosPolicy
+     */
+    RTPS_DllAPI void reader_data_lifecycle(
+            const ReaderDataLifecycleQosPolicy& new_value)
+    {
+        reader_data_lifecycle_ = new_value;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQosPolicy reference
+     */
+    RTPS_DllAPI LifespanQosPolicy& lifespan()
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQosPolicy const reference
+     */
+    RTPS_DllAPI const LifespanQosPolicy& lifespan() const
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Setter for LifespanQosPolicy
+     * @param new_value new value for the LifespanQosPolicy
+     */
+    RTPS_DllAPI void lifespan(
+            const LifespanQosPolicy& new_value)
+    {
+        lifespan_ = new_value;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQosPolicy reference
+     */
+    RTPS_DllAPI DurabilityServiceQosPolicy& durability_service()
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQosPolicy const reference
+     */
+    RTPS_DllAPI const DurabilityServiceQosPolicy& durability_service() const
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Setter for DurabilityServiceQosPolicy
+     * @param new_value new value for the DurabilityServiceQosPolicy
+     */
+    RTPS_DllAPI void durability_service(
+            const DurabilityServiceQosPolicy& new_value)
+    {
+        durability_service_ = new_value;
+    }
+
+    /**
+     * Getter for RTPSReliableReaderQos
+     * @return RTPSReliableReaderQos reference
+     */
+    RTPS_DllAPI RTPSReliableReaderQos& reliable_reader_qos()
+    {
+        return reliable_reader_qos_;
+    }
+
+    /**
+     * Getter for RTPSReliableReaderQos
+     * @return RTPSReliableReaderQos const reference
+     */
+    RTPS_DllAPI const RTPSReliableReaderQos& reliable_reader_qos() const
+    {
+        return reliable_reader_qos_;
+    }
+
+    /**
+     * Setter for RTPSReliableReaderQos
+     * @param new_value new value for the RTPSReliableReaderQos
+     */
+    RTPS_DllAPI void reliable_reader_qos(
+            const RTPSReliableReaderQos& new_value)
+    {
+        reliable_reader_qos_ = new_value;
+    }
+
+    /**
+     * Getter for TypeConsistencyQos
+     * @return TypeConsistencyQos reference
+     */
+    RTPS_DllAPI TypeConsistencyQos& type_consistency()
+    {
+        return type_consistency_;
+    }
+
+    /**
+     * Getter for TypeConsistencyQos
+     * @return TypeConsistencyQos const reference
+     */
+    RTPS_DllAPI const TypeConsistencyQos& type_consistency() const
+    {
+        return type_consistency_;
+    }
+
+    /**
+     * Setter for TypeConsistencyQos
+     * @param new_value new value for the TypeConsistencyQos
+     */
+    RTPS_DllAPI void type_consistency(
+            const TypeConsistencyQos& new_value)
+    {
+        type_consistency_ = new_value;
+    }
+
+    /**
+     * Getter for expectsInlineQos_
+     * @return expectsInlineQos_
+     */
+    RTPS_DllAPI bool expects_inline_qos() const
+    {
+        return expects_inline_qos_;
+    }
+
+    /**
+     * Setter for expectsInlineQos_
+     * @param new_value new value for the expectsInlineQos_
+     */
+    RTPS_DllAPI void expects_inline_qos(
+            bool new_value)
+    {
+        expects_inline_qos_ = new_value;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos reference
+     */
+    RTPS_DllAPI PropertyPolicyQos& properties()
+    {
+        return properties_;
+    }
+
+    /**
+     * Getter for PropertyPolicyQos
+     * @return PropertyPolicyQos const reference
+     */
+    RTPS_DllAPI const PropertyPolicyQos& properties() const
+    {
+        return properties_;
+    }
+
+    /**
+     * Setter for PropertyPolicyQos
+     * @param new_value new value for the PropertyPolicyQos
+     */
+    RTPS_DllAPI void properties(
+            const PropertyPolicyQos& new_value)
+    {
+        properties_ = new_value;
+    }
+
+    /**
+     * Getter for RTPSEndpointQos
+     * @return RTPSEndpointQos reference
+     */
+    RTPS_DllAPI RTPSEndpointQos& endpoint()
+    {
+        return endpoint_;
+    }
+
+    /**
+     * Getter for RTPSEndpointQos
+     * @return RTPSEndpointQos const reference
+     */
+    RTPS_DllAPI const RTPSEndpointQos& endpoint() const
+    {
+        return endpoint_;
+    }
+
+    /**
+     * Setter for RTPSEndpointQos
+     * @param new_value new value for the RTPSEndpointQos
+     */
+    RTPS_DllAPI void endpoint(
+            const RTPSEndpointQos& new_value)
+    {
+        endpoint_ = new_value;
+    }
+
+    /**
+     * Getter for ReaderResourceLimitsQos
+     * @return ReaderResourceLimitsQos reference
+     */
+    RTPS_DllAPI ReaderResourceLimitsQos& reader_resource_limits()
+    {
+        return reader_resource_limits_;
+    }
+
+    /**
+     * Getter for ReaderResourceLimitsQos
+     * @return ReaderResourceLimitsQos const reference
+     */
+    RTPS_DllAPI const ReaderResourceLimitsQos& reader_resource_limits() const
+    {
+        return reader_resource_limits_;
+    }
+
+    /**
+     * Setter for ReaderResourceLimitsQos
+     * @param new_value new value for the ReaderResourceLimitsQos
+     */
+    RTPS_DllAPI void reader_resource_limits(
+            const ReaderResourceLimitsQos& new_value)
+    {
+        reader_resource_limits_ = new_value;
+    }
+
+private:
+
+    //!Durability Qos, implemented in the library.
+    DurabilityQosPolicy durability_;
+
+    //!Deadline Qos, implemented in the library.
+    DeadlineQosPolicy deadline_;
+
+    //!Latency Budget Qos, implemented in the library.
+    LatencyBudgetQosPolicy latency_budget_;
+
+    //!Liveliness Qos, implemented in the library.
+    LivelinessQosPolicy liveliness_;
+
+    //!Reliability Qos, implemented in the library.
+    ReliabilityQosPolicy reliability_;
+
+    //!Destination Order Qos, NOT implemented in the library.
+    DestinationOrderQosPolicy destination_order_;
+
+    //!History Qos, implemented in the library.
+    HistoryQosPolicy history_;
+
+    //!Resource Limits Qos, implemented in the library.
+    ResourceLimitsQosPolicy resource_limits_;
+
+    //!User Data Qos, implemented in the library.
+    UserDataQosPolicy user_data_;
+
+    //!Ownership Qos, implemented in the library.
+    OwnershipQosPolicy ownership_;
+
+    //!Time Based Filter Qos, NOT implemented in the library.
+    TimeBasedFilterQosPolicy time_based_filter_;
+
+    //!Reader Data Lifecycle Qos, NOT implemented in the library.
+    ReaderDataLifecycleQosPolicy reader_data_lifecycle_;
+
+
+    //!Lifespan Qos (Extension).
+    LifespanQosPolicy lifespan_;
+
+    //!Durability Service Qos (Extension).
+    DurabilityServiceQosPolicy durability_service_;
+
+    //!Reliable reader configuration (Extension)
+    RTPSReliableReaderQos reliable_reader_qos_;
+
+    //! Tipe consistency (Extension)
+    TypeConsistencyQos type_consistency_;
+
+    //!Expects Inline QOS (Extension).
+    bool expects_inline_qos_;
+
+    //!Properties (Extension).
+    PropertyPolicyQos properties_;
+
+    //!Endpoint configuration (Extension)
+    RTPSEndpointQos endpoint_;
+
+    //!ReaderResourceLimitsQos
+    ReaderResourceLimitsQos reader_resource_limits_;
+};
+
+RTPS_DllAPI extern const DataReaderQos DATAREADER_QOS_DEFAULT;
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_DATAREADERQOS_HPP

+ 155 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/ReaderQos.hpp

@@ -0,0 +1,155 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ReaderQos.hpp
+ *
+ */
+
+#ifndef _FASTDDS_DDS_QOS_READERQOS_HPP_
+#define _FASTDDS_DDS_QOS_READERQOS_HPP_
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class ReaderQos, contains all the possible Qos that can be set for a determined Subscriber.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTRTPS_ATTRIBUTES_MODULE
+ */
+class ReaderQos
+{
+public:
+
+    RTPS_DllAPI ReaderQos()
+    {
+    }
+
+    RTPS_DllAPI virtual ~ReaderQos()
+    {
+    }
+
+    bool operator ==(
+            const ReaderQos& b) const
+    {
+        return (m_durability == b.m_durability) &&
+               (m_deadline == b.m_deadline) &&
+               (m_latencyBudget == b.m_latencyBudget) &&
+               (m_liveliness == b.m_liveliness) &&
+               (m_reliability == b.m_reliability) &&
+               (m_ownership == b.m_ownership) &&
+               (m_destinationOrder == b.m_destinationOrder) &&
+               (m_userData == b.m_userData) &&
+               (m_timeBasedFilter == b.m_timeBasedFilter) &&
+               (m_presentation == b.m_presentation) &&
+               (m_partition == b.m_partition) &&
+               (m_topicData == b.m_topicData) &&
+               (m_groupData == b.m_groupData) &&
+               (m_durabilityService == b.m_durabilityService) &&
+               (m_lifespan == b.m_lifespan) &&
+               (m_disablePositiveACKs == b.m_disablePositiveACKs) &&
+               (type_consistency == b.type_consistency) &&
+               (representation == b.representation);
+    }
+
+    //!Durability Qos, implemented in the library.
+    DurabilityQosPolicy m_durability;
+
+    //!Deadline Qos, implemented in the library.
+    DeadlineQosPolicy m_deadline;
+
+    //!Latency Budget Qos, NOT implemented in the library.
+    LatencyBudgetQosPolicy m_latencyBudget;
+
+    //!Liveliness Qos, implemented in the library.
+    LivelinessQosPolicy m_liveliness;
+
+    //!ReliabilityQos, implemented in the library.
+    ReliabilityQosPolicy m_reliability;
+
+    //!Ownership Qos, NOT implemented in the library.
+    OwnershipQosPolicy m_ownership;
+
+    //!Destinatio Order Qos, NOT implemented in the library.
+    DestinationOrderQosPolicy m_destinationOrder;
+
+    //!UserData Qos, NOT implemented in the library.
+    UserDataQosPolicy m_userData;
+
+    //!Time Based Filter Qos, NOT implemented in the library.
+    TimeBasedFilterQosPolicy m_timeBasedFilter;
+
+    //!Presentation Qos, NOT implemented in the library.
+    PresentationQosPolicy m_presentation;
+
+    //!Partition Qos, implemented in the library.
+    PartitionQosPolicy m_partition;
+
+    //!Topic Data Qos, NOT implemented in the library.
+    TopicDataQosPolicy m_topicData;
+
+    //!GroupData Qos, NOT implemented in the library.
+    GroupDataQosPolicy m_groupData;
+
+    //!Durability Service Qos, NOT implemented in the library.
+    DurabilityServiceQosPolicy m_durabilityService;
+
+    //!Lifespan Qos, NOT implemented in the library.
+    LifespanQosPolicy m_lifespan;
+
+    //!Data Representation Qos, implemented in the library.
+    DataRepresentationQosPolicy representation;
+
+    //!Type consistency enforcement Qos, NOT implemented in the library.
+    TypeConsistencyEnforcementQosPolicy type_consistency;
+
+    //!Disable positive ACKs QoS
+    DisablePositiveACKsQosPolicy m_disablePositiveACKs;
+
+    /**
+     * Set Qos from another class
+     * @param readerqos Reference from a ReaderQos object.
+     * @param first_time Boolean indicating whether is the first time (If not some parameters cannot be set).
+     */
+    RTPS_DllAPI void setQos(
+            const ReaderQos& readerqos,
+            bool first_time);
+
+    /**
+     * Check if the Qos values are compatible between each other.
+     * @return True if correct.
+     */
+    RTPS_DllAPI bool checkQos() const;
+
+    /**
+     * Check if the Qos can be update with the values provided. This method DOES NOT update anything.
+     * @param qos Reference to the new qos.
+     * @return True if they can be updated.
+     */
+    RTPS_DllAPI bool canQosBeUpdated(
+            const ReaderQos& qos) const;
+
+    void clear();
+};
+
+} //namespace dds
+} //namespace fastdds
+} //namespace eprosima
+
+#endif // _FASTDDS_DDS_QOS_READERQOS_HPP_

+ 198 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp

@@ -0,0 +1,198 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SubscriberQos.hpp
+ *
+ */
+
+#ifndef _FASTDDS_SUBSCRIBERQOS_HPP_
+#define _FASTDDS_SUBSCRIBERQOS_HPP_
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+#include <fastrtps/attributes/SubscriberAttributes.h>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class SubscriberQos, contains all the possible Qos that can be set for a determined Subscriber.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class SubscriberQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI SubscriberQos()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~SubscriberQos()
+    {
+    }
+
+    bool operator ==(
+            const SubscriberQos& b) const
+    {
+        return (presentation_ == b.presentation_) &&
+               (partition_ == b.partition_) &&
+               (group_data_ == b.group_data_) &&
+               (entity_factory_ == b.entity_factory_);
+    }
+
+    /**
+     * Getter for PresentationQosPolicy
+     * @return PresentationQosPolicy reference
+     */
+    const PresentationQosPolicy& presentation() const
+    {
+        return presentation_;
+    }
+
+    /**
+     * Getter for PresentationQosPolicy
+     * @return PresentationQosPolicy reference
+     */
+    PresentationQosPolicy& presentation()
+    {
+        return presentation_;
+    }
+
+    /**
+     * Setter for PresentationQosPolicy
+     * @param presentation new value for the PresentationQosPolicy
+     */
+    void presentation(
+            const PresentationQosPolicy& presentation)
+    {
+        presentation_ = presentation;
+    }
+
+    /**
+     * Getter for PartitionQosPolicy
+     * @return PartitionQosPolicy reference
+     */
+    const PartitionQosPolicy& partition() const
+    {
+        return partition_;
+    }
+
+    /**
+     * Getter for PartitionQosPolicy
+     * @return PartitionQosPolicy reference
+     */
+    PartitionQosPolicy& partition()
+    {
+        return partition_;
+    }
+
+    /**
+     * Setter for PartitionQosPolicy
+     * @param partition new value for the PartitionQosPolicy
+     */
+    void partition(
+            const PartitionQosPolicy& partition)
+    {
+        partition_ = partition;
+    }
+
+    /**
+     * Getter for GroupDataQosPolicy
+     * @return GroupDataQosPolicy reference
+     */
+    const GroupDataQosPolicy& group_data() const
+    {
+        return group_data_;
+    }
+
+    /**
+     * Getter for GroupDataQosPolicy
+     * @return GroupDataQosPolicy reference
+     */
+    GroupDataQosPolicy& group_data()
+    {
+        return group_data_;
+    }
+
+    /**
+     * Setter for GroupDataQosPolicy
+     * @param group_data new value for the GroupDataQosPolicy
+     */
+    void group_data(
+            const GroupDataQosPolicy& group_data)
+    {
+        group_data_ = group_data;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    const EntityFactoryQosPolicy& entity_factory() const
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Getter for EntityFactoryQosPolicy
+     * @return EntityFactoryQosPolicy reference
+     */
+    EntityFactoryQosPolicy& entity_factory()
+    {
+        return entity_factory_;
+    }
+
+    /**
+     * Setter for EntityFactoryQosPolicy
+     * @param entity_factory new value for the EntityFactoryQosPolicy
+     */
+    void entity_factory(
+            const EntityFactoryQosPolicy& entity_factory)
+    {
+        entity_factory_ = entity_factory;
+    }
+
+private:
+
+    //!Presentation Qos, NOT implemented in the library.
+    PresentationQosPolicy presentation_;
+
+    //!Partition Qos, implemented in the library.
+    PartitionQosPolicy partition_;
+
+    //!Group Data Qos, implemented in the library.
+    GroupDataQosPolicy group_data_;
+
+    //!Entity Factory Qos, implemented in the library
+    EntityFactoryQosPolicy entity_factory_;
+};
+
+RTPS_DllAPI extern const SubscriberQos SUBSCRIBER_QOS_DEFAULT;
+
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_SUBSCRIBERQOS_HPP_ */

+ 155 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/Topic.hpp

@@ -0,0 +1,155 @@
+// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Topic.hpp
+ */
+
+#ifndef _FASTDDS_TOPIC_HPP_
+#define _FASTDDS_TOPIC_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/dds/core/Entity.hpp>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+#include <fastdds/dds/topic/TopicDescription.hpp>
+#include <fastdds/dds/topic/qos/TopicQos.hpp>
+
+using eprosima::fastrtps::types::ReturnCode_t;
+
+namespace dds {
+namespace topic {
+
+class Topic;
+
+} // namespace topic
+} // namespace dds
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+class TopicListener;
+class DomainParticipantImpl;
+class TopicImpl;
+
+/**
+ * Class TopicDescription, represents the fact that both publications
+ * and subscriptions are tied to a single data-type
+ * @ingroup FASTDDS_MODULE
+ */
+class Topic : public DomainEntity, public TopicDescription
+{
+    friend class TopicImpl;
+    friend class DomainParticipantImpl;
+
+    /**
+     * Create a topic, assigning its pointer to the associated implementation.
+     * Don't use directly, create Topic using create_topic from Participant.
+     */
+    RTPS_DllAPI Topic(
+            const std::string& topic_name,
+            const std::string& type_name,
+            TopicImpl* p,
+            const StatusMask& mask = StatusMask::all());
+
+    RTPS_DllAPI Topic(
+            DomainParticipant* dp,
+            const std::string& topic_name,
+            const std::string& type_name,
+            const TopicQos& qos = TOPIC_QOS_DEFAULT,
+            TopicListener* listener = nullptr,
+            const StatusMask& mask = StatusMask::all());
+
+public:
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~Topic();
+
+    /**
+     * @brief Getter for the DomainParticipant
+     * @return DomainParticipant pointer
+     */
+    virtual DomainParticipant* get_participant() const override;
+
+    /**
+     * Allows the application to retrieve the INCONSISTENT_TOPIC_STATUS status of a Topic.
+     * @param status [out] Status to be retrieved.
+     * @return RETCODE_OK
+     */
+    ReturnCode_t get_inconsistent_topic_status(
+            InconsistentTopicStatus& status);
+
+    /**
+     * Allows accessing the Topic Qos.
+     * @return reference to TopicQos
+     */
+    RTPS_DllAPI const TopicQos& get_qos() const;
+
+    /**
+     * Retrieves the Topic Qos.
+     * @param qos TopicQos where the qos is returned
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t get_qos(
+            TopicQos& qos) const;
+
+    /**
+     * Allows modifying the Topic Qos.
+     * The given Qos must be supported by the Topic.
+     * @param qos new TopicQos value to set for the Topic.
+     * @retval RETCODE_IMMUTABLE_POLICY if a change was not allowed.
+     * @retval RETCODE_INCONSISTENT_POLICY if new qos has inconsistent values.
+     * @retval RETCODE_OK if qos was updated.
+     */
+    RTPS_DllAPI ReturnCode_t set_qos(
+            const TopicQos& qos);
+
+    /**
+     * Retrieves the attached TopicListener.
+     * @return pointer to TopicListener
+     */
+    RTPS_DllAPI const TopicListener* get_listener() const;
+
+    /**
+     * Modifies the TopicListener.
+     * @param listener new value for the TopicListener
+     * @param mask StatusMask (default: all)
+     * @return RETCODE_OK
+     */
+    RTPS_DllAPI ReturnCode_t set_listener(
+            TopicListener* listener,
+            const StatusMask& mask = StatusMask::all());
+
+    /**
+     * @brief Getter for the TopicDescriptionImpl
+     * @return pointer to TopicDescriptionImpl
+     */
+    TopicDescriptionImpl* get_impl() const override;
+
+private:
+
+    TopicImpl* impl_;
+
+    friend class ::dds::topic::Topic;
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_TOPIC_HPP_ */

+ 299 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicDataType.hpp

@@ -0,0 +1,299 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TopicDataType.hpp
+ */
+
+#ifndef _FASTDDS_TOPICDATATYPE_HPP_
+#define _FASTDDS_TOPICDATATYPE_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+
+#include <string>
+#include <functional>
+
+namespace eprosima {
+
+namespace fastrtps {
+
+namespace rtps {
+struct SerializedPayload_t;
+struct InstanceHandle_t;
+} // namespace rtps
+} // namespace fastrtps
+
+namespace fastdds {
+namespace dds {
+
+class TypeSupport;
+
+/**
+ * Class TopicDataType used to provide the DomainRTPSParticipant with the methods to serialize, deserialize and get the key of a specific data type.
+ * The user should created a class that inherits from this one, where Serialize and deserialize methods MUST be implemented.
+ * @ingroup FASTRTPS_MODULE, FASTDDS_MODULE
+ */
+class TopicDataType
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TopicDataType()
+        : m_typeSize(0)
+        , m_isGetKeyDefined(false)
+        , auto_fill_type_object_(true)
+        , auto_fill_type_information_(true)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    RTPS_DllAPI virtual ~TopicDataType()
+    {
+    }
+
+    /**
+     * Serialize method, it should be implemented by the user, since it is abstract.
+     * It is VERY IMPORTANT that the user sets the SerializedPayload length correctly.
+     * @param[in] data Pointer to the data
+     * @param[out] payload Pointer to the payload
+     * @return True if correct.
+     */
+    RTPS_DllAPI virtual bool serialize(
+            void* data,
+            fastrtps::rtps::SerializedPayload_t* payload) = 0;
+
+    /**
+     * Deserialize method, it should be implemented by the user, since it is abstract.
+     * @param[in] payload Pointer to the payload
+     * @param[out] data Pointer to the data
+     * @return True if correct.
+     */
+    RTPS_DllAPI virtual bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data) = 0;
+
+    /**
+     * @brief Gets the SerializedSizeProvider function
+     * @param data Pointer
+     * @return function
+     */
+    RTPS_DllAPI virtual std::function<uint32_t()> getSerializedSizeProvider(
+            void* data) = 0;
+
+    /**
+     * Create a Data Type.
+     * @return Void pointer to the created object.
+     */
+    RTPS_DllAPI virtual void* createData() = 0;
+    /**
+     * Remove a previously created object.
+     * @param data Pointer to the created Data.
+     */
+    RTPS_DllAPI virtual void deleteData(
+            void* data) = 0;
+
+    /**
+     * Get the key associated with the data.
+     * @param[in] data Pointer to the data.
+     * @param[out] ihandle Pointer to the Handle.
+     * @param[in] force_md5 Force MD5 checking.
+     * @return True if correct.
+     */
+    RTPS_DllAPI virtual bool getKey(
+            void* data,
+            fastrtps::rtps::InstanceHandle_t* ihandle,
+            bool force_md5 = false) = 0;
+
+    /**
+     * Set topic data type name
+     * @param nam Topic data type name
+     */
+    RTPS_DllAPI inline void setName(
+            const char* nam)
+    {
+        m_topicDataTypeName = std::string(nam);
+    }
+
+    /**
+     * Get topic data type name
+     * @return Topic data type name
+     */
+    RTPS_DllAPI inline const char* getName() const
+    {
+        return m_topicDataTypeName.c_str();
+    }
+
+    /**
+     * Get the type object auto-fill configuration
+     * @return true if the type object should be auto-filled
+     */
+    RTPS_DllAPI inline bool auto_fill_type_object() const
+    {
+        return auto_fill_type_object_;
+    }
+
+    /**
+     * Set the type object auto-fill configuration
+     * @param auto_fill_type_object new value to set
+     */
+    RTPS_DllAPI inline void auto_fill_type_object(
+            bool auto_fill_type_object)
+    {
+        auto_fill_type_object_ = auto_fill_type_object;
+    }
+
+    /**
+     * Get the type information auto-fill configuration
+     * @return true if the type information should be auto-filled
+     */
+    RTPS_DllAPI inline bool auto_fill_type_information() const
+    {
+        return auto_fill_type_information_;
+    }
+
+    /**
+     * Set type information auto-fill configuration
+     * @param auto_fill_type_information new value to set
+     */
+    RTPS_DllAPI inline void auto_fill_type_information(
+            bool auto_fill_type_information)
+    {
+        auto_fill_type_information_ = auto_fill_type_information;
+    }
+
+    /**
+     * Get the type identifier
+     * @return TypeIdV1
+     */
+    RTPS_DllAPI inline const std::shared_ptr<TypeIdV1> type_identifier() const
+    {
+        return type_identifier_;
+    }
+
+    /**
+     * Set type identifier
+     * @param id new value for TypeIdV1
+     */
+    RTPS_DllAPI inline void type_identifier(
+            const TypeIdV1& id)
+    {
+        type_identifier_ = std::make_shared<TypeIdV1>(id);
+    }
+
+    /**
+     * Set type identifier
+     * @param id shared pointer to TypeIdV1
+     */
+    RTPS_DllAPI inline void type_identifier(
+            const std::shared_ptr<TypeIdV1> id)
+    {
+        type_identifier_ = std::move(id);
+    }
+
+    /**
+     * Get the type object
+     * @return TypeObjectV1
+     */
+    RTPS_DllAPI inline const std::shared_ptr<TypeObjectV1> type_object() const
+    {
+        return type_object_;
+    }
+
+    /**
+     * Set type object
+     * @param object new value for TypeObjectV1
+     */
+    RTPS_DllAPI inline void type_object(
+            const TypeObjectV1& object)
+    {
+        type_object_ = std::make_shared<TypeObjectV1>(object);
+    }
+
+    /**
+     * Set type object
+     * @param object shared pointer to TypeObjectV1
+     */
+    RTPS_DllAPI inline void type_object(
+            std::shared_ptr<TypeObjectV1> object)
+    {
+        type_object_ = std::move(object);
+    }
+
+    /**
+     * Get the type information
+     * @return TypeInformation
+     */
+    RTPS_DllAPI inline const std::shared_ptr<xtypes::TypeInformation> type_information() const
+    {
+        return type_information_;
+    }
+
+    /**
+     * Set type information
+     * @param info new value for TypeInformation
+     */
+    RTPS_DllAPI inline void type_information(
+            const xtypes::TypeInformation& info)
+    {
+        type_information_ = std::make_shared<xtypes::TypeInformation>(info);
+    }
+
+    /**
+     * Set type information
+     * @param info shared pointer to TypeInformation
+     */
+    RTPS_DllAPI inline void type_information(
+            std::shared_ptr<xtypes::TypeInformation> info)
+    {
+        type_information_ = std::move(info);
+    }
+
+    //! Maximum serialized size of the type in bytes.
+    //! If the type has unbounded fields, and therefore cannot have a maximum size, use 0.
+    uint32_t m_typeSize;
+
+    //! Indicates whether the method to obtain the key has been implemented.
+    bool m_isGetKeyDefined;
+
+protected:
+
+    //!Type Identifier XTYPES 1.1
+    std::shared_ptr<TypeIdV1> type_identifier_;
+    //!Type Object XTYPES 1.1
+    std::shared_ptr<TypeObjectV1> type_object_;
+    //!XTYPES 1.2
+    std::shared_ptr<xtypes::TypeInformation> type_information_;
+
+private:
+
+    //! Data Type Name.
+    std::string m_topicDataTypeName;
+
+    bool auto_fill_type_object_;
+    bool auto_fill_type_information_;
+
+    friend class fastdds::dds::TypeSupport;
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_TOPICDATATYPE_HPP_ */

+ 105 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicDescription.hpp

@@ -0,0 +1,105 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TopicDescription.hpp
+ */
+
+#ifndef _FASTDDS_TOPIC_DESCRIPTION_HPP_
+#define _FASTDDS_TOPIC_DESCRIPTION_HPP_
+
+#include <string>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+class TopicDescriptionImpl;
+
+/**
+ * Class TopicDescription, represents the fact that both publications
+ * and subscriptions are tied to a single data-type
+ * @ingroup FASTDDS_MODULE
+ */
+class TopicDescription
+{
+public:
+
+    /**
+     * Get the DomainParticipant to which the TopicDescription belongs.
+     * @return The DomainParticipant to which the TopicDescription belongs.
+     */
+    virtual DomainParticipant* get_participant() const = 0;
+
+    /**
+     * Get the name used to create this TopicDescription.
+     * @return the name used to create this TopicDescription.
+     */
+    const std::string& get_name() const
+    {
+        return name_;
+    }
+
+    /**
+     * Get the associated type name.
+     * @return the type name.
+     */
+    const std::string& get_type_name() const
+    {
+        return type_name_;
+    }
+
+    /**
+     * Get the TopicDescriptionImpl
+     * @return pointer to TopicDescriptionImpl
+     */
+    virtual TopicDescriptionImpl* get_impl() const = 0;
+
+protected:
+
+    /**
+     * @brief Constructor using topic name and data type name
+     * @param name Name for the topic
+     * @param type_name Data type name
+     */
+    TopicDescription(
+            const std::string& name,
+            const std::string& type_name)
+        : name_(name)
+        , type_name_(type_name)
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~TopicDescription()
+    {
+    }
+
+protected:
+
+    //! Name that allows the TopicDescription to be retrieved locally
+    std::string name_;
+
+    //! Name that defines a unique resulting type for the publication or the subscription
+    std::string type_name_;
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_TOPIC_DESCRIPTION_HPP_ */

+ 73 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/TopicListener.hpp

@@ -0,0 +1,73 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file SubscriberListener.hpp
+ */
+
+#ifndef _FASTDDS_TOPICLISTENER_HPP_
+#define _FASTDDS_TOPICLISTENER_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/dds/core/status/BaseStatus.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class Topic;
+
+/**
+ * Class TopicListener, it should be used by the end user to implement specific callbacks to certain actions.
+ * @ingroup FASTDDS_MODULE
+ */
+class RTPS_DllAPI TopicListener
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    TopicListener()
+    {
+    }
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~TopicListener()
+    {
+    }
+
+    /**
+     * Virtual function to be implemented by the user containing the actions to be performed when
+     * another topic exists with the same name but different characteristics.
+     * @param topic Topic
+     * @param status The inconsistent topic status
+     */
+    virtual void on_inconsistent_topic(
+            Topic* topic,
+            InconsistentTopicStatus status)
+    {
+        (void)topic;
+        (void)status;
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_TOPICLISTENER_HPP_ */

+ 224 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/TypeSupport.hpp

@@ -0,0 +1,224 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TypeSupport.hpp
+ */
+
+#ifndef _FASTDDS_TYPE_SUPPORT_HPP_
+#define _FASTDDS_TYPE_SUPPORT_HPP_
+
+#include <fastdds/dds/topic/TopicDataType.hpp>
+#include <fastrtps/types/DynamicPubSubType.h>
+#include <fastrtps/types/TypesBase.h>
+
+#include <string>
+#include <functional>
+#include <memory>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+class DomainParticipant;
+
+/**
+ * @note This class inherits from std::shared_ptr<TopicDataType>.
+ * @brief Class TypeSupport used to provide the DomainRTPSParticipant with the methods to serialize,
+ * deserialize and get the key of a specific data type.
+ * The user should created a class that inherits from this one,
+ * where Serialize and deserialize methods MUST be implemented.
+ * @ingroup FASTDDS_MODULE
+ */
+class TypeSupport : public std::shared_ptr<fastdds::dds::TopicDataType>
+{
+public:
+
+    using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t;
+
+    using Base = std::shared_ptr<fastdds::dds::TopicDataType>;
+    using Base::operator ->;
+    using Base::operator *;
+    using Base::operator bool;
+    using Base::operator =;
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TypeSupport()
+        : std::shared_ptr<fastdds::dds::TopicDataType>(nullptr)
+    {
+    }
+
+    /**
+     * @brief Copy Constructor
+     * @param type Another instance of TypeSupport
+     */
+    RTPS_DllAPI TypeSupport(
+            const TypeSupport& type)
+        : std::shared_ptr<fastdds::dds::TopicDataType>(type)
+    {
+    }
+
+    /*!
+     * \brief TypeSupport constructor that receives a TopicDataType pointer.
+     * The passed pointer will be managed by the TypeSupport object, so creating two TypeSupport
+     * from the same pointer or deleting the passed pointer will produce a runtime error.
+     * \param ptr
+     */
+    RTPS_DllAPI explicit TypeSupport(
+            fastdds::dds::TopicDataType* ptr)
+        : std::shared_ptr<fastdds::dds::TopicDataType>(ptr)
+    {
+    }
+
+    /*!
+     * \brief TypeSupport constructor that receives a DynamicPubSubType.
+     * It will copy the instance so the user will keep the ownership of his object.
+     * \param ptr
+     */
+    RTPS_DllAPI TypeSupport(
+            fastrtps::types::DynamicPubSubType ptr)
+        : std::shared_ptr<fastdds::dds::TopicDataType>(std::make_shared<fastrtps::types::DynamicPubSubType>(std::move(
+                    ptr)))
+    {
+    }
+
+    /**
+     * @brief Registers the type on a participant
+     * @param participant DomainParticipant where the type is going to be registered
+     * @return RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with
+     * the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly
+     */
+    RTPS_DllAPI virtual ReturnCode_t register_type(
+            DomainParticipant* participant) const;
+
+    /**
+     * @brief Registers the type on a participant
+     * @param participant DomainParticipant where the type is going to be registered
+     * @param type_name Name of the type to register
+     * @return RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with
+     * the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly
+     */
+    RTPS_DllAPI virtual ReturnCode_t register_type(
+            DomainParticipant* participant,
+            std::string type_name) const;
+
+    /**
+     * @brief Getter for the type name
+     * @return name of the data type
+     */
+    RTPS_DllAPI virtual const std::string& get_type_name() const
+    {
+        return get()->m_topicDataTypeName;
+    }
+
+    /**
+     * @brief Serializes the data
+     * @param data Pointer to data
+     * @param payload Pointer to payload
+     * @return true if it is serialized correctly, false if not
+     */
+    RTPS_DllAPI virtual bool serialize(
+            void* data,
+            fastrtps::rtps::SerializedPayload_t* payload)
+    {
+        return get()->serialize(data, payload);
+    }
+
+    /**
+     * @brief Deserializes the data
+     * @param payload Pointer to payload
+     * @param data Pointer to data
+     * @return true if it is deserialized correctly, false if not
+     */
+    RTPS_DllAPI virtual bool deserialize(
+            fastrtps::rtps::SerializedPayload_t* payload,
+            void* data)
+    {
+        return get()->deserialize(payload, data);
+    }
+
+    /**
+     * @brief Getter for the SerializedSizeProvider
+     * @param data Pointer to data
+     * @return function
+     */
+    RTPS_DllAPI virtual std::function<uint32_t()> get_serialized_size_provider(
+            void* data)
+    {
+        return get()->getSerializedSizeProvider(data);
+    }
+
+    /**
+     * @brief Creates new data
+     * @return Pointer to the data
+     */
+    RTPS_DllAPI virtual void* create_data()
+    {
+        return get()->createData();
+    }
+
+    /**
+     * @brief Deletes data
+     * @param data Pointer to the data to delete
+     */
+    RTPS_DllAPI virtual void delete_data(
+            void* data)
+    {
+        return get()->deleteData(data);
+    }
+
+    /**
+     * @brief Getter for the data key
+     * @param data Pointer to data
+     * @param i_handle InstanceHandle pointer to store the key
+     * @param force_md5 boolean to force md5 (default: false)
+     * @return true if the key is returned, false if not
+     */
+    RTPS_DllAPI virtual bool get_key(
+            void* data,
+            fastrtps::rtps::InstanceHandle_t* i_handle,
+            bool force_md5 = false)
+    {
+        return get()->getKey(data, i_handle, force_md5);
+    }
+
+    RTPS_DllAPI virtual bool operator ==(
+            const TypeSupport& type_support)
+    {
+        return get()->m_typeSize == type_support->m_typeSize
+               && get()->m_isGetKeyDefined == type_support->m_isGetKeyDefined
+               && get()->m_topicDataTypeName == type_support->m_topicDataTypeName
+               && get()->type_identifier() == type_support->type_identifier()
+               && get()->type_information() == type_support->type_information()
+               && get()->type_object() == type_support->type_object();
+    }
+
+    /**
+     * @brief Check if the TypeSupport is empty
+     * @return true if empty, false if not
+     */
+    RTPS_DllAPI bool empty() const
+    {
+        return get() == nullptr;
+    }
+
+};
+
+} /* namespace dds */
+} /* namespace fastdds */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_TYPE_SUPPORT_HPP_ */

+ 509 - 0
thirdpartylib/FastRTPS/include/fastdds/dds/topic/qos/TopicQos.hpp

@@ -0,0 +1,509 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file TopicQos.hpp
+ */
+
+
+#ifndef _FASTDDS_TOPICQOS_HPP
+#define _FASTDDS_TOPICQOS_HPP
+
+#include <fastdds/dds/core/policy/QosPolicies.hpp>
+#include <fastrtps/attributes/TopicAttributes.h>
+
+#include <fastdds/dds/log/Log.hpp>
+
+namespace eprosima {
+namespace fastdds {
+namespace dds {
+
+/**
+ * Class TopicQos, containing all the possible Qos that can be set for a determined Topic.
+ * Although these values can be set and are transmitted
+ * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
+ * Please consult each of them to check for implementation details and default values.
+ * @ingroup FASTDDS_QOS_MODULE
+ */
+class TopicQos
+{
+public:
+
+    /**
+     * @brief Constructor
+     */
+    RTPS_DllAPI TopicQos();
+
+    bool operator ==(
+            const TopicQos& b) const
+    {
+        return (this->topic_data_ == b.topic_data()) &&
+               (this->durability_ == b.durability()) &&
+               (this->durability_service_ == b.durability_service()) &&
+               (this->deadline_ == b.deadline()) &&
+               (this->latency_budget_ == b.latency_budget()) &&
+               (this->liveliness_ == b.liveliness()) &&
+               (this->reliability_ == b.reliability()) &&
+               (this->destination_order_ == b.destination_order()) &&
+               (this->history_ == b.history()) &&
+               (this->resource_limits_ == b.resource_limits()) &&
+               (this->transport_priority_ == b.transport_priority()) &&
+               (this->lifespan_ == b.lifespan()) &&
+               (this->ownership_ == b.ownership());
+    }
+
+    /**
+     * Getter for TopicDataQosPolicy
+     * @return TopicDataQos reference
+     */
+    const TopicDataQosPolicy& topic_data() const
+    {
+        return topic_data_;
+    }
+
+    /**
+     * Getter for TopicDataQosPolicy
+     * @return TopicDataQos reference
+     */
+    TopicDataQosPolicy& topic_data()
+    {
+        return topic_data_;
+    }
+
+    /**
+     * Setter for TopicDataQosPolicy
+     * @param value new value for the TopicDataQosPolicy
+     */
+    void topic_data(
+            const TopicDataQosPolicy& value)
+    {
+        topic_data_ = value;
+    }
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQos reference
+     */
+    const DurabilityQosPolicy& durability() const
+    {
+        return durability_;
+    }
+
+    /**
+     * Getter for DurabilityQosPolicy
+     * @return DurabilityQos reference
+     */
+    DurabilityQosPolicy& durability()
+    {
+        return durability_;
+    }
+
+    /**
+     * Setter for DurabilityQosPolicy
+     * @param durability new value for the DurabilityQosPolicy
+     */
+    void durability(
+            const DurabilityQosPolicy& durability)
+    {
+        durability_ = durability;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQos reference
+     */
+    const DurabilityServiceQosPolicy& durability_service() const
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Getter for DurabilityServiceQosPolicy
+     * @return DurabilityServiceQos reference
+     */
+    DurabilityServiceQosPolicy& durability_service()
+    {
+        return durability_service_;
+    }
+
+    /**
+     * Setter for DurabilityServiceQosPolicy
+     * @param durability_service new value for the DurabilityServiceQosPolicy
+     */
+    void durability_service(
+            const DurabilityServiceQosPolicy& durability_service)
+    {
+        durability_service_ = durability_service;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQos reference
+     */
+    const DeadlineQosPolicy& deadline() const
+    {
+        return deadline_;
+    }
+
+    /**
+     * Getter for DeadlineQosPolicy
+     * @return DeadlineQos reference
+     */
+    DeadlineQosPolicy& deadline()
+    {
+        return deadline_;
+    }
+
+    /**
+     * Setter for DeadlineQosPolicy
+     * @param deadline new value for the DeadlineQosPolicy
+     */
+    void deadline(
+            const DeadlineQosPolicy& deadline)
+    {
+        deadline_ = deadline;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQos reference
+     */
+    const LatencyBudgetQosPolicy& latency_budget() const
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Getter for LatencyBudgetQosPolicy
+     * @return LatencyBudgetQos reference
+     */
+    LatencyBudgetQosPolicy& latency_budget()
+    {
+        return latency_budget_;
+    }
+
+    /**
+     * Setter for LatencyBudgetQosPolicy
+     * @param latency_budget new value for the LatencyBudgetQosPolicy
+     */
+    void latency_budget(
+            const LatencyBudgetQosPolicy& latency_budget)
+    {
+        latency_budget_ = latency_budget;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQos reference
+     */
+    const LivelinessQosPolicy& liveliness() const
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Getter for LivelinessQosPolicy
+     * @return LivelinessQos reference
+     */
+    LivelinessQosPolicy& liveliness()
+    {
+        return liveliness_;
+    }
+
+    /**
+     * Setter for LivelinessQosPolicy
+     * @param liveliness new value for the LivelinessQosPolicy
+     */
+    void liveliness(
+            const LivelinessQosPolicy& liveliness)
+    {
+        liveliness_ = liveliness;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQos reference
+     */
+    const ReliabilityQosPolicy& reliability() const
+    {
+        return reliability_;
+    }
+
+    /**
+     * Getter for ReliabilityQosPolicy
+     * @return ReliabilityQos reference
+     */
+    ReliabilityQosPolicy& reliability()
+    {
+        return reliability_;
+    }
+
+    /**
+     * Setter for ReliabilityQosPolicy
+     * @param reliability new value for the ReliabilityQosPolicy
+     */
+    void reliability(
+            const ReliabilityQosPolicy& reliability)
+    {
+        reliability_ = reliability;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQos reference
+     */
+    const DestinationOrderQosPolicy& destination_order() const
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Getter for DestinationOrderQosPolicy
+     * @return DestinationOrderQos reference
+     */
+    DestinationOrderQosPolicy& destination_order()
+    {
+        return destination_order_;
+    }
+
+    /**
+     * Setter for DestinationOrderQosPolicy
+     * @param destination_order new value for the DestinationOrderQosPolicy
+     */
+    void destination_order(
+            const DestinationOrderQosPolicy& destination_order)
+    {
+        destination_order_ = destination_order;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQos reference
+     */
+    const HistoryQosPolicy& history() const
+    {
+        return history_;
+    }
+
+    /**
+     * Getter for HistoryQosPolicy
+     * @return HistoryQos reference
+     */
+    HistoryQosPolicy& history()
+    {
+        return history_;
+    }
+
+    /**
+     * Setter for HistoryQosPolicy
+     * @param history new value for the HistoryQosPolicy
+     */
+    void history(
+            const HistoryQosPolicy& history)
+    {
+        history_ = history;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQos reference
+     */
+    const ResourceLimitsQosPolicy& resource_limits() const
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Getter for ResourceLimitsQosPolicy
+     * @return ResourceLimitsQos reference
+     */
+    ResourceLimitsQosPolicy& resource_limits()
+    {
+        return resource_limits_;
+    }
+
+    /**
+     * Setter for ResourceLimitsQosPolicy
+     * @param resource_limits new value for the ResourceLimitsQosPolicy
+     */
+    void resource_limits(
+            const ResourceLimitsQosPolicy& resource_limits)
+    {
+        resource_limits_ = resource_limits;
+    }
+
+    /**
+     * Getter for TransportPriorityQosPolicy
+     * @return TransportPriorityQos reference
+     */
+    const TransportPriorityQosPolicy& transport_priority() const
+    {
+        return transport_priority_;
+    }
+
+    /**
+     * Getter for TransportPriorityQosPolicy
+     * @return TransportPriorityQos reference
+     */
+    TransportPriorityQosPolicy& transport_priority()
+    {
+        return transport_priority_;
+    }
+
+    /**
+     * Setter for TransportPriorityQosPolicy
+     * @param transport_priority new value for the TransportPriorityQosPolicy
+     */
+    void transport_priority(
+            const TransportPriorityQosPolicy& transport_priority)
+    {
+        transport_priority_ = transport_priority;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQos reference
+     */
+    const LifespanQosPolicy& lifespan() const
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Getter for LifespanQosPolicy
+     * @return LifespanQos reference
+     */
+    LifespanQosPolicy& lifespan()
+    {
+        return lifespan_;
+    }
+
+    /**
+     * Setter for LifespanQosPolicy
+     * @param lifespan new value for the LifespanQosPolicy
+     */
+    void lifespan(
+            const LifespanQosPolicy& lifespan)
+    {
+        lifespan_ = lifespan;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQos reference
+     */
+    const OwnershipQosPolicy& ownership() const
+    {
+        return ownership_;
+    }
+
+    /**
+     * Getter for OwnershipQosPolicy
+     * @return OwnershipQos reference
+     */
+    OwnershipQosPolicy& ownership()
+    {
+        return ownership_;
+    }
+
+    /**
+     * Setter for OwnershipQosPolicy
+     * @param ownership new value for the OwnershipQosPolicy
+     */
+    void ownership(
+            const OwnershipQosPolicy& ownership)
+    {
+        ownership_ = ownership;
+    }
+
+    /**
+     * Getter for DataRepresentationQosPolicy
+     * @return DataRepresentationQosPolicy reference
+     */
+    const DataRepresentationQosPolicy& representation() const
+    {
+        return representation_;
+    }
+
+    /**
+     * Getter for DataRepresentationQosPolicy
+     * @return DataRepresentationQosPolicy reference
+     */
+    DataRepresentationQosPolicy& representation()
+    {
+        return representation_;
+    }
+
+    /**
+     * Setter for DataRepresentationQosPolicy
+     * @param representation new value for the DataRepresentationQosPolicy
+     */
+    void representation(
+            const DataRepresentationQosPolicy& representation)
+    {
+        representation_ = representation;
+    }
+
+private:
+
+    //!Topic Data Qos, NOT implemented in the library.
+    TopicDataQosPolicy topic_data_;
+
+    //!Durability Qos, implemented in the library.
+    DurabilityQosPolicy durability_;
+
+    //!Durability Service Qos, NOT implemented in the library.
+    DurabilityServiceQosPolicy durability_service_;
+
+    //!Deadline Qos, implemented in the library.
+    DeadlineQosPolicy deadline_;
+
+    //!Latency Budget Qos, NOT implemented in the library.
+    LatencyBudgetQosPolicy latency_budget_;
+
+    //!Liveliness Qos, implemented in the library.
+    LivelinessQosPolicy liveliness_;
+
+    //!Reliability Qos, implemented in the library.
+    ReliabilityQosPolicy reliability_;
+
+    //!Destination Order Qos, NOT implemented in the library.
+    DestinationOrderQosPolicy destination_order_;
+
+    //!History Qos, implemented in the library.
+    HistoryQosPolicy history_;
+
+    //!Resource Limits Qos, implemented in the library.
+    ResourceLimitsQosPolicy resource_limits_;
+
+    //!Transport Priority Qos, NOT implemented in the library.
+    TransportPriorityQosPolicy transport_priority_;
+
+    //!Lifespan Qos, implemented in the library.
+    LifespanQosPolicy lifespan_;
+
+    //!Ownership Qos, NOT implemented in the library.
+    OwnershipQosPolicy ownership_;
+
+    //!Data Representation Qos, (XTypes extension).
+    DataRepresentationQosPolicy representation_;
+};
+
+RTPS_DllAPI extern const TopicQos TOPIC_QOS_DEFAULT;
+
+} // namespace dds
+} // namespace fastdds
+} // namespace eprosima
+
+#endif // _FASTDDS_TOPICQOS_HPP

+ 115 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/Endpoint.h

@@ -0,0 +1,115 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Endpoint.h
+ */
+
+#ifndef _FASTDDS_RTPS_ENDPOINT_H_
+#define _FASTDDS_RTPS_ENDPOINT_H_
+
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/Locator.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/attributes/EndpointAttributes.h>
+#include <fastrtps/utils/TimedMutex.hpp>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class RTPSParticipantImpl;
+class ResourceEvent;
+
+
+/**
+ * Class Endpoint, all entities of the RTPS network derive from this class.
+ * Although the RTPSParticipant is also defined as an endpoint in the RTPS specification, in this implementation
+ * the RTPSParticipant class **does not** inherit from the endpoint class. Each Endpoint object owns a pointer to the
+ * RTPSParticipant it belongs to.
+ * @ingroup COMMON_MODULE
+ */
+class Endpoint
+{
+    friend class RTPSParticipantImpl;
+
+    protected:
+
+    Endpoint(
+            RTPSParticipantImpl* pimpl,
+            const GUID_t& guid,
+            const EndpointAttributes& att)
+        : mp_RTPSParticipant(pimpl)
+        , m_guid(guid)
+        , m_att(att)
+#if HAVE_SECURITY
+        ,supports_rtps_protection_(true)
+#endif
+    {
+    }
+
+    virtual ~Endpoint() = default;
+
+    public:
+    /**
+     * Get associated GUID
+     * @return Associated GUID
+     */
+    RTPS_DllAPI inline const GUID_t& getGuid() const { return m_guid; }
+
+    /**
+     * Get mutex
+     * @return Associated Mutex
+     */
+    RTPS_DllAPI inline RecursiveTimedMutex& getMutex() { return mp_mutex; }
+
+    /**
+     * Get associated attributes
+     * @return Endpoint attributes
+     */
+    RTPS_DllAPI inline EndpointAttributes& getAttributes() { return m_att; }
+
+#if HAVE_SECURITY
+    bool supports_rtps_protection() { return supports_rtps_protection_; }
+#endif
+
+    protected:
+
+    //!Pointer to the RTPSParticipant containing this endpoint.
+    RTPSParticipantImpl* mp_RTPSParticipant;
+
+    //!Endpoint GUID
+    const GUID_t m_guid;
+
+    //!Endpoint Attributes
+    EndpointAttributes m_att;
+
+    //!Endpoint Mutex
+    mutable RecursiveTimedMutex mp_mutex;
+
+    private:
+
+    Endpoint& operator=(const Endpoint&) = delete;
+
+#if HAVE_SECURITY
+    bool supports_rtps_protection_;
+#endif
+};
+
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+
+#endif //_FASTDDS_RTPS_ENDPOINT_H_

+ 202 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/RTPSDomain.h

@@ -0,0 +1,202 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file RTPSDomain.h
+ */
+
+#ifndef _FASTDDS_RTPS_DOMAIN_H_
+#define _FASTDDS_RTPS_DOMAIN_H_
+
+#include <fastdds/rtps/common/Types.h>
+
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+
+#include <atomic>
+#include <mutex>
+#include <set>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class RTPSParticipantImpl;
+class RTPSParticipant;
+class RTPSParticipantListener;
+class RTPSWriter;
+class WriterAttributes;
+class WriterHistory;
+class WriterListener;
+class RTPSReader;
+class ReaderAttributes;
+class ReaderHistory;
+class ReaderListener;
+class RTPSDomainImpl;
+
+/**
+ * Class RTPSDomain,it manages the creation and destruction of RTPSParticipant RTPSWriter and RTPSReader. It stores
+ * a list of all created RTPSParticipant. Is has only static methods.
+ * @ingroup RTPS_MODULE
+ */
+class RTPSDomain
+{
+
+    friend class RTPSDomainImpl;
+
+public:
+
+    /**
+     * Method to shut down all RTPSParticipants, readers, writers, etc.
+     * It must be called at the end of the process to avoid memory leaks.
+     * It also shut downs the DomainRTPSParticipant.
+     */
+    RTPS_DllAPI static void stopAll();
+
+    /**
+     * @brief Create a RTPSParticipant.
+     * @param domain_id DomainId to be used by the RTPSParticipant (80 by default).
+     * @param attrs RTPSParticipant Attributes.
+     * @param plisten Pointer to the ParticipantListener.
+     * @return Pointer to the RTPSParticipant.
+     */
+    RTPS_DllAPI static RTPSParticipant* createParticipant(
+            uint32_t domain_id,
+            const RTPSParticipantAttributes& attrs,
+            RTPSParticipantListener* plisten = nullptr);
+
+    /**
+     * @brief Create a RTPSParticipant.
+     * @param domain_id DomainId to be used by the RTPSParticipant (80 by default).
+     * @param enabled True if the RTPSParticipant should be enabled on creation. False if it will be enabled later with RTPSParticipant::enable()
+     * @param attrs RTPSParticipant Attributes.
+     * @param plisten Pointer to the ParticipantListener.
+     * @return Pointer to the RTPSParticipant.
+     */
+    RTPS_DllAPI static RTPSParticipant* createParticipant(
+            uint32_t domain_id,
+            bool enabled,
+            const RTPSParticipantAttributes& attrs,
+            RTPSParticipantListener* plisten = nullptr);
+
+    /**
+     * Create a RTPSWriter in a participant.
+     * @param p Pointer to the RTPSParticipant.
+     * @param watt Writer Attributes.
+     * @param hist Pointer to the WriterHistory.
+     * @param listen Pointer to the WriterListener.
+     * @return Pointer to the created RTPSWriter.
+     */
+    RTPS_DllAPI static RTPSWriter* createRTPSWriter(
+            RTPSParticipant* p,
+            WriterAttributes& watt,
+            WriterHistory* hist,
+            WriterListener* listen = nullptr);
+
+    /**
+     * Remove a RTPSWriter.
+     * @param writer Pointer to the writer you want to remove.
+     * @return  True if correctly removed.
+     */
+    RTPS_DllAPI static bool removeRTPSWriter(
+            RTPSWriter* writer);
+
+    /**
+     * Create a RTPSReader in a participant.
+     * @param p Pointer to the RTPSParticipant.
+     * @param ratt Reader Attributes.
+     * @param hist Pointer to the ReaderHistory.
+     * @param listen Pointer to the ReaderListener.
+     * @return Pointer to the created RTPSReader.
+     */
+    RTPS_DllAPI static RTPSReader* createRTPSReader(
+            RTPSParticipant* p,
+            ReaderAttributes& ratt,
+            ReaderHistory* hist,
+            ReaderListener* listen = nullptr);
+
+    /**
+     * Remove a RTPSReader.
+     * @param reader Pointer to the reader you want to remove.
+     * @return  True if correctly removed.
+     */
+    RTPS_DllAPI static bool removeRTPSReader(
+            RTPSReader* reader);
+
+    /**
+     * Remove a RTPSParticipant and delete all its associated Writers, Readers, resources, etc.
+     * @param[in] p Pointer to the RTPSParticipant;
+     * @return True if correct.
+     */
+    RTPS_DllAPI static bool removeRTPSParticipant(
+            RTPSParticipant* p);
+
+    /**
+     * Set the maximum RTPSParticipantID.
+     * @param maxRTPSParticipantId ID.
+     */
+    static inline void setMaxRTPSParticipantId(
+            uint32_t maxRTPSParticipantId)
+    {
+        m_maxRTPSParticipantID = maxRTPSParticipantId;
+    }
+
+    /**
+     * Creates a RTPSParticipant as default server or client if ROS_MASTER_URI environment variable is set.
+     * @param domain_id DDS domain associated
+     * @param attrs RTPSParticipant Attributes.
+     * @param listen Pointer to the ParticipantListener.
+     * @return Pointer to the RTPSParticipant.
+     */
+    static RTPSParticipant* clientServerEnvironmentCreationOverride(
+            uint32_t domain_id,
+            const RTPSParticipantAttributes& attrs,
+            RTPSParticipantListener* listen /*= nullptr*/);
+
+private:
+
+    typedef std::pair<RTPSParticipant*, RTPSParticipantImpl*> t_p_RTPSParticipant;
+
+    RTPSDomain() = delete;
+
+    /**
+     * DomainRTPSParticipant destructor
+     */
+    ~RTPSDomain() = delete;
+
+    /**
+     * @brief Get Id to create a RTPSParticipant.
+     * @return Different ID for each call.
+     */
+    static inline uint32_t getNewId()
+    {
+        return m_maxRTPSParticipantID++;
+    }
+
+    static void removeRTPSParticipant_nts(
+            t_p_RTPSParticipant&);
+
+    static std::mutex m_mutex;
+
+    static std::atomic<uint32_t> m_maxRTPSParticipantID;
+
+    static std::vector<t_p_RTPSParticipant> m_RTPSParticipants;
+
+    static std::set<uint32_t> m_RTPSParticipantIDs;
+};
+
+}
+} /* namespace  */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_RTPS_DOMAIN_H_*/

+ 124 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/EndpointAttributes.h

@@ -0,0 +1,124 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file fastdds/rtps/attributes/EndpointAttributes.h
+ */
+
+#ifndef _FASTDDS_ENDPOINTATTRIBUTES_H_
+#define _FASTDDS_ENDPOINTATTRIBUTES_H_
+
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/Locator.h>
+#include <fastdds/rtps/attributes/PropertyPolicy.h>
+#include <fastdds/rtps/security/accesscontrol/EndpointSecurityAttributes.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+/**
+ * Structure EndpointAttributes, describing the attributes associated with an RTPS Endpoint.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class EndpointAttributes
+{
+    public:
+        //!Endpoint kind, default value WRITER
+        EndpointKind_t endpointKind;
+
+        //!Topic kind, default value NO_KEY
+        TopicKind_t topicKind;
+
+        //!Reliability kind, default value BEST_EFFORT
+        ReliabilityKind_t reliabilityKind;
+
+        //!Durability kind, default value VOLATILE
+        DurabilityKind_t durabilityKind;
+
+        //!GUID used for persistence
+        GUID_t persistence_guid;
+
+        //!Unicast locator list
+        LocatorList_t unicastLocatorList;
+
+        //!Multicast locator list
+        LocatorList_t multicastLocatorList;
+
+        //! Remote locator list.
+        LocatorList_t remoteLocatorList;
+
+        //!Properties
+        PropertyPolicy properties;
+
+        EndpointAttributes()
+            : endpointKind(WRITER)
+            , topicKind(NO_KEY)
+            , reliabilityKind(BEST_EFFORT)
+            , durabilityKind(VOLATILE)
+            , persistence_guid()
+            , m_userDefinedID(-1)
+            , m_entityID(-1)
+        {
+        }
+
+        virtual ~EndpointAttributes(){};
+
+        /**
+         * Get the user defined ID
+         * @return User defined ID
+         */
+        inline int16_t getUserDefinedID() const { return m_userDefinedID; }
+
+        /**
+         * Get the entity defined ID
+         * @return Entity ID
+         */
+        inline int16_t getEntityID() const { return m_entityID; }
+
+        /**
+         * Set the user defined ID
+         * @param id User defined ID to be set
+         */
+        inline void setUserDefinedID(uint8_t id) { m_userDefinedID = id; }
+
+        /**
+         * Set the entity ID
+         * @param id Entity ID to be set
+         */
+        inline void setEntityID(uint8_t id) { m_entityID = id; }
+
+    #if HAVE_SECURITY
+        const security::EndpointSecurityAttributes& security_attributes() const { return security_attributes_; }
+
+        security::EndpointSecurityAttributes& security_attributes() { return security_attributes_; }
+    #endif
+
+    private:
+        //!User Defined ID, used for StaticEndpointDiscovery, default value -1.
+        int16_t m_userDefinedID;
+
+        //!Entity ID, if the user want to specify the EntityID of the enpoint, default value -1.
+        int16_t m_entityID;
+
+    #if HAVE_SECURITY
+        security::EndpointSecurityAttributes security_attributes_;
+    #endif
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_ENDPOINTATTRIBUTES_H_ */

+ 90 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/HistoryAttributes.h

@@ -0,0 +1,90 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file HistoryAttributes.h
+ *
+ */
+
+#ifndef _FASTDDS_HISTORYATTRIBUTES_H_
+#define _FASTDDS_HISTORYATTRIBUTES_H_
+
+#include <fastdds/rtps/resources/ResourceManagement.h>
+#include <fastrtps/fastrtps_dll.h>
+
+#include <cstdint>
+
+namespace eprosima{
+namespace fastrtps{
+namespace rtps{
+
+/**
+ * Class HistoryAttributes, to specify the attributes of a WriterHistory or a ReaderHistory.
+ * This class is only intended to be used with the RTPS API.
+ * The Publsiher-Subscriber API has other fields to define this values (HistoryQosPolicy and ResourceLimitsQosPolicy).
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class RTPS_DllAPI HistoryAttributes
+{
+    public:
+        //!Memory management policy.
+        MemoryManagementPolicy_t memoryPolicy;
+
+        //!Maximum payload size of the history, default value 500.
+        uint32_t payloadMaxSize;
+
+        //!Number of the initial Reserved Caches, default value 500.
+        int32_t initialReservedCaches;
+
+        /**
+         * Maximum number of reserved caches. Default value is 0 that indicates to keep reserving until something
+         * breaks.
+         */
+        int32_t maximumReservedCaches;
+
+        //! Default constructor
+        HistoryAttributes()
+            : memoryPolicy(PREALLOCATED_MEMORY_MODE)
+            , payloadMaxSize(500)
+            , initialReservedCaches(500)
+            , maximumReservedCaches(0)
+        {}
+
+        /** Constructor
+         * @param memoryPolicy Set wether memory can be dynamically reallocated or not
+         * @param payload Maximum payload size. It is used when memory management polycy is
+         * PREALLOCATED_MEMORY_MODE or PREALLOCATED_WITH_REALLOC_MEMORY_MODE.
+         * @param initial Initial reserved caches. It is used when memory management policy is
+         * PREALLOCATED_MEMORY_MODE or PREALLOCATED_WITH_REALLOC_MEMORY_MODE.
+         * @param maxRes Maximum reserved caches.
+         */
+        HistoryAttributes(
+                MemoryManagementPolicy_t memoryPolicy,
+                uint32_t payload,
+                int32_t initial,
+                int32_t maxRes)
+            : memoryPolicy(memoryPolicy)
+            , payloadMaxSize(payload)
+            , initialReservedCaches(initial)
+            , maximumReservedCaches(maxRes)
+        {}
+
+        virtual ~HistoryAttributes(){}
+};
+
+}
+}
+}
+
+#endif /* _FASTDDS_HISTORYATTRIBUTES_H_ */

+ 124 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/PropertyPolicy.h

@@ -0,0 +1,124 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*!
+ * @file PropertyPolicy.h
+ */
+#ifndef _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_
+#define _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_
+
+#include <fastdds/rtps/common/Property.h>
+#include <fastdds/rtps/common/BinaryProperty.h>
+#include <fastrtps/fastrtps_dll.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class PropertyPolicy
+{
+    public:
+        RTPS_DllAPI PropertyPolicy() {}
+
+        RTPS_DllAPI PropertyPolicy(const PropertyPolicy& property_policy) :
+            properties_(property_policy.properties_),
+            binary_properties_(property_policy.binary_properties_) {}
+
+        RTPS_DllAPI PropertyPolicy(PropertyPolicy&& property_policy) :
+            properties_(std::move(property_policy.properties_)),
+            binary_properties_(std::move(property_policy.binary_properties_)) {}
+
+        RTPS_DllAPI PropertyPolicy& operator=(const PropertyPolicy& property_policy)
+        {
+            properties_ = property_policy.properties_;
+            binary_properties_ = property_policy.binary_properties_;
+            return *this;
+        }
+
+        RTPS_DllAPI PropertyPolicy& operator=(PropertyPolicy&& property_policy)
+        {
+            properties_ = std::move(property_policy.properties_);
+            binary_properties_= std::move(property_policy.binary_properties_);
+            return *this;
+        }
+
+        RTPS_DllAPI bool operator==(const PropertyPolicy& b) const
+        {
+            return (this->properties_ == b.properties_) &&
+                    (this->binary_properties_ == b.binary_properties_);
+        }
+
+        //!Get properties
+        RTPS_DllAPI const PropertySeq& properties() const
+        {
+            return properties_;
+        }
+
+        //!Set properties
+        RTPS_DllAPI PropertySeq& properties()
+        {
+            return properties_;
+        }
+
+        //!Get binary_properties
+        RTPS_DllAPI const BinaryPropertySeq& binary_properties() const
+        {
+            return binary_properties_;
+        }
+
+        //!Set binary_properties
+        RTPS_DllAPI BinaryPropertySeq& binary_properties()
+        {
+            return binary_properties_;
+        }
+
+    private:
+        PropertySeq properties_;
+
+        BinaryPropertySeq binary_properties_;
+};
+
+class PropertyPolicyHelper
+{
+    public:
+        /*!
+        * @brief Returns only the properties whose name starts with the prefix.
+        * Prefix is removed in returned properties.
+        * @param property_policy PropertyPolicy where properties will be searched.
+        * @param prefix Prefix used to search properties.
+        * @return A copy of properties whose name starts with the prefix.
+        */
+        RTPS_DllAPI static PropertyPolicy get_properties_with_prefix(
+                const PropertyPolicy& property_policy,
+                const std::string& prefix);
+
+        //!Get the length of the property_policy
+        RTPS_DllAPI static size_t length(const PropertyPolicy& property_policy);
+
+        //!Look for a property_policy by name
+        RTPS_DllAPI static std::string* find_property(
+                PropertyPolicy& property_policy,
+                const std::string& name);
+
+        //!Retrieves a property_policy by name
+        RTPS_DllAPI static const std::string* find_property(
+                const PropertyPolicy& property_policy,
+                const std::string& name);
+};
+
+} //namespace rtps
+} //namespace fastrtps
+} //namespace eprosima
+
+#endif // _FASTDDS_RTPS_ATTRIBUTES_PROPERTYPOLICY_H_

+ 178 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp

@@ -0,0 +1,178 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file RTPSParticipantAllocationAttributes.hpp
+ */
+
+#ifndef _FASTDDS_RTPS_RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP_
+#define _FASTDDS_RTPS_RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP_
+
+#include <fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+/**
+ * @brief Holds limits for collections of remote locators.
+ */
+struct RemoteLocatorsAllocationAttributes
+{
+    bool operator ==(
+            const RemoteLocatorsAllocationAttributes& b) const
+    {
+        return (this->max_unicast_locators == b.max_unicast_locators) &&
+               (this->max_multicast_locators == b.max_multicast_locators);
+    }
+
+    /** Maximum number of unicast locators per remote entity.
+     *
+     * This attribute controls the maximum number of unicast locators to keep for
+     * each discovered remote entity (be it a participant, reader of writer). It is
+     * recommended to use the highest number of local addresses found on all the systems
+     * belonging to the same domain as this participant.
+     */
+    size_t max_unicast_locators = 4u;
+
+    /** Maximum number of multicast locators per remote entity.
+     *
+     * This attribute controls the maximum number of multicast locators to keep for
+     * each discovered remote entity (be it a participant, reader of writer). The
+     * default value of 1 is usually enough, as it doesn't make sense to add more
+     * than one multicast locator per entity.
+     */
+    size_t max_multicast_locators = 1u;
+};
+
+/**
+ * @brief Holds limits for send buffers allocations.
+ */
+struct SendBuffersAllocationAttributes
+{
+    bool operator ==(
+            const SendBuffersAllocationAttributes& b) const
+    {
+        return (this->preallocated_number == b.preallocated_number) &&
+               (this->dynamic == b.dynamic);
+    }
+
+    /** Initial number of send buffers to allocate.
+     *
+     * This attribute controls the initial number of send buffers to be allocated.
+     * The default value of 0 will perform an initial guess of the number of buffers
+     * required, based on the number of threads from which a send operation could be
+     * started.
+     */
+    size_t preallocated_number = 0u;
+
+    /** Whether the number of send buffers is allowed to grow.
+     *
+     * This attribute controls how the buffer manager behaves when a send buffer is not
+     * available. When true, a new buffer will be created. When false, it will wait for a
+     * buffer to be returned. This is a tradeoff between latency and dynamic allocations.
+     */
+    bool dynamic = false;
+};
+
+/**
+ * @brief Holds limits for variable-length data.
+ */
+struct VariableLengthDataLimits
+{
+    bool operator ==(
+            const VariableLengthDataLimits& b) const
+    {
+        return (this->max_properties == b.max_properties) &&
+               (this->max_user_data == b.max_user_data) &&
+               (this->max_partitions == b.max_partitions);
+    }
+
+    //! Defines the maximum size (in octets) of properties data in the local or remote participant
+    size_t max_properties = 0;
+    //! Defines the maximum size (in octets) of user data in the local or remote participant
+    size_t max_user_data = 0;
+    //! Defines the maximum size (in octets) of partitions data
+    size_t max_partitions = 0;
+};
+
+/**
+ * @brief Holds allocation limits affecting collections managed by a participant.
+ */
+struct RTPSParticipantAllocationAttributes
+{
+    //! Holds limits for collections of remote locators.
+    RemoteLocatorsAllocationAttributes locators;
+    //! Defines the allocation behaviour for collections dependent on the total number of participants.
+    ResourceLimitedContainerConfig participants;
+    //! Defines the allocation behaviour for collections dependent on the total number of readers per participant.
+    ResourceLimitedContainerConfig readers;
+    //! Defines the allocation behaviour for collections dependent on the total number of writers per participant.
+    ResourceLimitedContainerConfig writers;
+    //! Defines the allocation behaviour for the send buffer manager.
+    SendBuffersAllocationAttributes send_buffers;
+    //! Holds limits for variable-length data
+    VariableLengthDataLimits data_limits;
+
+    //! @return the allocation config for the total of readers in the system (participants * readers)
+    ResourceLimitedContainerConfig total_readers() const
+    {
+        return total_endpoints(readers);
+    }
+
+    //! @return the allocation config for the total of writers in the system (participants * writers)
+    ResourceLimitedContainerConfig total_writers() const
+    {
+        return total_endpoints(writers);
+    }
+
+    bool operator ==(
+            const RTPSParticipantAllocationAttributes& b) const
+    {
+        return (this->locators == b.locators) &&
+               (this->participants == b.participants) &&
+               (this->readers == b.readers) &&
+               (this->writers == b.writers) &&
+               (this->send_buffers == b.send_buffers) &&
+               (this->data_limits == b.data_limits);
+    }
+
+private:
+
+    ResourceLimitedContainerConfig total_endpoints(
+            const ResourceLimitedContainerConfig& endpoints) const
+    {
+        constexpr size_t max = std::numeric_limits<size_t>::max();
+        size_t initial;
+        size_t maximum;
+        size_t increment;
+
+        initial = participants.initial * endpoints.initial;
+        maximum = (participants.maximum == max || endpoints.maximum == max)
+                ? max : participants.maximum * endpoints.maximum;
+        increment = std::max(participants.increment, endpoints.increment);
+
+        return { initial, maximum, increment };
+    }
+
+};
+
+const RTPSParticipantAllocationAttributes c_default_RTPSParticipantAllocationAttributes
+    = RTPSParticipantAllocationAttributes();
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_RTPS_RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP_ */

+ 471 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h

@@ -0,0 +1,471 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file RTPSParticipantAttributes.h
+ */
+
+#ifndef _FASTDDS_RTPSPARTICIPANTPARAMETERS_H_
+#define _FASTDDS_RTPSPARTICIPANTPARAMETERS_H_
+
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/Locator.h>
+#include <fastdds/rtps/common/PortParameters.h>
+#include <fastdds/rtps/attributes/PropertyPolicy.h>
+#include <fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h>
+#include <fastdds/rtps/transport/TransportInterface.h>
+#include <fastdds/rtps/resources/ResourceManagement.h>
+#include <fastrtps/utils/fixed_size_string.hpp>
+#include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
+#include <fastdds/rtps/attributes/ServerAttributes.h>
+
+#include <memory>
+#include <sstream>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+
+//!PDP subclass choice
+typedef enum DiscoveryProtocol
+{
+    NONE,
+    /*!<
+        NO discovery whatsoever would be used.
+        Publisher and Subscriber defined with the same topic name would NOT be linked.
+        All matching must be done manually through the addReaderLocator, addReaderProxy, addWriterProxy methods.
+     */
+    SIMPLE,
+    /*!<
+        Discovery works according to 'The Real-time Publish-Subscribe Protocol(RTPS) DDS
+        Interoperability Wire Protocol Specification'
+     */
+    EXTERNAL,
+    /*!<
+        A user defined PDP subclass object must be provided in the attributes that deals with the discovery.
+        Framework is not responsible of this object lifetime.
+     */
+    CLIENT, /*!< The participant will behave as a client concerning discovery operation.
+                 Server locators should be specified as attributes. */
+    SERVER, /*!< The participant will behave as a server concerning discovery operation.
+                 Discovery operation is volatile (discovery handshake must take place if shutdown). */
+    BACKUP  /*!< The participant will behave as a server concerning discovery operation.
+                 Discovery operation persist on a file (discovery handshake wouldn't repeat if shutdown). */
+
+} DiscoveryProtocol_t;
+
+//!Filtering flags when discovering participants
+typedef enum ParticipantFilteringFlags : uint32_t
+{
+    NO_FILTER = 0,
+    FILTER_DIFFERENT_HOST = 0x1,
+    FILTER_DIFFERENT_PROCESS = 0x2,
+    FILTER_SAME_PROCESS = 0x4
+} ParticipantFilteringFlags_t;
+
+#define BUILTIN_DATA_MAX_SIZE 512
+
+//! PDP factory for EXTERNAL type
+class PDP;
+class BuiltinProtocols;
+
+typedef struct _PDPFactory
+{
+    // Pointer to the PDP creator
+    PDP* (*CreatePDPInstance)(BuiltinProtocols*);
+    // Pointer to the PDP destructor
+    void (* ReleasePDPInstance)(
+            PDP*);
+
+    bool operator ==(
+            const struct _PDPFactory& e) const
+    {
+        return (CreatePDPInstance == e.CreatePDPInstance)
+               && (ReleasePDPInstance == e.ReleasePDPInstance);
+    }
+
+} PDPFactory;
+
+/**
+ * Class SimpleEDPAttributes, to define the attributes of the Simple Endpoint Discovery Protocol.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class SimpleEDPAttributes
+{
+public:
+
+    //!Default value true.
+    bool use_PublicationWriterANDSubscriptionReader;
+
+    //!Default value true.
+    bool use_PublicationReaderANDSubscriptionWriter;
+
+#if HAVE_SECURITY
+    bool enable_builtin_secure_publications_writer_and_subscriptions_reader;
+
+    bool enable_builtin_secure_subscriptions_writer_and_publications_reader;
+#endif
+
+    SimpleEDPAttributes()
+        : use_PublicationWriterANDSubscriptionReader(true)
+        , use_PublicationReaderANDSubscriptionWriter(true)
+#if HAVE_SECURITY
+        , enable_builtin_secure_publications_writer_and_subscriptions_reader(true)
+        , enable_builtin_secure_subscriptions_writer_and_publications_reader(true)
+#endif
+    {
+    }
+
+    bool operator ==(
+            const SimpleEDPAttributes& b) const
+    {
+        return (this->use_PublicationWriterANDSubscriptionReader == b.use_PublicationWriterANDSubscriptionReader) &&
+#if HAVE_SECURITY
+               (this->enable_builtin_secure_publications_writer_and_subscriptions_reader ==
+               b.enable_builtin_secure_publications_writer_and_subscriptions_reader) &&
+               (this->enable_builtin_secure_subscriptions_writer_and_publications_reader ==
+               b.enable_builtin_secure_subscriptions_writer_and_publications_reader) &&
+#endif
+               (this->use_PublicationReaderANDSubscriptionWriter == b.use_PublicationReaderANDSubscriptionWriter);
+    }
+
+};
+
+/**
+ * Struct InitialAnnouncementConfig defines the behavior of the RTPSParticipant initial announcements.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+struct InitialAnnouncementConfig
+{
+    /// Number of initial announcements with specific period (default 5)
+    uint32_t count = 5u;
+
+    /// Specific period for initial announcements (default 100ms)
+    Duration_t period = { 0, 100000000u };
+
+    bool operator ==(
+            const InitialAnnouncementConfig& b) const
+    {
+        return (count == b.count) && (period == b.period);
+    }
+
+};
+
+/**
+ * Class DiscoverySettings, to define the attributes of the several discovery protocols available
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+
+class DiscoverySettings
+{
+public:
+
+    //! Chosen discovery protocol
+    DiscoveryProtocol_t discoveryProtocol = DiscoveryProtocol_t::SIMPLE;
+
+    /**
+     * If set to true, SimpleEDP would be used.
+     */
+    bool use_SIMPLE_EndpointDiscoveryProtocol = true;
+
+    /**
+     * If set to true, StaticEDP based on an XML file would be implemented.
+     * The XML filename must be provided.
+     */
+    bool use_STATIC_EndpointDiscoveryProtocol = false;
+
+    /**
+     * Lease Duration of the RTPSParticipant,
+     * indicating how much time remote RTPSParticipants should consider this RTPSParticipant alive.
+     */
+    Duration_t leaseDuration = { 20, 0 };
+
+    /**
+     * The period for the RTPSParticipant to send its Discovery Message to all other discovered RTPSParticipants
+     * as well as to all Multicast ports.
+     */
+    Duration_t leaseDuration_announcementperiod = { 3, 0 };
+
+    //!Initial announcements configuration
+    InitialAnnouncementConfig initial_announcements;
+
+    //!Attributes of the SimpleEDP protocol
+    SimpleEDPAttributes m_simpleEDP;
+
+    //! function that returns a PDP object (only if EXTERNAL selected)
+    PDPFactory m_PDPfactory{};
+    /**
+     * The period for the RTPSParticipant to:
+     *  send its Discovery Message to its servers
+     *  check for EDP endpoints matching
+     */
+    Duration_t discoveryServer_client_syncperiod = { 0, 450 * 1000000}; // 450 milliseconds
+
+    //! Discovery Server settings, only needed if use_CLIENT_DiscoveryProtocol=true
+    RemoteServerList_t m_DiscoveryServers;
+
+    //! Filtering participants out depending on location
+    ParticipantFilteringFlags_t ignoreParticipantFlags = ParticipantFilteringFlags::NO_FILTER;
+
+    DiscoverySettings() = default;
+
+    bool operator ==(
+            const DiscoverySettings& b) const
+    {
+        return (this->discoveryProtocol == b.discoveryProtocol) &&
+               (this->use_SIMPLE_EndpointDiscoveryProtocol == b.use_SIMPLE_EndpointDiscoveryProtocol) &&
+               (this->use_STATIC_EndpointDiscoveryProtocol == b.use_STATIC_EndpointDiscoveryProtocol) &&
+               (this->discoveryServer_client_syncperiod == b.discoveryServer_client_syncperiod) &&
+               (this->m_PDPfactory == b.m_PDPfactory) &&
+               (this->leaseDuration == b.leaseDuration) &&
+               (this->leaseDuration_announcementperiod == b.leaseDuration_announcementperiod) &&
+               (this->initial_announcements == b.initial_announcements) &&
+               (this->m_simpleEDP == b.m_simpleEDP) &&
+               (this->m_staticEndpointXMLFilename == b.m_staticEndpointXMLFilename) &&
+               (this->m_DiscoveryServers == b.m_DiscoveryServers) &&
+               (this->ignoreParticipantFlags == b.ignoreParticipantFlags);
+    }
+
+    /**
+     * Get the static endpoint XML filename
+     * @return Static endpoint XML filename
+     */
+    const char* getStaticEndpointXMLFilename() const
+    {
+        return m_staticEndpointXMLFilename.c_str();
+    }
+
+    /**
+     * Set the static endpoint XML filename
+     * @param str Static endpoint XML filename
+     */
+    void setStaticEndpointXMLFilename(
+            const char* str)
+    {
+        m_staticEndpointXMLFilename = std::string(str);
+    }
+
+private:
+
+    //! StaticEDP XML filename, only necessary if use_STATIC_EndpointDiscoveryProtocol=true
+    std::string m_staticEndpointXMLFilename = "";
+};
+
+/**
+ * TypeLookupService settings.
+ */
+class TypeLookupSettings
+{
+public:
+
+    //!Indicates to use the TypeLookup Service client endpoints
+    bool use_client = false;
+
+    //!Indicates to use the TypeLookup Service server endpoints
+    bool use_server = false;
+
+};
+
+/**
+ * Class BuiltinAttributes, to define the behavior of the RTPSParticipant builtin protocols.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class BuiltinAttributes
+{
+public:
+
+    //! Discovery protocol related attributes
+    DiscoverySettings discovery_config;
+
+    //!Indicates to use the WriterLiveliness protocol.
+    bool use_WriterLivelinessProtocol = true;
+
+    //!TypeLookup Service settings
+    TypeLookupSettings typelookup_config;
+
+    //!Metatraffic Unicast Locator List
+    LocatorList_t metatrafficUnicastLocatorList;
+
+    //!Metatraffic Multicast Locator List.
+    LocatorList_t metatrafficMulticastLocatorList;
+
+    //! Initial peers.
+    LocatorList_t initialPeersList;
+
+    //! Memory policy for builtin readers
+    MemoryManagementPolicy_t readerHistoryMemoryPolicy =
+            MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
+
+    //! Maximum payload size for builtin readers
+    uint32_t readerPayloadSize = BUILTIN_DATA_MAX_SIZE;
+
+    //! Memory policy for builtin writers
+    MemoryManagementPolicy_t writerHistoryMemoryPolicy =
+            MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
+
+    //! Maximum payload size for builtin writers
+    uint32_t writerPayloadSize = BUILTIN_DATA_MAX_SIZE;
+
+    //! Mutation tries if the port is being used.
+    uint32_t mutation_tries = 100u;
+
+    //!Set to true to avoid multicast traffic on builtin endpoints
+    bool avoid_builtin_multicast = true;
+
+    BuiltinAttributes() = default;
+
+    virtual ~BuiltinAttributes() = default;
+
+    bool operator ==(
+            const BuiltinAttributes& b) const
+    {
+        return (this->discovery_config == b.discovery_config) &&
+               (this->use_WriterLivelinessProtocol == b.use_WriterLivelinessProtocol) &&
+               (typelookup_config.use_client == b.typelookup_config.use_client) &&
+               (typelookup_config.use_server == b.typelookup_config.use_server) &&
+               (this->metatrafficUnicastLocatorList == b.metatrafficUnicastLocatorList) &&
+               (this->metatrafficMulticastLocatorList == b.metatrafficMulticastLocatorList) &&
+               (this->initialPeersList == b.initialPeersList) &&
+               (this->readerHistoryMemoryPolicy == b.readerHistoryMemoryPolicy) &&
+               (this->readerPayloadSize == b.readerPayloadSize) &&
+               (this->writerHistoryMemoryPolicy == b.writerHistoryMemoryPolicy) &&
+               (this->writerPayloadSize == b.writerPayloadSize) &&
+               (this->mutation_tries == b.mutation_tries) &&
+               (this->avoid_builtin_multicast == b.avoid_builtin_multicast);
+    }
+
+};
+
+/**
+ * Class RTPSParticipantAttributes used to define different aspects of a RTPSParticipant.
+ *@ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class RTPSParticipantAttributes
+{
+public:
+
+    RTPSParticipantAttributes()
+    {
+        setName("RTPSParticipant");
+        sendSocketBufferSize = 0;
+        listenSocketBufferSize = 0;
+        participantID = -1;
+        useBuiltinTransports = true;
+    }
+
+    virtual ~RTPSParticipantAttributes()
+    {
+    }
+
+    bool operator ==(
+            const RTPSParticipantAttributes& b) const
+    {
+        return (this->name == b.name) &&
+               (this->defaultUnicastLocatorList == b.defaultUnicastLocatorList) &&
+               (this->defaultMulticastLocatorList == b.defaultMulticastLocatorList) &&
+               (this->sendSocketBufferSize == b.sendSocketBufferSize) &&
+               (this->listenSocketBufferSize == b.listenSocketBufferSize) &&
+               (this->builtin == b.builtin) &&
+               (this->port == b.port) &&
+               (this->userData == b.userData) &&
+               (this->participantID == b.participantID) &&
+               (this->throughputController == b.throughputController) &&
+               (this->useBuiltinTransports == b.useBuiltinTransports) &&
+               (this->properties == b.properties &&
+               (this->prefix == b.prefix));
+    }
+
+    /**
+     * Default list of Unicast Locators to be used for any Endpoint defined inside this RTPSParticipant in the case
+     * that it was defined with NO UnicastLocators. At least ONE locator should be included in this list.
+     */
+    LocatorList_t defaultUnicastLocatorList;
+
+    /**
+     * Default list of Multicast Locators to be used for any Endpoint defined inside this RTPSParticipant in the
+     * case that it was defined with NO UnicastLocators. This is usually left empty.
+     */
+    LocatorList_t defaultMulticastLocatorList;
+
+    /*!
+     * @brief Send socket buffer size for the send resource. Zero value indicates to use default system buffer size.
+     * Default value: 0.
+     */
+    uint32_t sendSocketBufferSize;
+
+    /*! Listen socket buffer for all listen resources. Zero value indicates to use default system buffer size.
+     * Default value: 0.
+     */
+    uint32_t listenSocketBufferSize;
+
+    //! Optionally allows user to define the GuidPrefix_t
+    GuidPrefix_t prefix;
+
+    RTPS_DllAPI inline bool ReadguidPrefix(
+            const char* pfx)
+    {
+        return bool(std::istringstream(pfx) >> prefix);
+    }
+
+    //! Builtin parameters.
+    BuiltinAttributes builtin;
+
+    //!Port Parameters
+    PortParameters port;
+
+    //!User Data of the participant
+    std::vector<octet> userData;
+
+    //!Participant ID
+    int32_t participantID;
+
+    //!Throughput controller parameters. Leave default for uncontrolled flow.
+    ThroughputControllerDescriptor throughputController;
+
+    //!User defined transports to use alongside or in place of builtins.
+    std::vector<std::shared_ptr<fastdds::rtps::TransportDescriptorInterface> > userTransports;
+
+    //!Set as false to disable the default UDPv4 implementation.
+    bool useBuiltinTransports;
+    //!Holds allocation limits affecting collections managed by a participant.
+    RTPSParticipantAllocationAttributes allocation;
+
+    //! Property policies
+    PropertyPolicy properties;
+
+    //!Set the name of the participant.
+    inline void setName(
+            const char* nam)
+    {
+        name = nam;
+    }
+
+    //!Get the name of the participant.
+    inline const char* getName() const
+    {
+        return name.c_str();
+    }
+
+private:
+
+    //!Name of the participant.
+    string_255 name;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_RTPSPARTICIPANTPARAMETERS_H_ */

+ 111 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/ReaderAttributes.h

@@ -0,0 +1,111 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ReaderAttributes.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_
+#define _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_
+
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/attributes/EndpointAttributes.h>
+#include <fastrtps/qos/QosPolicies.h>
+#include <fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp>
+
+#include <functional>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+/**
+ * Class ReaderTimes, defining the times associated with the Reliable Readers events.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class ReaderTimes
+{
+public:
+
+    ReaderTimes()
+    {
+        initialAcknackDelay.nanosec = 70*1000*1000;
+        heartbeatResponseDelay.nanosec = 5*1000*1000;
+    }
+
+    virtual ~ReaderTimes() {}
+
+    bool operator==(
+            const ReaderTimes& b) const
+    {
+        return (this->initialAcknackDelay == b.initialAcknackDelay)  &&
+               (this->heartbeatResponseDelay == b.heartbeatResponseDelay);
+    }
+
+    //!Initial AckNack delay. Default value 70ms.
+    Duration_t initialAcknackDelay;
+    //!Delay to be applied when a hearbeat message is received, default value 5ms.
+    Duration_t heartbeatResponseDelay;
+};
+
+/**
+ * Class ReaderAttributes, to define the attributes of a RTPSReader.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class ReaderAttributes
+{
+public:
+
+    ReaderAttributes()
+        : liveliness_kind_(AUTOMATIC_LIVELINESS_QOS)
+        , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+        , expectsInlineQos(false)
+        , disable_positive_acks(false)
+    {
+        endpoint.endpointKind = READER;
+        endpoint.durabilityKind = VOLATILE;
+        endpoint.reliabilityKind = BEST_EFFORT;
+    };
+
+    virtual ~ReaderAttributes() {};
+
+    //!Attributes of the associated endpoint.
+    EndpointAttributes endpoint;
+
+    //!Times associated with this reader (only for stateful readers)
+    ReaderTimes times;
+
+    //! Liveliness kind
+    LivelinessQosPolicyKind liveliness_kind_;
+
+    //! Liveliness lease duration
+    Duration_t liveliness_lease_duration;
+
+    //!Indicates if the reader expects Inline qos, default value 0.
+    bool expectsInlineQos;
+
+    //! Disable positive ACKs
+    bool disable_positive_acks;
+
+    //! Define the allocation behaviour for matched-writer-dependent collections.
+    ResourceLimitedContainerConfig matched_writers_allocation;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_ */

+ 82 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/ServerAttributes.h

@@ -0,0 +1,82 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ServerAttributes.h
+ *
+ */
+
+#ifndef _FASTDDS_SERVERATTRIBUTES_H_
+#define _FASTDDS_SERVERATTRIBUTES_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/common/Locator.h>
+
+#include <list>
+
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+    class ParticipantProxyData;
+
+    /**
+     * Class RemoteServerAttributes, to define the attributes of the Discovery Server Protocol.
+     * @ingroup RTPS_ATTRIBUTES_MODULE
+     */
+
+    class RemoteServerAttributes
+    {
+    public:
+        RTPS_DllAPI inline bool operator==(const RemoteServerAttributes& r) const
+        { return guidPrefix == r.guidPrefix; }
+
+        RTPS_DllAPI GUID_t GetParticipant() const;
+
+        RTPS_DllAPI GUID_t GetPDPReader() const;
+        RTPS_DllAPI GUID_t GetPDPWriter() const;
+
+        RTPS_DllAPI GUID_t GetEDPPublicationsReader() const;
+        RTPS_DllAPI GUID_t GetEDPSubscriptionsWriter() const;
+
+        RTPS_DllAPI GUID_t GetEDPPublicationsWriter() const;
+        RTPS_DllAPI GUID_t GetEDPSubscriptionsReader() const;
+
+        RTPS_DllAPI inline bool ReadguidPrefix(const char * pfx)
+        {
+            return bool(std::istringstream(pfx) >> guidPrefix);
+        }
+
+        //!Metatraffic Unicast Locator List
+        LocatorList_t metatrafficUnicastLocatorList;
+        //!Metatraffic Multicast Locator List.
+        LocatorList_t metatrafficMulticastLocatorList;
+
+        //!Guid prefix
+        GuidPrefix_t guidPrefix;
+
+        // Live participant proxy reference
+        const ParticipantProxyData * proxy{};
+    };
+
+    typedef std::list<RemoteServerAttributes> RemoteServerList_t;
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_SERVERATTRIBUTES_H_ */

+ 147 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/attributes/WriterAttributes.h

@@ -0,0 +1,147 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WriterAttributes.h
+ *
+ */
+#ifndef _FASTDDS_WRITERATTRIBUTES_H_
+#define _FASTDDS_WRITERATTRIBUTES_H_
+
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h>
+#include <fastdds/rtps/attributes/EndpointAttributes.h>
+#include <fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp>
+#include <fastrtps/qos/QosPolicies.h>
+
+#include <functional>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class ReaderProxyData;
+
+typedef enum RTPSWriterPublishMode : octet
+{
+    SYNCHRONOUS_WRITER,
+    ASYNCHRONOUS_WRITER
+} RTPSWriterPublishMode;
+
+
+/**
+ * Struct WriterTimes, defining the times associated with the Reliable Writers events.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+struct WriterTimes
+{
+    //! Initial heartbeat delay. Default value ~11ms.
+    Duration_t initialHeartbeatDelay;
+    //! Periodic HB period, default value 3s.
+    Duration_t heartbeatPeriod;
+    //!Delay to apply to the response of a ACKNACK message, default value ~5ms.
+    Duration_t nackResponseDelay;
+    //!This time allows the RTPSWriter to ignore nack messages too soon after the data as sent, default value 0s.
+    Duration_t nackSupressionDuration;
+
+    WriterTimes()
+    {
+        //initialHeartbeatDelay.fraction = 50*1000*1000;
+        initialHeartbeatDelay.nanosec = 12 * 1000 * 1000;
+        heartbeatPeriod.seconds = 3;
+        //nackResponseDelay.fraction = 20*1000*1000;
+        nackResponseDelay.nanosec = 5 * 1000 * 1000;
+    }
+
+    virtual ~WriterTimes()
+    {
+    }
+
+    bool operator ==(
+            const WriterTimes& b) const
+    {
+        return (this->initialHeartbeatDelay == b.initialHeartbeatDelay) &&
+               (this->heartbeatPeriod == b.heartbeatPeriod) &&
+               (this->nackResponseDelay == b.nackResponseDelay) &&
+               (this->nackSupressionDuration == b.nackSupressionDuration);
+    }
+
+};
+
+/**
+ * Class WriterAttributes, defining the attributes of a RTPSWriter.
+ * @ingroup RTPS_ATTRIBUTES_MODULE
+ */
+class WriterAttributes
+{
+public:
+
+    WriterAttributes()
+        : liveliness_kind(AUTOMATIC_LIVELINESS_QOS)
+        , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+        , liveliness_announcement_period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+        , mode(SYNCHRONOUS_WRITER)
+        , disable_heartbeat_piggyback(false)
+        , disable_positive_acks(false)
+        , keep_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
+    {
+        endpoint.endpointKind = WRITER;
+        endpoint.durabilityKind = TRANSIENT_LOCAL;
+        endpoint.reliabilityKind = RELIABLE;
+    }
+
+    virtual ~WriterAttributes()
+    {
+    }
+
+    //!Attributes of the associated endpoint.
+    EndpointAttributes endpoint;
+
+    //!Writer Times (only used for RELIABLE).
+    WriterTimes times;
+
+    //! Liveliness kind
+    fastrtps::LivelinessQosPolicyKind liveliness_kind;
+
+    //! Liveliness lease duration
+    Duration_t liveliness_lease_duration;
+
+    //! Liveliness announcement period
+    Duration_t liveliness_announcement_period;
+
+    //!Indicates if the Writer is synchronous or asynchronous
+    RTPSWriterPublishMode mode;
+
+    // Throughput controller, always the last one to apply
+    ThroughputControllerDescriptor throughputController;
+
+    //! Disable the sending of heartbeat piggybacks.
+    bool disable_heartbeat_piggyback;
+
+    //! Define the allocation behaviour for matched-reader-dependent collections.
+    ResourceLimitedContainerConfig matched_readers_allocation;
+
+    //! Disable the sending of positive ACKs
+    bool disable_positive_acks;
+
+    //! Keep duration to keep a sample before considering it has been acked
+    Duration_t keep_duration;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif /* _FASTDDS_WRITERATTRIBUTES_H_ */

+ 189 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/BuiltinProtocols.h

@@ -0,0 +1,189 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file BuiltinProtocols.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_BUILTINPROTOCOLS_H_
+#define _FASTDDS_RTPS_BUILTINPROTOCOLS_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <list>
+
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+#include <fastdds/rtps/network/NetworkFactory.h>
+
+namespace eprosima {
+
+namespace fastdds {
+namespace dds {
+namespace builtin {
+
+class TypeLookupManager;
+
+} // namespace builtin
+
+class ReaderQos;
+class WriterQos;
+} // namespace dds
+} // namespace fastdds
+
+namespace fastrtps {
+
+class TopicAttributes;
+
+namespace rtps {
+
+class PDP;
+class WLP;
+class RTPSParticipantImpl;
+class RTPSWriter;
+class RTPSReader;
+
+/**
+ * Class BuiltinProtocols that contains builtin endpoints implementing the discovery and liveliness protocols.
+ * *@ingroup BUILTIN_MODULE
+ */
+class BuiltinProtocols
+{
+    friend class RTPSParticipantImpl;
+
+private:
+
+    BuiltinProtocols();
+    virtual ~BuiltinProtocols();
+
+public:
+
+    /**
+     * Initialize the builtin protocols.
+     * @param attributes Discovery configuration attributes
+     * @param p_part Pointer to the Participant implementation
+     * @return True if correct.
+     */
+    bool initBuiltinProtocols(
+            RTPSParticipantImpl* p_part,
+            BuiltinAttributes& attributes);
+
+    /**
+     * Update the metatraffic locatorlist after it was created. Because when you create
+     * the EDP readers you are not sure the selected endpoints can be used.
+     * @param loclist LocatorList to update
+     * @return True on success
+     */
+    bool updateMetatrafficLocators(
+            LocatorList_t& loclist);
+
+    /**
+     * Traverses the list of discover servers translating from remote to local locators
+     * if possible
+     * @param nf NetworkFactory used to make the translation
+     */
+    void transform_server_remote_locators(
+            NetworkFactory & nf);
+
+    //!BuiltinAttributes of the builtin protocols.
+    BuiltinAttributes m_att;
+    //!Pointer to the RTPSParticipantImpl.
+    RTPSParticipantImpl* mp_participantImpl;
+    //!Pointer to the PDPSimple.
+    PDP* mp_PDP;
+    //!Pointer to the WLP
+    WLP* mp_WLP;
+    //!Pointer to the TypeLookupManager
+    fastdds::dds::builtin::TypeLookupManager* tlm_;
+    //!Locator list for metatraffic
+    LocatorList_t m_metatrafficMulticastLocatorList;
+    //!Locator List for metatraffic unicast
+    LocatorList_t m_metatrafficUnicastLocatorList;
+    //! Initial peers
+    LocatorList_t m_initialPeersList;
+    //! Known discovery and backup server container
+    std::list<RemoteServerAttributes> m_DiscoveryServers;
+
+    /**
+     * Add a local Writer to the BuiltinProtocols.
+     * @param w Pointer to the RTPSWriter
+     * @param topicAtt Attributes of the associated topic
+     * @param wqos QoS policies dictated by the publisher
+     * @return True if correct.
+     */
+    bool addLocalWriter(
+            RTPSWriter* w,
+            const TopicAttributes& topicAtt,
+            const fastdds::dds::WriterQos& wqos);
+    /**
+     * Add a local Reader to the BuiltinProtocols.
+     * @param R Pointer to the RTPSReader.
+     * @param topicAtt Attributes of the associated topic
+     * @param rqos QoS policies dictated by the subscriber
+     * @return True if correct.
+     */
+    bool addLocalReader(
+            RTPSReader* R,
+            const TopicAttributes& topicAtt,
+            const fastdds::dds::ReaderQos& rqos);
+    /**
+     * Update a local Writer QOS
+     * @param W Writer to update
+     * @param topicAtt Attributes of the associated topic
+     * @param wqos New Writer QoS
+     * @return
+     */
+    bool updateLocalWriter(
+            RTPSWriter* W,
+            const TopicAttributes& topicAtt,
+            const fastdds::dds::WriterQos& wqos);
+    /**
+     * Update a local Reader QOS
+     * @param R Reader to update
+     * @param topicAtt Attributes of the associated topic
+     * @param qos New Reader QoS
+     * @return
+     */
+    bool updateLocalReader(
+            RTPSReader* R,
+            const TopicAttributes& topicAtt,
+            const fastdds::dds::ReaderQos& qos);
+    /**
+     * Remove a local Writer from the builtinProtocols.
+     * @param W Pointer to the writer.
+     * @return True if correctly removed.
+     */
+    bool removeLocalWriter(
+            RTPSWriter* W);
+    /**
+     * Remove a local Reader from the builtinProtocols.
+     * @param R Pointer to the reader.
+     * @return True if correctly removed.
+     */
+    bool removeLocalReader(
+            RTPSReader* R);
+
+    //! Announce RTPSParticipantState (force the sending of a DPD message.)
+    void announceRTPSParticipantState();
+    //!Stop the RTPSParticipant Announcement (used in tests to avoid multiple packets being send)
+    void stopRTPSParticipantAnnouncement();
+    //!Reset to timer to make periodic RTPSParticipant Announcements.
+    void resetRTPSParticipantAnnouncement();
+
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ */

+ 229 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/ParticipantProxyData.h

@@ -0,0 +1,229 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ParticipantProxyData.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_
+#define _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+#include <fastrtps/qos/QosPolicies.h>
+
+#include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
+#include <fastdds/rtps/attributes/WriterAttributes.h>
+#include <fastdds/rtps/attributes/ReaderAttributes.h>
+#include <fastdds/rtps/common/Token.h>
+#include <fastdds/rtps/common/RemoteLocators.hpp>
+
+#if HAVE_SECURITY
+#include <fastdds/rtps/security/accesscontrol/ParticipantSecurityAttributes.h>
+#endif
+
+#include <chrono>
+
+#define BUILTIN_PARTICIPANT_DATA_MAX_SIZE 100
+#define TYPELOOKUP_DATA_MAX_SIZE 5000
+
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER              (0x00000001 << 0)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR               (0x00000001 << 1)
+#define DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER              (0x00000001 << 2)
+#define DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR               (0x00000001 << 3)
+#define DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER             (0x00000001 << 4)
+#define DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR              (0x00000001 << 5)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_PROXY_ANNOUNCER        (0x00000001 << 6)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_PROXY_DETECTOR         (0x00000001 << 7)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_STATE_ANNOUNCER        (0x00000001 << 8)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_STATE_DETECTOR         (0x00000001 << 9)
+#define BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER         (0x00000001 << 10)
+#define BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER         (0x00000001 << 11)
+#define BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER  (0x00000001 << 12)
+#define BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER  (0x00000001 << 13)
+#define BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER    (0x00000001 << 14)
+#define BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER    (0x00000001 << 15)
+#define DISC_BUILTIN_ENDPOINT_PUBLICATION_SECURE_ANNOUNCER       (0x00000001 << 16)
+#define DISC_BUILTIN_ENDPOINT_PUBLICATION_SECURE_DETECTOR        (0x00000001 << 17)
+#define DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_SECURE_ANNOUNCER      (0x00000001 << 18)
+#define DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_SECURE_DETECTOR       (0x00000001 << 19)
+#define BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_SECURE_DATA_WRITER  (0x00000001 << 20)
+#define BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_SECURE_DATA_READER  (0x00000001 << 21)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_SECURE_ANNOUNCER       (0x00000001 << 26)
+#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_SECURE_DETECTOR        (0x00000001 << 27)
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+struct CDRMessage_t;
+class PDPSimple;
+class TimedEvent;
+class RTPSParticipantImpl;
+class ReaderProxyData;
+class WriterProxyData;
+class NetworkFactory;
+
+// proxy specific declarations
+template<class Proxy>
+class ProxyHashTable;
+
+/**
+ * ParticipantProxyData class is used to store and convert the information Participants send to each other during the PDP phase.
+ *@ingroup BUILTIN_MODULE
+ */
+class ParticipantProxyData
+{
+public:
+
+    ParticipantProxyData(
+            const RTPSParticipantAllocationAttributes& allocation);
+
+    ParticipantProxyData(
+            const ParticipantProxyData& pdata);
+
+    virtual ~ParticipantProxyData();
+
+    //!Protocol version
+    ProtocolVersion_t m_protocolVersion;
+    //!GUID
+    GUID_t m_guid;
+    //!Vendor ID
+    VendorId_t m_VendorId;
+    //!Expects Inline QOS.
+    bool m_expectsInlineQos;
+    //!Available builtin endpoints
+    BuiltinEndpointSet_t m_availableBuiltinEndpoints;
+    //!Metatraffic locators
+    RemoteLocatorList metatraffic_locators;
+    //!Default locators
+    RemoteLocatorList default_locators;
+    //!Manual liveliness count
+    Count_t m_manualLivelinessCount;
+    //!Participant name
+    string_255 m_participantName;
+    //!
+    InstanceHandle_t m_key;
+    //!
+    Duration_t m_leaseDuration;
+#if HAVE_SECURITY
+    //!
+    IdentityToken identity_token_;
+    //!
+    PermissionsToken permissions_token_;
+    //!
+    security::ParticipantSecurityAttributesMask security_attributes_;
+    //!
+    security::PluginParticipantSecurityAttributesMask plugin_security_attributes_;
+#endif
+    //!
+    bool isAlive;
+    //!
+    ParameterPropertyList_t m_properties;
+    //!
+    UserDataQosPolicy m_userData;
+    //!
+    TimedEvent* lease_duration_event;
+    //!
+    bool should_check_lease_duration;
+    //!
+    ProxyHashTable<ReaderProxyData>* m_readers = nullptr;
+    //!
+    ProxyHashTable<WriterProxyData>* m_writers = nullptr;
+
+    /**
+     * Update the data.
+     * @param pdata Object to copy the data from
+     * @return True on success
+     */
+    bool updateData(
+            ParticipantProxyData& pdata);
+
+    /**
+     * Get the size in bytes of the CDR serialization of this object.
+     * @param include_encapsulation Whether to include the size of the encapsulation info.
+     * @return size in bytes of the CDR serialization.
+     */
+    uint32_t get_serialized_size(
+            bool include_encapsulation) const;
+
+    /**
+     * Write as a parameter list on a CDRMessage_t
+     * @return True on success
+     */
+    bool writeToCDRMessage(
+            CDRMessage_t* msg,
+            bool write_encapsulation);
+
+    /**
+     * Read the parameter list from a recevied CDRMessage_t
+     * @return True on success
+     */
+    bool readFromCDRMessage(
+            CDRMessage_t* msg,
+            bool use_encapsulation,
+            const NetworkFactory& network,
+            bool is_shm_transport_available);
+
+    //! Clear the data (restore to default state).
+    void clear();
+
+    /**
+     * Copy the data from another object.
+     * @param pdata Object to copy the data from
+     */
+    void copy(
+            const ParticipantProxyData& pdata);
+
+    /**
+     * Set participant persistent GUID_t
+     * @param guid valid GUID_t
+     */
+    void set_persistence_guid(
+            const GUID_t& guid);
+
+    /**
+     * Retrieve participant persistent GUID_t
+     * @return guid persistent GUID_t or c_Guid_Unknown
+     */
+    GUID_t get_persistence_guid() const;
+
+    void assert_liveliness();
+
+    const std::chrono::steady_clock::time_point& last_received_message_tm() const
+    {
+        return last_received_message_tm_;
+    }
+
+    const std::chrono::microseconds& lease_duration() const
+    {
+        return lease_duration_;
+    }
+
+private:
+
+    //! Store the last timestamp it was received a RTPS message from the remote participant.
+    std::chrono::steady_clock::time_point last_received_message_tm_;
+
+    //! Remote participant lease duration in microseconds.
+    std::chrono::microseconds lease_duration_;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+
+#endif // _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_

+ 446 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/ReaderProxyData.h

@@ -0,0 +1,446 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file ReaderProxyData.h
+ *
+ */
+
+#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, used to represent all the information on a Reader (both local and remote) with the purpose of
+ * implementing the discovery.
+ * *@ingroup BUILTIN_MODULE
+ */
+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;
+    }
+
+    /**
+     * Get the size in bytes of the CDR serialization of this object.
+     * @param include_encapsulation Whether to include the size of the encapsulation info.
+     * @return size in bytes of the CDR serialization.
+     */
+    uint32_t get_serialized_size(
+            bool include_encapsulation) const;
+
+    /**
+     * Write as a parameter list on a CDRMessage_t
+     * @return True on success
+     */
+    bool writeToCDRMessage(
+            CDRMessage_t* msg,
+            bool write_encapsulation) const;
+
+    /**
+     *  Read the information from a CDRMessage_t. The position of the message must be in the beggining on the parameter list.
+     * @param msg Pointer to the message.
+     * @param network Reference to network factory for locator validation and transformation
+     * @param is_shm_transport_available Indicates wether the Reader is reachable by SHM.
+     * @return true on success
+     */
+    RTPS_DllAPI bool readFromCDRMessage(
+            CDRMessage_t* msg,
+            const NetworkFactory& network,
+            bool is_shm_transport_available);
+
+    //!
+    bool m_expectsInlineQos;
+    //!Reader Qos
+    ReaderQos m_qos;
+
+#if HAVE_SECURITY
+    //!EndpointSecurityInfo.endpoint_security_attributes
+    security::EndpointSecurityAttributesMask security_attributes_;
+
+    //!EndpointSecurityInfo.plugin_endpoint_security_attributes
+    security::PluginEndpointSecurityAttributesMask plugin_security_attributes_;
+#endif
+
+    /**
+     * Clear (put to default) the information.
+     */
+    void clear();
+
+    /**
+     * Check if this object can be updated with the information on another object.
+     * @param rdata ReaderProxyData object to be checked.
+     * @return true if this object can be updated with the information on rdata.
+     */
+    bool is_update_allowed(
+            const ReaderProxyData& rdata) const;
+
+    /**
+     * Update the information (only certain fields will be updated).
+     * @param rdata Poitner to the object from which we are going to update.
+     */
+    void update(
+            ReaderProxyData* rdata);
+
+    /**
+     * Copy ALL the information from another object.
+     * @param rdata Pointer to the object from where the information must be copied.
+     */
+    void copy(
+            ReaderProxyData* rdata);
+
+private:
+
+    //!GUID
+    GUID_t m_guid;
+    //!Holds locator information
+    RemoteLocatorList remote_locators_;
+    //!GUID_t of the Reader converted to InstanceHandle_t
+    InstanceHandle_t m_key;
+    //!GUID_t of the participant converted to InstanceHandle
+    InstanceHandle_t m_RTPSParticipantKey;
+    //!Type name
+    string_255 m_typeName;
+    //!Topic name
+    string_255 m_topicName;
+    //!User defined ID
+    uint16_t m_userDefinedId;
+    //!Field to indicate if the Reader is Alive.
+    bool m_isAlive;
+    //!Topic kind
+    TopicKind_t m_topicKind;
+    //!Type Identifier
+    TypeIdV1* m_type_id;
+    //!Type Object
+    TypeObjectV1* m_type;
+    //!Type Information
+    xtypes::TypeInformation* m_type_information;
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+
+#endif
+#endif // _FASTDDS_RTPS_BUILTIN_DATA_READERPROXYDATA_H_

+ 466 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/data/WriterProxyData.h

@@ -0,0 +1,466 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WriterProxyData.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_
+#define _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastrtps/qos/WriterQos.h>
+#include <fastrtps/attributes/TopicAttributes.h>
+
+#include <fastrtps/utils/fixed_size_string.hpp>
+#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 ParticipantProxyData;
+
+/**
+ **@ingroup BUILTIN_MODULE
+ */
+class WriterProxyData
+{
+public:
+
+    RTPS_DllAPI WriterProxyData(
+            const size_t max_unicast_locators,
+            const size_t max_multicast_locators);
+
+    RTPS_DllAPI WriterProxyData(
+            const size_t max_unicast_locators,
+            const size_t max_multicast_locators,
+            const VariableLengthDataLimits& data_limits);
+
+    virtual RTPS_DllAPI ~WriterProxyData();
+
+    RTPS_DllAPI WriterProxyData(
+            const WriterProxyData& writerInfo);
+
+    RTPS_DllAPI WriterProxyData& operator =(
+            const WriterProxyData& writerInfo);
+
+    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 void persistence_guid(
+            const GUID_t& guid)
+    {
+        persistence_guid_ = guid;
+    }
+
+    RTPS_DllAPI void persistence_guid(
+            GUID_t&& guid)
+    {
+        persistence_guid_ = std::move(guid);
+    }
+
+    RTPS_DllAPI GUID_t persistence_guid() const
+    {
+        return persistence_guid_;
+    }
+
+    RTPS_DllAPI GUID_t& persistence_guid()
+    {
+        return persistence_guid_;
+    }
+
+    RTPS_DllAPI void set_persistence_entity_id(
+            const EntityId_t& nid)
+    {
+        persistence_guid_.entityId = persistence_guid_.guidPrefix != c_GuidPrefix_Unknown ? nid : c_EntityId_Unknown;
+    }
+
+    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& remote_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 typeMaxSerialized(
+            uint32_t typeMaxSerialized)
+    {
+        m_typeMaxSerialized = typeMaxSerialized;
+    }
+
+    RTPS_DllAPI uint32_t typeMaxSerialized() const
+    {
+        return m_typeMaxSerialized;
+    }
+
+    RTPS_DllAPI uint32_t& typeMaxSerialized()
+    {
+        return m_typeMaxSerialized;
+    }
+
+    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;
+    }
+
+    //!WriterQOS
+    WriterQos m_qos;
+
+#if HAVE_SECURITY
+    //!EndpointSecurityInfo.endpoint_security_attributes
+    security::EndpointSecurityAttributesMask security_attributes_;
+
+    //!EndpointSecurityInfo.plugin_endpoint_security_attributes
+    security::PluginEndpointSecurityAttributesMask plugin_security_attributes_;
+#endif
+
+    //!Clear the information and return the object to the default state.
+    void clear();
+
+    /**
+     * Check if this object can be updated with the information on another object.
+     * @param wdata WriterProxyData object to be checked.
+     * @return true if this object can be updated with the information on wdata.
+     */
+    bool is_update_allowed(
+            const WriterProxyData& wdata) const;
+
+    /**
+     * Update certain parameters from another object.
+     * @param wdata pointer to object with new information.
+     */
+    void update(
+            WriterProxyData* wdata);
+
+    //!Copy all information from another object.
+    void copy(
+            WriterProxyData* wdata);
+
+    /**
+     * Get the size in bytes of the CDR serialization of this object.
+     * @param include_encapsulation Whether to include the size of the encapsulation info.
+     * @return size in bytes of the CDR serialization.
+     */
+    uint32_t get_serialized_size(
+            bool include_encapsulation) const;
+
+    //!Write as a parameter list on a CDRMessage_t
+    bool writeToCDRMessage(
+            CDRMessage_t* msg,
+            bool write_encapsulation) const;
+
+    //!Read a parameter list from a CDRMessage_t.
+    RTPS_DllAPI bool readFromCDRMessage(
+            CDRMessage_t* msg,
+            const NetworkFactory& network,
+            bool is_shm_transport_possible);
+
+private:
+
+    //!GUID
+    GUID_t m_guid;
+
+    //!Holds locator information
+    RemoteLocatorList remote_locators_;
+
+    //!GUID_t of the Writer converted to InstanceHandle_t
+    InstanceHandle_t m_key;
+
+    //!GUID_t of the participant converted to InstanceHandle
+    InstanceHandle_t m_RTPSParticipantKey;
+
+    //!Type name
+    string_255 m_typeName;
+
+    //!Topic name
+    string_255 m_topicName;
+
+    //!User defined ID
+    uint16_t m_userDefinedId;
+
+    //!Maximum size of the type associated with this Wrtiter, serialized.
+    uint32_t m_typeMaxSerialized;
+
+    //!Topic kind
+    TopicKind_t m_topicKind;
+
+    //!Persistence GUID
+    GUID_t persistence_guid_;
+
+    //!Type Identifier
+    TypeIdV1* m_type_id;
+
+    //!Type Object
+    TypeObjectV1* m_type;
+
+    //!Type Information
+    xtypes::TypeInformation* m_type_information;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif // _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_

+ 348 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDP.h

@@ -0,0 +1,348 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EDP.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_EDP_H_
+#define _FASTDDS_RTPS_EDP_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+#include <fastdds/rtps/builtin/data/ReaderProxyData.h>
+#include <fastdds/rtps/builtin/data/WriterProxyData.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/dds/core/status/PublicationMatchedStatus.hpp>
+#include <fastdds/dds/core/status/SubscriptionMatchedStatus.hpp>
+
+namespace eprosima {
+
+namespace fastrtps {
+
+namespace types {
+class TypeIdentifier;
+}
+
+class TopicAttributes;
+
+namespace rtps {
+
+class PDP;
+class ParticipantProxyData;
+class RTPSWriter;
+class RTPSReader;
+class WriterProxyData;
+class RTPSParticipantImpl;
+
+/**
+ * Class EDP, base class for Endpoint Discovery Protocols. It contains generic methods used by the two EDP implemented (EDPSimple and EDPStatic), as well as abstract methods
+ * definitions required by the specific implementations.
+ * @ingroup DISCOVERY_MODULE
+ */
+class EDP
+{
+public:
+
+    /**
+     * Constructor.
+     * @param p Pointer to the PDPSimple
+     * @param part Pointer to the RTPSParticipantImpl
+     */
+    EDP(
+            PDP* p,
+            RTPSParticipantImpl* part);
+    virtual ~EDP();
+
+    /**
+     * Abstract method to initialize the EDP.
+     * @param attributes DiscoveryAttributes structure.
+     * @return True if correct.
+     */
+    virtual bool initEDP(
+            BuiltinAttributes& attributes) = 0;
+    /**
+     * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered.
+     * @param pdata Discovered ParticipantProxyData
+     */
+    virtual void assignRemoteEndpoints(
+            const ParticipantProxyData& pdata) = 0;
+    /**
+     * Remove remote endpoints from the endpoint discovery protocol
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    virtual void removeRemoteEndpoints(
+            ParticipantProxyData* pdata)
+    {
+        (void) pdata;
+    }
+
+    //! Verify if the given participant EDP enpoints are matched with us
+    virtual bool areRemoteEndpointsMatched(
+            const ParticipantProxyData* )
+    {
+        return false;
+    }
+
+    /**
+     * Abstract method that removes a local Reader from the discovery method
+     * @param R Pointer to the Reader to remove.
+     * @return True if correctly removed.
+     */
+    virtual bool removeLocalReader(
+            RTPSReader* R) = 0;
+    /**
+     * Abstract method that removes a local Writer from the discovery method
+     * @param W Pointer to the Writer to remove.
+     * @return True if correctly removed.
+     */
+    virtual bool removeLocalWriter(
+            RTPSWriter* W) = 0;
+
+    /**
+     * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation).
+     * @param reader Pointer to the Reader object.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @return True if correct.
+     */
+    virtual bool processLocalReaderProxyData(
+            RTPSReader* reader,
+            ReaderProxyData* rdata) = 0;
+
+    /**
+     * After a new local WriterProxyData has been created some processing is needed (depends on the implementation).
+     * @param writer Pointer to the Writer object.
+     * @param wdata Pointer to the Writer ProxyData object.
+     * @return True if correct.
+     */
+    virtual bool processLocalWriterProxyData(
+            RTPSWriter* writer,
+            WriterProxyData* wdata) = 0;
+
+    /**
+     * Create a new ReaderPD for a local Reader.
+     * @param R Pointer to the RTPSReader.
+     * @param att Attributes of the associated topic
+     * @param qos QoS policies dictated by the subscriber
+     * @return True if correct.
+     */
+    bool newLocalReaderProxyData(
+            RTPSReader* R,
+            const TopicAttributes& att,
+            const ReaderQos& qos);
+    /**
+     * Create a new ReaderPD for a local Writer.
+     * @param W Pointer to the RTPSWriter.
+     * @param att Attributes of the associated topic
+     * @param qos QoS policies dictated by the publisher
+     * @return True if correct.
+     */
+    bool newLocalWriterProxyData(
+            RTPSWriter* W,
+            const TopicAttributes& att,
+            const WriterQos& qos);
+    /**
+     * A previously created Reader has been updated
+     * @param R Pointer to the reader;
+     * @param att Attributes of the associated topic
+     * @param qos QoS policies dictated by the subscriber
+     * @return True if correctly updated
+     */
+    bool updatedLocalReader(
+            RTPSReader* R,
+            const TopicAttributes& att,
+            const ReaderQos& qos);
+    /**
+     * A previously created Writer has been updated
+     * @param W Pointer to the Writer
+     * @param att Attributes of the associated topic
+     * @param qos QoS policies dictated by the publisher
+     * @return True if correctly updated
+     */
+    bool updatedLocalWriter(
+            RTPSWriter* W,
+            const TopicAttributes& att,
+            const WriterQos& qos);
+    /**
+     * Check the validity of a matching between a RTPSWriter and a ReaderProxyData object.
+     * @param wdata Pointer to the WriterProxyData object.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @return True if the two can be matched.
+     */
+    bool validMatching(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata);
+    /**
+     * Check the validity of a matching between a RTPSReader and a WriterProxyData object.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @param wdata Pointer to the WriterProxyData object.
+     * @return True if the two can be matched.
+     */
+    bool validMatching(
+            const ReaderProxyData* rdata,
+            const WriterProxyData* wdata);
+
+    /**
+     * Unpair a WriterProxyData object from all local readers.
+     * @param participant_guid GUID of the participant.
+     * @param writer_guid GUID of the writer.
+     * @return True if correct.
+     */
+    bool unpairWriterProxy(
+            const GUID_t& participant_guid,
+            const GUID_t& writer_guid);
+
+    /**
+     * Unpair a ReaderProxyData object from all local writers.
+     * @param participant_guid GUID of the participant.
+     * @param reader_guid GUID of the reader.
+     * @return True if correct.
+     */
+    bool unpairReaderProxy(
+            const GUID_t& participant_guid,
+            const GUID_t& reader_guid);
+
+    /**
+     * Try to pair/unpair ReaderProxyData.
+     * @param participant_guid Identifier of the participant.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @return True.
+     */
+    bool pairing_reader_proxy_with_any_local_writer(
+            const GUID_t& participant_guid,
+            ReaderProxyData* rdata);
+
+#if HAVE_SECURITY
+    bool pairing_reader_proxy_with_local_writer(
+            const GUID_t& local_writer,
+            const GUID_t& remote_participant_guid,
+            ReaderProxyData& rdata);
+
+    bool pairing_remote_reader_with_local_writer_after_security(
+            const GUID_t& local_writer,
+            const ReaderProxyData& remote_reader_data);
+#endif
+
+    /**
+     * Try to pair/unpair WriterProxyData.
+     * @param participant_guid Identifier of the participant.
+     * @param wdata Pointer to the WriterProxyData.
+     * @return True.
+     */
+    bool pairing_writer_proxy_with_any_local_reader(
+            const GUID_t& participant_guid,
+            WriterProxyData* wdata);
+
+#if HAVE_SECURITY
+    bool pairing_writer_proxy_with_local_reader(
+            const GUID_t& local_reader,
+            const GUID_t& remote_participant_guid,
+            WriterProxyData& wdata);
+
+    bool pairing_remote_writer_with_local_reader_after_security(
+            const GUID_t& local_reader,
+            const WriterProxyData& remote_writer_data);
+
+    virtual bool pairing_remote_writer_with_local_builtin_reader_after_security(
+            const GUID_t& /*local_reader*/,
+            const WriterProxyData& /*remote_writer_data*/)
+    {
+        return false;
+    }
+
+    virtual bool pairing_remote_reader_with_local_builtin_writer_after_security(
+            const GUID_t& /*local_writer*/,
+            const ReaderProxyData& /*remote_reader_data*/)
+    {
+        return false;
+    }
+
+#endif
+    const fastdds::dds::SubscriptionMatchedStatus& update_subscription_matched_status(
+            const GUID_t& reader_guid,
+            const GUID_t& writer_guid,
+            int change);
+
+    const fastdds::dds::PublicationMatchedStatus& update_publication_matched_status(
+            const GUID_t& reader_guid,
+            const GUID_t& writer_guid,
+            int change);
+
+    //! Pointer to the PDP object that contains the endpoint discovery protocol.
+    PDP* mp_PDP;
+    //! Pointer to the RTPSParticipant.
+    RTPSParticipantImpl* mp_RTPSParticipant;
+
+private:
+
+    /**
+     * Try to pair/unpair a local Reader against all possible writerProxy Data.
+     * @param R Pointer to the Reader
+     * @param participant_guid
+     * @param rdata
+     * @return True
+     */
+    bool pairingReader(
+            RTPSReader* R,
+            const GUID_t& participant_guid,
+            const ReaderProxyData& rdata);
+    /**
+     * Try to pair/unpair a local Writer against all possible readerProxy Data.
+     * @param W Pointer to the Writer
+     * @param participant_guid
+     * @param wdata
+     * @return True
+     */
+    bool pairingWriter(
+            RTPSWriter* W,
+            const GUID_t& participant_guid,
+            const WriterProxyData& wdata);
+
+    bool checkDataRepresentationQos(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    bool checkTypeValidation(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    bool checkTypeIdentifier(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    bool hasTypeIdentifier(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    bool checkTypeObject(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    bool hasTypeObject(
+            const WriterProxyData* wdata,
+            const ReaderProxyData* rdata) const;
+
+    ReaderProxyData temp_reader_proxy_data_;
+    WriterProxyData temp_writer_proxy_data_;
+    std::map<GUID_t, fastdds::dds::SubscriptionMatchedStatus> reader_status_;
+    std::map<GUID_t, fastdds::dds::PublicationMatchedStatus> writer_status_;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_EDP_H_ */

+ 90 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPClient.h

@@ -0,0 +1,90 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EDPClient.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_EDPCLIENT_H_
+#define _FASTDDS_RTPS_EDPCLIENT_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+/**
+ * Class EDPClient, extends the EDPSimple functionality to accommodate client side needs
+ *@ingroup DISCOVERY_MODULE
+ */
+class EDPClient : public EDPSimple
+{
+public:
+
+    /**
+     * Constructor.
+     * @param p Pointer to the PDP
+     * @param part Pointer to the RTPSParticipantImpl
+     */
+    EDPClient(
+            PDP* p,
+            RTPSParticipantImpl* part)
+        : EDPSimple(p, part)
+    {
+    }
+
+    /**
+      * This method generates the corresponding change in the subscription writer and send it to all known remote endpoints.
+      * @param reader Pointer to the Reader object.
+      * @param rdata Pointer to the ReaderProxyData object.
+      * @return true if correct.
+      */
+    bool processLocalReaderProxyData(
+            RTPSReader* reader,
+            ReaderProxyData* rdata) override;
+    /**
+     * This method generates the corresponding change in the publciations writer and send it to all known remote endpoints.
+     * @param writer Pointer to the Writer object.
+     * @param wdata Pointer to the WriterProxyData object.
+     * @return true if correct.
+     */
+    bool processLocalWriterProxyData(
+            RTPSWriter* writer,
+            WriterProxyData* wdata) override;
+    /**
+     * This methods generates the change disposing of the local Reader and calls the unpairing and removal methods of the base class.
+     * @param R Pointer to the RTPSReader object.
+     * @return True if correct.
+     */
+    bool removeLocalReader(
+            RTPSReader*R) override;
+    /**
+     * This methods generates the change disposing of the local Writer and calls the unpairing and removal methods of the base class.
+     * @param W Pointer to the RTPSWriter object.
+     * @return True if correct.
+     */
+    bool removeLocalWriter(
+            RTPSWriter*W) override;
+
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_EDPCLIENT_H_ */

+ 197 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPServer.h

@@ -0,0 +1,197 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EDPServer.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_EDPSERVER_H_
+#define _FASTDDS_RTPS_EDPSERVER_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/common/CacheChange.h>
+#include <fastdds/rtps/builtin/data/ParticipantProxyData.h>
+#include <fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h>
+
+#include <set>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class EDPServerPUBListener;
+class EDPServerSUBListener;
+
+/**
+ * Class EDPServer, implements the Endpoint Discovery Protocol for server participants
+ * Inherits from EDPSimple class.
+ *@ingroup DISCOVERY_MODULE
+ */
+class EDPServer : public EDPSimple
+{
+    friend class EDPServerPUBListener;
+    friend class EDPServerSUBListener;
+
+    typedef std::set<InstanceHandle_t> key_list;
+
+    //! Keys to wipe out from WriterHistory because its related Participants have been removed
+    key_list _PUBdemises, _SUBdemises;
+
+    //! TRANSIENT or TRANSIENT_LOCAL durability;
+    DurabilityKind_t _durability;
+
+public:
+
+    /**
+     * Constructor.
+     * @param p Pointer to the PDP
+     * @param part Pointer to the RTPSParticipantImpl
+     * @param durability_kind the kind of persistence we want for the discovery data
+     */
+    EDPServer(
+            PDP* p,
+            RTPSParticipantImpl* part,
+            DurabilityKind_t durability_kind)
+        : EDPSimple(p, part)
+        , _durability(durability_kind)
+    {
+    }
+
+    ~EDPServer() override
+    {
+    }
+
+    /**
+      * This method generates the corresponding change in the subscription writer and send it to all known remote endpoints.
+      * @param reader Pointer to the Reader object.
+      * @param rdata Pointer to the ReaderProxyData object.
+      * @return true if correct.
+      */
+    bool processLocalReaderProxyData(
+            RTPSReader* reader,
+            ReaderProxyData* rdata) override;
+    /**
+     * This method generates the corresponding change in the publciations writer and send it to all known remote endpoints.
+     * @param writer Pointer to the Writer object.
+     * @param wdata Pointer to the WriterProxyData object.
+     * @return true if correct.
+     */
+    bool processLocalWriterProxyData(
+            RTPSWriter* writer,
+            WriterProxyData* wdata) override;
+    /**
+     * This methods generates the change disposing of the local Reader and calls the unpairing and removal methods of the base class.
+     * @param R Pointer to the RTPSReader object.
+     * @return True if correct.
+     */
+    bool removeLocalReader(
+            RTPSReader*R) override;
+    /**
+     * This methods generates the change disposing of the local Writer and calls the unpairing and removal methods of the base class.
+     * @param W Pointer to the RTPSWriter object.
+     * @return True if correct.
+     */
+    bool removeLocalWriter(
+            RTPSWriter*W) override;
+
+    /**
+     * Some History data is flag for defer removal till every client
+     * acknowledges reception
+     * @return True if trimming must be done
+     */
+    inline bool pendingHistoryCleaning()
+    {
+        return !(_PUBdemises.empty() && _SUBdemises.empty());
+    }
+
+    //! Callback to remove unnecesary WriterHistory info
+    bool trimPUBWriterHistory()
+    {
+        return trimWriterHistory<ProxyHashTable<WriterProxyData>*>(_PUBdemises,
+                *publications_writer_.first, *publications_writer_.second, &ParticipantProxyData::m_writers);
+    }
+
+    bool trimSUBWriterHistory()
+    {
+        return trimWriterHistory<ProxyHashTable<ReaderProxyData>*>(_SUBdemises,
+                *subscriptions_writer_.first, *subscriptions_writer_.second, &ParticipantProxyData::m_readers);
+    }
+
+    //! returns true if loading info from persistency database
+    bool ongoingDeserialization();
+
+    //! Process the info recorded in the persistence database
+    void processPersistentData();
+
+    protected:
+
+    /**
+        * Add participant CacheChange_ts from reader to writer
+        * @return True if successfully modified WriterHistory
+        */
+    bool addPublisherFromHistory(
+            CacheChange_t& c)
+    {
+        return addEndpointFromHistory(*publications_writer_.first, *publications_writer_.second, c);
+    }
+
+    bool addSubscriberFromHistory(
+            CacheChange_t& c)
+    {
+        return addEndpointFromHistory(*subscriptions_writer_.first, *subscriptions_writer_.second, c);
+    }
+
+    /**
+    * Trigger the participant CacheChange_t removal system
+    * @return True if successfully modified WriterHistory
+    */
+    void removePublisherFromHistory(
+            const InstanceHandle_t&);
+    void removeSubscriberFromHistory(
+            const InstanceHandle_t&);
+
+private:
+
+    /**
+     * Callback to remove unnecesary WriterHistory info common implementation
+     * @return True if trim is finished
+     */
+    template<class ProxyCont>
+    bool trimWriterHistory(
+            key_list& _demises,
+            StatefulWriter& writer,
+            WriterHistory& history,
+            ProxyCont ParticipantProxyData::* pCont);
+
+    //! addPublisherFromHistory and addSubscriberFromHistory common implementation
+    bool addEndpointFromHistory(
+            StatefulWriter& writer,
+            WriterHistory& history,
+            CacheChange_t& c);
+
+    /**
+     * Create local SEDP Endpoints based on the DiscoveryAttributes.
+     * @return True if correct.
+     */
+    virtual bool createSEDPEndpoints() override;
+
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_EDPSERVER_H_ */

+ 258 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h

@@ -0,0 +1,258 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EDPSimple.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_EDPSIMPLE_H_
+#define _FASTDDS_RTPS_EDPSIMPLE_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/endpoint/EDP.h>
+#include <fastdds/rtps/builtin/data/WriterProxyData.h>
+#include <fastdds/rtps/builtin/data/ReaderProxyData.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class StatefulReader;
+class StatefulWriter;
+class RTPSWriter;
+class RTPSReader;
+class ReaderHistory;
+class WriterHistory;
+class HistoryAttributes;
+class ReaderAttributes;
+class WriterAttributes;
+class EDPListener;
+
+/**
+ * Class EDPSimple, implements the Simple Endpoint Discovery Protocol defined in the RTPS specification.
+ * Inherits from EDP class.
+ *@ingroup DISCOVERY_MODULE
+ */
+class EDPSimple : public EDP
+{
+    using t_p_StatefulWriter = std::pair<StatefulWriter*, WriterHistory*>;
+    using t_p_StatefulReader = std::pair<StatefulReader*, ReaderHistory*>;
+
+public:
+
+    /**
+     * Constructor.
+     * @param p Pointer to the PDP
+     * @param part Pointer to the RTPSParticipantImpl
+     */
+    EDPSimple(
+            PDP* p,
+            RTPSParticipantImpl* part);
+
+    virtual ~EDPSimple();
+    //!Discovery attributes.
+    BuiltinAttributes m_discovery;
+    //!Pointer to the Publications Writer (only created if indicated in the DiscoveryAtributes).
+    t_p_StatefulWriter publications_writer_;
+    //!Pointer to the Subscriptions Writer (only created if indicated in the DiscoveryAtributes).
+    t_p_StatefulWriter subscriptions_writer_;
+    //!Pointer to the Publications Reader (only created if indicated in the DiscoveryAtributes).
+    t_p_StatefulReader publications_reader_;
+    //!Pointer to the Subscriptions Reader (only created if indicated in the DiscoveryAtributes).
+    t_p_StatefulReader subscriptions_reader_;
+
+#if HAVE_SECURITY
+    t_p_StatefulWriter publications_secure_writer_;
+
+    t_p_StatefulReader publications_secure_reader_;
+
+    t_p_StatefulWriter subscriptions_secure_writer_;
+
+    t_p_StatefulReader subscriptions_secure_reader_;
+#endif
+
+    //!Pointer to the listener associated with PubReader and PubWriter.
+    EDPListener* publications_listener_;
+
+    //!Pointer to the listener associated with SubReader and SubWriter.
+    EDPListener* subscriptions_listener_;
+
+    /**
+     * Initialization method.
+     * @param attributes Reference to the DiscoveryAttributes.
+     * @return True if correct.
+     */
+    bool initEDP(
+            BuiltinAttributes& attributes) override;
+    /**
+     * This method assigns the remote builtin endpoints that the remote RTPSParticipant indicates is using to our local builtin endpoints.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     */
+    void assignRemoteEndpoints(
+            const ParticipantProxyData& pdata) override;
+    /**
+     * Remove remote endpoints from the endpoint discovery protocol
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    void removeRemoteEndpoints(
+            ParticipantProxyData* pdata) override;
+
+    //! Verify if the given participant EDP enpoints are matched with us
+    bool areRemoteEndpointsMatched(
+            const ParticipantProxyData* pdata) override;
+
+    /**
+     * This method generates the corresponding change in the subscription writer and send it to all known remote endpoints.
+     * @param reader Pointer to the Reader object.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @return true if correct.
+     */
+    bool processLocalReaderProxyData(
+            RTPSReader* reader,
+            ReaderProxyData* rdata) override;
+    /**
+     * This method generates the corresponding change in the publciations writer and send it to all known remote endpoints.
+     * @param writer Pointer to the Writer object.
+     * @param wdata Pointer to the WriterProxyData object.
+     * @return true if correct.
+     */
+    bool processLocalWriterProxyData(
+            RTPSWriter* writer,
+            WriterProxyData* wdata) override;
+    /**
+     * This methods generates the change disposing of the local Reader and calls the unpairing and removal methods of the base class.
+     * @param R Pointer to the RTPSReader object.
+     * @return True if correct.
+     */
+    bool removeLocalReader(
+            RTPSReader*R) override;
+    /**
+     * This methods generates the change disposing of the local Writer and calls the unpairing and removal methods of the base class.
+     * @param W Pointer to the RTPSWriter object.
+     * @return True if correct.
+     */
+    bool removeLocalWriter(
+            RTPSWriter*W) override;
+
+protected:
+
+    /**
+     * Initialization of history attributes for EDP built-in readers
+     *
+     * @param [out] attributes History attributes to initialize
+     */
+    virtual void set_builtin_reader_history_attributes(
+            HistoryAttributes& attributes);
+
+    /**
+     * Initialization of history attributes for EDP built-in writers
+     *
+     * @param [out] attributes History attributes to initialize
+     */
+    virtual void set_builtin_writer_history_attributes(
+            HistoryAttributes& attributes);
+
+    /**
+     * Initialization of reader attributes for EDP built-in readers
+     *
+     * @param [out] attributes Reader attributes to initialize
+     */
+    virtual void set_builtin_reader_attributes(
+            ReaderAttributes& attributes);
+
+    /**
+     * Initialization of writer attributes for EDP built-in writers
+     *
+     * @param [out] attributes Writer attributes to initialize
+     */
+    virtual void set_builtin_writer_attributes(
+            WriterAttributes& attributes);
+
+    /**
+     * Create local SEDP Endpoints based on the DiscoveryAttributes.
+     * @return True if correct.
+     */
+    virtual bool createSEDPEndpoints();
+
+    /**
+     * Create a cache change on a builtin writer and serialize a WriterProxyData on it.
+     * @param [in] data The WriterProxyData object to be serialized.
+     * @param [in] writer The writer,history pair where the change should be added.
+     * @param [in] remove_same_instance Should previous changes with same key be removed?
+     * @param [out] created_change Where the pointer to the created change should be returned.
+     * @return false if data could not be serialized into the created change.
+     */
+    bool serialize_writer_proxy_data(
+            const WriterProxyData& data,
+            const t_p_StatefulWriter& writer,
+            bool remove_same_instance,
+            CacheChange_t** created_change);
+
+    /**
+     * Create a cache change on a builtin writer and serialize a ReaderProxyData on it.
+     * @param [in] data The ReaderProxyData object to be serialized.
+     * @param [in] writer The writer,history pair where the change should be added.
+     * @param [in] remove_same_instance Should previous changes with same key be removed?
+     * @param [out] created_change Where the pointer to the created change should be returned.
+     * @return false if data could not be serialized into the created change.
+     */
+    bool serialize_reader_proxy_data(
+            const ReaderProxyData& data,
+            const t_p_StatefulWriter& writer,
+            bool remove_same_instance,
+            CacheChange_t** created_change);
+
+    //! Process the info recorded in the persistence database
+    static void processPersistentData(t_p_StatefulReader & reader, t_p_StatefulWriter & writer);
+
+private:
+    /**
+     * Create a cache change on a builtin writer and serialize a ProxyData on it.
+     * @param [in] data The ProxyData object to be serialized.
+     * @param [in] writer The writer,history pair where the change should be added.
+     * @param [in] remove_same_instance Should previous changes with same key be removed?
+     * @param [out] created_change Where the pointer to the created change should be returned.
+     * @return false if data could not be serialized into the created change.
+     */
+    template<typename ProxyData>
+    bool serialize_proxy_data(
+            const ProxyData& data,
+            const t_p_StatefulWriter& writer,
+            bool remove_same_instance,
+            CacheChange_t** created_change);
+
+#if HAVE_SECURITY
+    bool create_sedp_secure_endpoints();
+
+    bool pairing_remote_writer_with_local_builtin_reader_after_security(
+            const GUID_t& local_reader,
+            const WriterProxyData& remote_writer_data) override;
+
+    bool pairing_remote_reader_with_local_builtin_writer_after_security(
+            const GUID_t& local_writer,
+            const ReaderProxyData& remote_reader_data) override;
+#endif
+
+    std::mutex temp_data_lock_;
+    ReaderProxyData temp_reader_proxy_data_;
+    WriterProxyData temp_writer_proxy_data_;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_EDPSIMPLE_H_ */

+ 170 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/endpoint/EDPStatic.h

@@ -0,0 +1,170 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EDPStatic.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_EDPSTATIC_H_
+#define _FASTDDS_RTPS_EDPSTATIC_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/endpoint/EDP.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace xmlparser{
+    class XMLEndpointParser;
+}
+namespace rtps {
+
+
+/**
+ * Class EDPStaticProperty, used to read and write the strings from the properties used to transmit the EntityId_t.
+ *@ingroup DISCOVERY_MODULE
+ */
+class EDPStaticProperty
+{
+public:
+    EDPStaticProperty():m_userId(0){};
+    ~EDPStaticProperty(){};
+    //!Endpoint type
+    std::string m_endpointType;
+    //!Status
+    std::string m_status;
+    //!User ID as string
+    std::string m_userIdStr;
+    //!User ID
+    uint16_t m_userId;
+    //!Entity ID
+    EntityId_t m_entityId;
+    /**
+    * Convert information to a property
+    * @param type Type of endpoint
+    * @param status Status of the endpoint
+    * @param id User Id
+    * @param ent EntityId
+    * @return Pair of two strings.
+    */
+    static std::pair<std::string,std::string> toProperty(std::string type,std::string status,uint16_t id,const EntityId_t& ent);
+    /**
+    * @param in_property Input property-
+    * @return True if correctly read
+    */
+    bool fromProperty(std::pair<std::string,std::string> in_property);
+};
+
+/**
+ * Class EDPStatic, implements a static endpoint discovery module.
+ * @ingroup DISCOVERYMODULE
+ */
+class EDPStatic : public EDP {
+public:
+    /**
+    * Constructor.
+    * @param p Pointer to the PDPSimple.
+    * @param part Pointer to the RTPSParticipantImpl.
+    */
+    EDPStatic(PDP* p,RTPSParticipantImpl* part);
+    virtual ~EDPStatic();
+    /**
+     * Abstract method to initialize the EDP.
+     * @param attributes DiscoveryAttributes structure.
+     * @return True if correct.
+     */
+    bool initEDP(BuiltinAttributes& attributes) override;
+    /**
+     * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered.
+     * @param pdata Pointer to the ParticipantProxyData.
+     */
+    void assignRemoteEndpoints(const ParticipantProxyData& pdata) override;
+    /**
+     * Abstract method that removes a local Reader from the discovery method
+     * @param R Pointer to the Reader to remove.
+     * @return True if correctly removed.
+     */
+    bool removeLocalReader(RTPSReader* R) override;
+    /**
+     * Abstract method that removes a local Writer from the discovery method
+     * @param W Pointer to the Writer to remove.
+     * @return True if correctly removed.
+     */
+    bool removeLocalWriter(RTPSWriter*W) override;
+
+    /**
+     * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation).
+     * @param reader Pointer to the RTPSReader object.
+     * @param rdata Pointer to the ReaderProxyData object.
+     * @return True if correct.
+     */
+    bool processLocalReaderProxyData(RTPSReader* reader, ReaderProxyData* rdata) override;
+    /**
+     * After a new local WriterProxyData has been created some processing is needed (depends on the implementation).
+     * @param writer Pointer to the RTPSWriter object.
+     * @param wdata Pointer to the Writer ProxyData object.
+     * @return True if correct.
+     */
+    bool processLocalWriterProxyData(RTPSWriter* writer, WriterProxyData* wdata) override;
+
+    /**
+     * New Remote Writer has been found and this method process it and calls the pairing methods.
+     * @param participant_guid  GUID of the participant.
+     * @param participant_name  Name of the participant.
+     * @param user_id           User Id.
+     * @param ent_id            Entity Id.
+     * @return True if correct.
+     */
+    bool newRemoteWriter(
+            const GUID_t& participant_guid,
+            const string_255& participant_name,
+            uint16_t user_id,
+            EntityId_t ent_id = c_EntityId_Unknown);
+    /**
+     * New Remote Reader has been found and this method process it and calls the pairing methods.
+     * @param participant_guid  GUID of the participant.
+     * @param participant_name  Name of the participant.
+     * @param user_id           User Id.
+     * @param ent_id            Entity Id.
+     * @return true if correct.
+     */
+    bool newRemoteReader(
+            const GUID_t& participant_guid,
+            const string_255& participant_name,
+            uint16_t user_id,
+            EntityId_t ent_id = c_EntityId_Unknown);
+
+    /**
+    * This method checks the provided entityId against the topic type to see if it matches
+    * @param rdata Pointer to the readerProxyData
+    * @return True if its correct.
+    **/
+    bool checkEntityId(ReaderProxyData* rdata);
+    /**
+    * This method checks the provided entityId against the topic type to see if it matches
+    * @param wdata Pointer to the writerProxyData
+    * @return True if its correct.
+    **/
+    bool checkEntityId(WriterProxyData* wdata);
+private:
+    xmlparser::XMLEndpointParser* mp_edpXML;
+    BuiltinAttributes m_attributes;
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_EDPSTATIC_H_ */

+ 432 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDP.h

@@ -0,0 +1,432 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDP.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_PDP_H_
+#define _FASTDDS_RTPS_PDP_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <mutex>
+#include <functional>
+
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
+#include <fastdds/rtps/builtin/data/ReaderProxyData.h>
+#include <fastdds/rtps/builtin/data/WriterProxyData.h>
+#include <fastrtps/qos/QosPolicies.h>
+#include <fastrtps/utils/collections/ResourceLimitedVector.hpp>
+#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.h>
+
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class RTPSWriter;
+class RTPSReader;
+class WriterHistory;
+class ReaderHistory;
+class RTPSParticipantImpl;
+class RTPSParticipantListener;
+class BuiltinProtocols;
+class EDP;
+class TimedEvent;
+class ReaderProxyData;
+class WriterProxyData;
+class ParticipantProxyData;
+class ReaderListener;
+class PDPListener;
+class PDPServerListener;
+
+
+/**
+ * Abstract class PDP that implements the basic interfaces for all Participant Discovery implementations
+ * It also keeps the Participant Discovery Data and provides interfaces to access it
+ *@ingroup DISCOVERY_MODULE
+ */
+class PDP
+{
+    friend class PDPListener;
+    friend class PDPServerListener;
+
+public:
+    /**
+     * Constructor
+     * @param builtin Pointer to the BuiltinProcols object.
+     * @param allocation Participant allocation parameters.
+     */
+    PDP(
+        BuiltinProtocols* builtin,
+        const RTPSParticipantAllocationAttributes& allocation);
+
+    virtual ~PDP();
+
+    virtual void initializeParticipantProxyData(ParticipantProxyData* participant_data);
+
+    /**
+     * Initialize the PDP.
+     * @param part Pointer to the RTPSParticipant.
+     * @return True on success
+     */
+    bool initPDP(
+            RTPSParticipantImpl* part);
+
+    bool enable();
+
+    virtual bool init(RTPSParticipantImpl* part) = 0;
+
+    /**
+     * Creates an initializes a new participant proxy from a DATA(p) raw info
+     * @param p from DATA msg deserialization
+     * @param writer_guid GUID of originating writer
+     * @return new ParticipantProxyData * or nullptr on failure
+     */
+    virtual ParticipantProxyData* createParticipantProxyData(
+            const ParticipantProxyData& p,
+            const GUID_t& writer_guid) = 0;
+
+    /**
+     * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators.
+     * @param new_change If true a new change (with new seqNum) is created and sent;If false the last change is re-sent
+     * @param dispose sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED
+     * @param wparams allows to identify the change
+     */
+    virtual void announceParticipantState(
+            bool new_change,
+            bool dispose = false,
+            WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT);
+
+    //!Stop the RTPSParticipantAnnouncement (only used in tests).
+    virtual void stopParticipantAnnouncement();
+
+    //!Reset the RTPSParticipantAnnouncement (only used in tests).
+    virtual void resetParticipantAnnouncement();
+
+    /**
+     * Add a ReaderProxyData to the correct ParticipantProxyData.
+     * @param [in]  reader_guid       GUID of the reader to add.
+     * @param [out] participant_guid  GUID of the ParticipantProxyData where the reader was added.
+     * @param [in]  initializer_func  Function to be called in order to set the data of the ReaderProxyData.
+     *
+     * @return A pointer to the added ReaderProxyData (nullptr if it could not be added).
+     */
+    ReaderProxyData* addReaderProxyData(
+            const GUID_t& reader_guid,
+            GUID_t& participant_guid,
+            std::function<bool(ReaderProxyData*, bool, const ParticipantProxyData&)> initializer_func);
+
+    /**
+     * Add a WriterProxyData to the correct ParticipantProxyData.
+     * @param [in]  writer_guid       GUID of the writer to add.
+     * @param [out] participant_guid  GUID of the ParticipantProxyData where the writer was added.
+     * @param [in]  initializer_func  Function to be called in order to set the data of the WriterProxyData.
+     *
+     * @return A pointer to the added WriterProxyData (nullptr if it could not be added).
+     */
+    WriterProxyData* addWriterProxyData(
+            const GUID_t& writer_guid,
+            GUID_t& participant_guid,
+            std::function<bool(WriterProxyData*, bool, const ParticipantProxyData&)> initializer_func);
+
+    /**
+     * This method returns whether a ReaderProxyDataObject exists among the registered RTPSParticipants
+     * (including the local RTPSParticipant).
+     * @param [in] reader GUID_t of the reader we are looking for.
+     * @return True if found.
+     */
+    bool has_reader_proxy_data(const GUID_t& reader);
+
+    /**
+     * This method gets a copy of a ReaderProxyData object if it is found among the registered RTPSParticipants
+     * (including the local RTPSParticipant).
+     * @param [in]  reader  GUID_t of the reader we are looking for.
+     * @param [out] rdata   Reference to the ReaderProxyData object where data is to be returned.
+     * @return True if found.
+     */
+    bool lookupReaderProxyData(
+            const GUID_t& reader,
+            ReaderProxyData& rdata);
+
+    /**
+     * This method returns whether a WriterProxyData exists among the registered RTPSParticipants
+     * (including the local RTPSParticipant).
+     * @param [in] writer GUID_t of the writer we are looking for.
+     * @return True if found.
+     */
+    bool has_writer_proxy_data(const GUID_t& writer);
+
+    /**
+     * This method gets a copy of a WriterProxyData object if it is found among the registered RTPSParticipants
+     * (including the local RTPSParticipant).
+     * @param [in]  writer  GUID_t of the writer we are looking for.
+     * @param [out] wdata   Reference to the WriterProxyData object where data is to be returned.
+     * @return True if found.
+     */
+    bool lookupWriterProxyData(
+            const GUID_t& writer,
+            WriterProxyData& wdata);
+
+    /**
+     * This method returns the name of a participant if it is found among the registered RTPSParticipants.
+     * @param [in]  guid  GUID_t of the RTPSParticipant we are looking for.
+     * @param [out] name  Copy of name on ParticipantProxyData object.
+     * @return True if found.
+     */
+    bool lookup_participant_name(
+            const GUID_t& guid,
+            string_255& name);
+
+    /**
+     * This method removes and deletes a ReaderProxyData object from its corresponding RTPSParticipant.
+     * @param reader_guid GUID_t of the reader to remove.
+     * @return true if found and deleted.
+     */
+    bool removeReaderProxyData(const GUID_t& reader_guid);
+
+    /**
+     * This method removes and deletes a WriterProxyData object from its corresponding RTPSParticipant.
+     * @param writer_guid GUID_t of the wtiter to remove.
+     * @return true if found and deleted.
+     */
+    bool removeWriterProxyData(const GUID_t& writer_guid);
+
+    /**
+     * Create the SPDP Writer and Reader
+     * @return True if correct.
+     */
+    virtual bool createPDPEndpoints() = 0;
+
+    /**
+     * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls the corresponding methods in EDP and WLP.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     */
+    virtual void assignRemoteEndpoints(ParticipantProxyData* pdata) = 0;
+
+    /**
+     * Override to match additional endpoints to PDP. Like EDP or WLP.
+     * @param pdata Pointer to the ParticipantProxyData object.
+     */
+    virtual void notifyAboveRemoteEndpoints(const ParticipantProxyData& pdata) = 0;
+
+    /**
+     * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic
+     * @return true if EDP endpoinst must be match
+     */
+    virtual bool updateInfoMatchesEDP() { return false; }
+
+    /**
+     * Remove remote endpoints from the participant discovery protocol
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    virtual void removeRemoteEndpoints(ParticipantProxyData* pdata) = 0;
+
+    /**
+     * This method removes a remote RTPSParticipant and all its writers and readers.
+     * @param participant_guid GUID_t of the remote RTPSParticipant.
+     * @param reason Why the participant is being removed (dropped vs removed)
+     * @return true if correct.
+     */
+    virtual bool remove_remote_participant(
+            const GUID_t& participant_guid,
+            ParticipantDiscoveryInfo::DISCOVERY_STATUS reason);
+
+    /**
+     * This method returns the BuiltinAttributes of the local participant.
+     * @return const reference to the BuiltinAttributes of the local participant.
+     */
+    const BuiltinAttributes& builtin_attributes() const;
+
+    /**
+     * Get a pointer to the local RTPSParticipant ParticipantProxyData object.
+     * @return Pointer to the local RTPSParticipant ParticipantProxyData object.
+     */
+    ParticipantProxyData* getLocalParticipantProxyData()
+    {
+        return participant_proxies_.front();
+    }
+
+    /**
+     * Get a pointer to the EDP object.
+     * @return pointer to the EDP object.
+     */
+    inline EDP* getEDP(){return mp_EDP;}
+
+    /**
+     * Get a const_iterator to the beginning of the RTPSParticipant Proxies.
+     * @return const_iterator.
+     */
+    ResourceLimitedVector<ParticipantProxyData*>::const_iterator ParticipantProxiesBegin()
+    {
+        return participant_proxies_.begin();
+    }
+
+    /**
+     * Get a const_iterator to the end of the RTPSParticipant Proxies.
+     * @return const_iterator.
+     */
+    ResourceLimitedVector<ParticipantProxyData*>::const_iterator ParticipantProxiesEnd()
+    {
+        return participant_proxies_.end();
+    }
+
+    /**
+     * Assert the liveliness of a Remote Participant.
+     * @param remote_guid GuidPrefix_t of the participant whose liveliness is being asserted.
+     */
+    void assert_remote_participant_liveliness(
+            const GuidPrefix_t& remote_guid);
+
+    /**
+     * Get the RTPS participant
+     * @return RTPS participant
+     */
+    inline RTPSParticipantImpl* getRTPSParticipant() const {return mp_RTPSParticipant;};
+
+    /**
+     * Get the mutex.
+     * @return Pointer to the Mutex
+     */
+    inline std::recursive_mutex* getMutex() const {return mp_mutex;}
+
+    CDRMessage_t get_participant_proxy_data_serialized(Endianness_t endian);
+
+protected:
+    //!Pointer to the builtin protocols object.
+    BuiltinProtocols* mp_builtin;
+    //!Pointer to the local RTPSParticipant.
+    RTPSParticipantImpl* mp_RTPSParticipant;
+    //!Discovery attributes.
+    BuiltinAttributes m_discovery;
+    //!Pointer to the PDPWriter.
+    RTPSWriter* mp_PDPWriter;
+    //!Pointer to the PDPReader.
+    RTPSReader* mp_PDPReader;
+    //!Pointer to the EDP object.
+    EDP* mp_EDP;
+    //!Number of participant proxy data objects created
+    size_t participant_proxies_number_;
+    //!Registered RTPSParticipants (including the local one, that is the first one.)
+    ResourceLimitedVector<ParticipantProxyData*> participant_proxies_;
+    //!Pool of participant proxy data objects ready for reuse
+    ResourceLimitedVector<ParticipantProxyData*> participant_proxies_pool_;
+    //!Number of reader proxy data objects created
+    size_t reader_proxies_number_;
+    //!Pool of reader proxy data objects ready for reuse
+    ResourceLimitedVector<ReaderProxyData*> reader_proxies_pool_;
+    //!Number of writer proxy data objects created
+    size_t writer_proxies_number_;
+    //!Pool of writer proxy data objects ready for reuse
+    ResourceLimitedVector<WriterProxyData*> writer_proxies_pool_;
+    //!Variable to indicate if any parameter has changed.
+    std::atomic_bool m_hasChangedLocalPDP;
+    //!Listener for the SPDP messages.
+    ReaderListener* mp_listener;
+    //!WriterHistory
+    WriterHistory* mp_PDPWriterHistory;
+    //!Reader History
+    ReaderHistory* mp_PDPReaderHistory;
+    //!ReaderProxyData to allow preallocation of remote locators
+    ReaderProxyData temp_reader_data_;
+    //!WriterProxyData to allow preallocation of remote locators
+    WriterProxyData temp_writer_data_;
+    //!To protect temp_writer_data_ and temp_reader_data_
+    std::mutex temp_data_lock_;
+    //!Participant data atomic access assurance
+    std::recursive_mutex* mp_mutex;
+    //!To protect callbacks (ParticipantProxyData&)
+    std::mutex callback_mtx_;
+
+    /**
+     * Adds an entry to the collection of participant proxy information.
+     * May use one of the entries present in the pool.
+     *
+     * @param participant_guid GUID of the participant for which to create the proxy object.
+     * @param with_lease_duration indicates whether lease duration event should be created.
+     *
+     * @return pointer to the currently inserted entry, nullptr if allocation limits were reached.
+     */
+    ParticipantProxyData* add_participant_proxy_data(
+            const GUID_t& participant_guid,
+            bool with_lease_duration);
+
+    /**
+     * Gets the key of a participant proxy data.
+     *
+     * @param [in] participant_guid GUID of the participant to look for.
+     * @param [out] key of the corresponding proxy object.
+     *
+     * @return true when input GUID is found.
+     */
+    bool lookup_participant_key(
+            const GUID_t& participant_guid,
+            InstanceHandle_t& key);
+
+private:
+
+    //!TimedEvent to periodically resend the local RTPSParticipant information.
+    TimedEvent* resend_participant_info_event_;
+
+    //!Participant's initial announcements config
+    InitialAnnouncementConfig initial_announcements_;
+
+    void check_remote_participant_liveliness(
+            ParticipantProxyData* remote_participant);
+
+    void check_and_notify_type_discovery(
+            RTPSParticipantListener* listener,
+            const WriterProxyData& wdata) const;
+
+    void check_and_notify_type_discovery(
+            RTPSParticipantListener* listener,
+            const ReaderProxyData& rdata) const;
+
+    void check_and_notify_type_discovery(
+            RTPSParticipantListener* listener,
+            const string_255& topic_name,
+            const string_255& type_name,
+            const types::TypeIdentifier* type_id,
+            const types::TypeObject* type_obj,
+            const xtypes::TypeInformation* type_info) const;
+
+    /**
+     * Calculates the next announcement interval
+     */
+    void set_next_announcement_interval();
+
+    /**
+     * Calculates the initial announcement interval
+     */
+    void set_initial_announcement_interval();
+
+};
+
+
+// configuration values for PDP reliable entities.
+extern const Duration_t pdp_heartbeat_period;
+extern const Duration_t pdp_nack_response_delay;
+extern const Duration_t pdp_nack_supression_duration;
+extern const Duration_t pdp_heartbeat_response_delay;
+
+extern const int32_t pdp_initial_reserved_caches;
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_PDP_H_ */

+ 140 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPClient.h

@@ -0,0 +1,140 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDPClient.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_PDPCLIENT_H_
+#define _FASTDDS_RTPS_PDPCLIENT_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/participant/PDP.h>
+#include <fastdds/rtps/messages/RTPSMessageGroup.h>
+#include <fastdds/rtps/builtin/discovery/participant/timedevent/DSClientEvent.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class StatefulWriter;
+class StatefulReader;
+
+/**
+ * Class PDPClient manages client side of the discovery server mechanism
+ *@ingroup DISCOVERY_MODULE
+ */
+class PDPClient : public PDP
+{
+    friend class DSClientEvent;
+
+public:
+
+    /**
+     * Constructor
+     * @param builtin Pointer to the BuiltinProcols object.
+     * @param allocation Participant allocation parameters.
+     */
+    PDPClient(
+            BuiltinProtocols* builtin,
+            const RTPSParticipantAllocationAttributes& allocation);
+    ~PDPClient();
+
+    void initializeParticipantProxyData(ParticipantProxyData* participant_data) override;
+
+    /**
+     * Initialize the PDP.
+     * @param part Pointer to the RTPSParticipant.
+     * @return True on success
+     */
+    bool init(RTPSParticipantImpl* part) override;
+
+    /**
+     * Creates an initializes a new participant proxy from a DATA(p) raw info
+     * @param p from DATA msg deserialization
+     * @param writer_guid GUID of originating writer
+     * @return new ParticipantProxyData * or nullptr on failure
+     */
+    ParticipantProxyData* createParticipantProxyData(
+        const ParticipantProxyData& p,
+        const GUID_t& writer_guid) override;
+
+    /**
+     * Create the SPDP Writer and Reader
+     * @return True if correct.
+     */
+    bool createPDPEndpoints() override;
+
+    /**
+     * Check if all servers have acknowledge the client PDP data
+     * This method must be called from a mutex protected context.
+     * @return True if all can reach the client
+     */
+    bool all_servers_acknowledge_PDP();
+
+    /**
+     * Check if we have our PDP received data updated
+     * This method must be called from a mutex protected context.
+     * @return True if we known all the participants the servers are aware of
+     */
+    bool is_all_servers_PDPdata_updated();
+
+    /**
+     * Force the sending of our local PDP to all servers
+     * @param new_change If true a new change (with new seqNum) is created and sent;
+     * if false the last change is re-sent
+     * @param dispose Sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED
+     * @param wparams allows to identify the change
+     */
+    void announceParticipantState(
+        bool new_change,
+        bool dispose = false,
+        WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT) override;
+
+    /**
+     * These methods wouldn't be needed under perfect server operation
+     * (no need of dynamic endpoint allocation) but must be implemented
+     * to solve server shutdown situations.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     */
+    void assignRemoteEndpoints(ParticipantProxyData* pdata) override;
+    void removeRemoteEndpoints(ParticipantProxyData* pdata) override;
+    void notifyAboveRemoteEndpoints(const ParticipantProxyData& pdata) override;
+
+    /**
+    * Matching server EDP endpoints
+    * @return true if all servers have been discovered
+    */
+    bool match_servers_EDP_endpoints();
+
+    private:
+
+    /**
+    * TimedEvent for server synchronization:
+    *   first stage: periodically resend the local RTPSParticipant information until
+    *    all servers have acknowledge reception
+    *   second stage: waiting PDP info is up to date before allowing EDP matching
+    */
+    DSClientEvent* mp_sync;
+
+    //! flag to hightlight we need a server ping announcement
+    bool _serverPing;
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_RTPS_PDPCLIENT_H_ */

+ 86 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPListener.h

@@ -0,0 +1,86 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDPListener.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_PDPLISTENER_H_
+#define _FASTDDS_RTPS_PDPLISTENER_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/reader/ReaderListener.h>
+#include <fastdds/rtps/builtin/data/ParticipantProxyData.h>
+
+#include <mutex>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class PDP;
+
+/**
+ * Class PDPListener, specification used by the PDP to perform the History check when a new message is received.
+ * This class is implemented in order to use the same structure than with any other RTPSReader.
+ * @ingroup DISCOVERY_MODULE
+ */
+class PDPListener: public ReaderListener
+{
+
+public:
+    /**
+     * @param parent Pointer to object creating this object
+     */
+    PDPListener(PDP* parent);
+
+    virtual ~PDPListener() override = default;
+
+    /**
+    * New added cache
+    * @param reader
+    * @param change
+    */
+    void onNewCacheChangeAdded(
+            RTPSReader* reader,
+            const CacheChange_t* const change) override;
+
+protected:
+
+    /**
+     * Get the key of a CacheChange_t
+     * @param change Pointer to the CacheChange_t
+     * @return True on success
+     */
+    bool get_key(CacheChange_t* change);
+
+    //!Pointer to the associated mp_SPDP;
+    PDP* parent_pdp_;
+
+    /**
+     * @brief Temporary data to avoid reallocations.
+     *
+     * @remarks This should be always accessed with the pdp_reader lock taken
+     */
+    ParticipantProxyData temp_participant_data_;
+};
+
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_PDPLISTENER_H_ */

+ 283 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPServer.h

@@ -0,0 +1,283 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDPServer.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_PDPSERVER_H_
+#define _FASTDDS_RTPS_PDPSERVER_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/participant/PDP.h>
+#include <fastdds/rtps/messages/RTPSMessageGroup.h>
+#include <fastdds/rtps/builtin/discovery/participant/timedevent/DServerEvent.h>
+
+ // TODO: remove when the Writer API issue is resolved
+#include <fastdds/rtps/attributes/WriterAttributes.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class StatefulWriter;
+class StatefulReader;
+class RemoteWriterAttributes;
+
+/**
+ * Class PDPServer manages server side of the discovery server mechanism
+ *@ingroup DISCOVERY_MODULE
+ */
+class PDPServer : public PDP
+{
+    friend class DServerEvent;
+    friend class PDPServerListener;
+
+    friend class InPDPCallback;
+
+    typedef std::set<const ParticipantProxyData*> pending_matches_list;
+    typedef std::set<InstanceHandle_t> key_list;
+
+    //! EDP pending matches
+    pending_matches_list _p2match;
+
+    //! Keys to wipe out from WriterHistory because its related Participants have been removed
+    key_list _demises;
+
+    //! TRANSIENT or TRANSIENT_LOCAL durability;
+    DurabilityKind_t _durability;
+
+    //! Temporary locator list to solve new Writer API issue
+    // TODO: remove when the Writer API issue is resolved
+    std::map<GUID_t, ReaderProxyData> clients_;
+
+public:
+
+    /**
+     * Constructor
+     * @param builtin Pointer to the BuiltinProcols object.
+     * @param allocation participant's allocation settings
+     * @param durability_kind the kind of persistence we want for the discovery data
+     */
+    PDPServer(
+            BuiltinProtocols* builtin,
+            const RTPSParticipantAllocationAttributes& allocation,
+            DurabilityKind_t durability_kind = TRANSIENT_LOCAL);
+    ~PDPServer();
+
+    void initializeParticipantProxyData(ParticipantProxyData* participant_data) override;
+
+    /**
+     * Initialize the PDP.
+     * @param part Pointer to the RTPSParticipant.
+     * @return True on success
+     */
+    bool init(RTPSParticipantImpl* part) override;
+
+    /**
+     * Creates an initializes a new participant proxy from a DATA(p) raw info
+     * @param p ParticipantProxyData from DATA msg deserialization
+     * @param writer_guid GUID of originating writer
+     * @return new ParticipantProxyData * or nullptr on failure
+     */
+    ParticipantProxyData* createParticipantProxyData(
+        const ParticipantProxyData& p,
+        const GUID_t& writer_guid) override;
+
+    /**
+     * Create the SPDP Writer and Reader
+     * @return True if correct.
+     */
+    bool createPDPEndpoints() override;
+
+    /**
+     * This method removes a remote RTPSParticipant and all its writers and readers.
+     * @param participant_guid GUID_t of the remote RTPSParticipant.
+     * @param reason Why the participant is being removed (dropped vs removed)
+     * @return true if correct.
+     */
+    bool remove_remote_participant(
+            const GUID_t& participant_guid,
+            ParticipantDiscoveryInfo::DISCOVERY_STATUS reason) override;
+
+    /**
+     * Methods to update WriterHistory with reader information
+     */
+
+    /**
+     * Some History data is flag for defer removal till every client
+     * acknowledges reception
+     * @return True if trimming must be done
+     */
+    bool pendingHistoryCleaning();
+
+    /**
+     *! Callback to remove unnecesary WriterHistory info from PDP and EDP
+     * @return True if trimming is completed
+     */
+    bool trimWriterHistory();
+
+    /**
+     * Add participant CacheChange_ts from reader to writer
+     * @param c metatraffic CacheChange_t
+     * @return True if successfully modified WriterHistory
+     */
+    bool addRelayedChangeToHistory(CacheChange_t& c);
+
+    /**
+     * Trigger the participant CacheChange_t removal system
+     * @param h instanceHandle associated with participants CacheChange_ts
+     * @return True if successfully modified WriterHistory
+     */
+    void removeParticipantFromHistory(const InstanceHandle_t& h);
+
+    /**
+     * Methods to synchronize EDP matching
+     */
+
+    /**
+     * Add a participant to the queue of pending participants to EDP matching
+     * @param p ParticipantProxyData associated with the new participant
+     */
+    void queueParticipantForEDPMatch(const ParticipantProxyData* p);
+
+    /**
+     * Remove a participant from the queue of pending participants to EDP matching
+     * @param guid GUID associated with the new participant
+     */
+    void removeParticipantForEDPMatch(const GUID_t& guid);
+
+    /**
+     * Check if all client have acknowledge the server PDP data
+     * @return True if all clients known each other
+     */
+    bool all_clients_acknowledge_PDP();
+
+    /**
+     * Check if there are pending matches.
+     * @return True if all participants EDP endpoints are already matched
+     */
+    inline bool pendingEDPMatches()
+    {
+        std::lock_guard<std::recursive_mutex> guardPDP(*mp_mutex);
+
+        return !_p2match.empty();
+    }
+
+    //! Matches all clients EDP endpoints
+    void match_all_clients_EDP_endpoints();
+
+    /**
+     * Methods to synchronize with another servers
+     */
+
+    /**
+    * Check if all servers have acknowledge this server PDP data
+    * This method must be called from a mutex protected context.
+    * @return True if all can reach the client
+    */
+    bool all_servers_acknowledge_PDP();
+
+    /**
+     * Check if we have our PDP received data updated
+     * This method must be called from a mutex protected context.
+     * @return True if we known all the participants the servers are aware of
+     */
+    bool is_all_servers_PDPdata_updated();
+
+    /**
+     * Matching server EDP endpoints
+     * @return true if all servers have been discovered
+     */
+    bool match_servers_EDP_endpoints();
+
+    /**
+     * Force the sending of our local PDP to all servers
+     * @param new_change If true a new change (with new seqNum) is created and sent; if false the last change is re-sent
+     * @param dispose Sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED
+     * @param wparams allows to identify the change
+     */
+    void announceParticipantState(
+        bool new_change,
+        bool dispose = false,
+        WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT) override;
+
+    /**
+     * These methods wouldn't be needed under perfect server operation (no need of dynamic endpoint allocation)
+     * but must be implemented to solve server shutdown situations.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     */
+    void assignRemoteEndpoints(ParticipantProxyData* pdata) override;
+    void removeRemoteEndpoints(ParticipantProxyData * pdata) override;
+    void notifyAboveRemoteEndpoints(const ParticipantProxyData& pdata) override;
+
+#if HAVE_SQLITE3
+    //! Get filename for persistence database file
+    std::string GetPersistenceFileName();
+#endif
+
+    //! returns true if loading info from persistency database
+    bool ongoingDeserialization();
+
+    //! Process the info recorded in the persistence database
+    void processPersistentData();
+
+    //! Wakes up the DServerEvent for new matching or trimming
+    void awakeServerThread() { mp_sync->restart_timer(); }
+
+    // The following struct and two methods solve a callback synchronization issue
+
+    class InPDPCallback
+    {
+        friend class PDPServer;
+        PDPServer & server_;
+
+    public:
+
+        InPDPCallback(PDPServer & svr);
+        ~InPDPCallback();
+    };
+
+    // ! returns a unique_ptr to an object that handles PDP_callback_ in a RAII fashion
+    std::unique_ptr<InPDPCallback> signalCallback();
+
+    // ! calls PDP Reader matched_writer_remove preventing deadlocks
+    bool safe_PDP_matched_writer_remove(const GUID_t& wguid);
+
+private:
+
+    /**
+     * Callback to remove unnecesary WriterHistory info from PDP alone
+     * @return True if trimming is completed
+     */
+    bool trimPDPWriterHistory();
+
+    /**
+    * TimedEvent for server synchronization:
+    *   first stage: periodically resend the local RTPSParticipant information until all servers have acknowledge reception
+    *   second stage: waiting PDP info is up to date before allowing EDP matching
+    */
+    DServerEvent* mp_sync;
+
+    // ! on PDP DATA(p[UD]) callback. Only modified by transport threads which are
+    // serialized for PDP reader
+    volatile bool PDP_callback_;
+};
+
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_RTPS_PDPSERVER_H_ */

+ 66 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPServerListener.h

@@ -0,0 +1,66 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDPServerListener.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_PDPSERVERLISTENER_H_
+#define _FASTDDS_RTPS_PDPSERVERLISTENER_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/participant/PDPListener.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class PDPServer;
+
+/**
+ * Class PDPServerListener, specification used by the PDP to perform the History check when a new message is received.
+ * This class is implemented in order to use the same structure than with any other RTPSReader.
+ *@ingroup DISCOVERY_MODULE
+ */
+class PDPServerListener: public PDPListener
+{
+public:
+    /**
+     * @param in_PDP
+     */
+    PDPServerListener(PDPServer* in_PDP);
+
+    ~PDPServerListener() override = default;
+
+    //!Pointer to the associated mp_SPDP;
+    PDPServer* parent_server_pdp_;
+
+    /**
+     * New added cache
+     * @param reader
+     * @param change
+     */
+    void onNewCacheChangeAdded(
+            RTPSReader* reader,
+            const CacheChange_t* const change) override;
+};
+
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_PDPSERVERLISTENER_H_ */

+ 134 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/PDPSimple.h

@@ -0,0 +1,134 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file PDPSimple.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_
+#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/builtin/discovery/participant/PDP.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class StatelessWriter;
+class StatelessReader;
+
+/**
+ * Class PDPSimple that implements the SimpleRTPSParticipantDiscoveryProtocol as defined in the RTPS specification.
+ * @ingroup DISCOVERY_MODULE
+ */
+class PDPSimple : public PDP
+{
+public:
+
+    /**
+     * Constructor
+     * @param builtin Pointer to the BuiltinProcols object.
+     * @param allocation Participant allocation parameters.
+     */
+    PDPSimple(
+            BuiltinProtocols* builtin,
+            const RTPSParticipantAllocationAttributes& allocation);
+
+    virtual ~PDPSimple();
+
+    /**
+     * Initialize the PDP.
+     * @param part Pointer to the RTPSParticipant.
+     * @return True on success
+     */
+    bool init(RTPSParticipantImpl* part) override;
+
+    /**
+     * Creates an initializes a new participant proxy from a DATA(p) raw info
+     * @param p ParticipantProxyData from DATA msg deserialization
+     * @param writer_guid GUID of originating writer
+     * @return new ParticipantProxyData * or nullptr on failure
+     */
+    ParticipantProxyData* createParticipantProxyData(
+        const ParticipantProxyData& p,
+        const GUID_t& writer_guid) override;
+
+    /**
+     * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic
+     * @return true if EDP endpoinst must be match
+     */
+    bool updateInfoMatchesEDP() override;
+
+    /**
+     * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators.
+     * @param new_change If true a new change (with new seqNum) is created and sent; if false the last change is re-sent
+     * @param dispose Sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED
+     * @param wparams allows to identify the change
+     */
+    void announceParticipantState(
+        bool new_change,
+        bool dispose = false,
+        WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT) override;
+
+    /**
+     * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls
+     * the corresponding methods in EDP and WLP.
+     * @param pdata Pointer to the ParticipantProxyData object.
+     */
+    void assignRemoteEndpoints(ParticipantProxyData* pdata) override;
+
+    /**
+     * Remove remote endpoints from the participant discovery protocol
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    void removeRemoteEndpoints(ParticipantProxyData * pdata) override;
+
+    /**
+     * This method notifies EDP and WLP of the existence of a new participant.
+     * @param pdata
+     */
+    void notifyAboveRemoteEndpoints(const ParticipantProxyData& pdata) override;
+
+    /**
+     * Activate a new Remote Endpoint that has been statically discovered.
+     * @param pguid GUID_t of the participant.
+     * @param userDefinedId User Defined ID.
+     * @param kind Kind of endpoint.
+     */
+    bool newRemoteEndpointStaticallyDiscovered(
+            const GUID_t& pguid,
+            int16_t userDefinedId,
+            EndpointKind_t kind);
+
+
+private:
+
+    void initializeParticipantProxyData(ParticipantProxyData* participant_data) override;
+
+    /**
+     * Create the SPDP Writer and Reader
+     * @return True if correct.
+     */
+    bool createPDPEndpoints() override;
+
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif //_FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_

+ 63 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/timedevent/DSClientEvent.h

@@ -0,0 +1,63 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DSClientEvent.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_DSCLIENTEVENT_H_
+#define _FASTDDS_RTPS_DSCLIENTEVENT_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/resources/TimedEvent.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class PDPClient;
+
+/**
+ * Class DSClientEvent, TimedEvent used to synchronize discover-server clients
+ *@ingroup DISCOVERY_MODULE
+ */
+class DSClientEvent : public TimedEvent {
+public:
+
+    /**
+     * Constructor.
+     * @param p_PDP Pointer to the PDPClient.
+     * @param interval Interval in ms.
+     */
+    DSClientEvent(PDPClient* p_PDP,
+            double interval);
+    ~DSClientEvent();
+
+    /**
+    * Method invoked when the event occurs.
+    * This temporal event:
+        + resends the client RTPSParticipantProxyData to all remote servers.
+        + matches the EDP endpoints when the servers are all aware of this client existence
+    */
+    bool event();
+
+    //!Pointer to the PDPServer object.
+    PDPClient* mp_PDP;
+};
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_RTPS_DSCLIENTEVENT_H_ */

+ 65 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/discovery/participant/timedevent/DServerEvent.h

@@ -0,0 +1,65 @@
+// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file DServerEvent.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_DSERVEREVENT_H_
+#define _FASTDDS_RTPS_DSERVEREVENT_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/resources/TimedEvent.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class PDPServer;
+
+/**
+ * Class DServerEvent, TimedEvent used to synchronize discover-server servers
+ *@ingroup DISCOVERY_MODULE
+ */
+class DServerEvent : public TimedEvent {
+public:
+
+    /**
+     * Constructor.
+     * @param p_PDP Pointer to the PDPServer.
+     * @param interval Interval in ms.
+     */
+    DServerEvent(PDPServer* p_PDP,
+            double interval);
+    ~DServerEvent();
+
+    /**
+    * Method invoked when the event occurs.
+    * This temporal event:
+        + resends the client RTPSParticipantProxyData to all remote servers.
+        + matches the EDP endpoints when the servers are all aware of this client existence
+    */
+    bool event();
+
+    //!Pointer to the PDPServer object.
+    PDPServer* mp_PDP;
+    //!Initialize PDP reception when first run
+    bool messages_enabled_;
+};
+}
+} /* namespace rtps */
+} /* namespace eprosima */
+#endif
+#endif /* _FASTDDS_RTPS_DSERVEREVENT_H_ */

+ 306 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/liveliness/WLP.h

@@ -0,0 +1,306 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WLP.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_WLP_H_
+#define _FASTDDS_RTPS_WLP_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <vector>
+#include <mutex>
+
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/Locator.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastrtps/qos/QosPolicies.h>
+
+#include <fastdds/rtps/builtin/data/WriterProxyData.h>
+#include <fastdds/rtps/builtin/data/ReaderProxyData.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class BuiltinProtocols;
+class LivelinessManager;
+class ReaderHistory;
+class ReaderProxyData;
+class RTPSParticipantImpl;
+class RTPSReader;
+class RTPSWriter;
+class StatefulReader;
+class StatefulWriter;
+class ParticipantProxyData;
+class TimedEvent;
+class WLPListener;
+class WriterHistory;
+class WriterProxyData;
+
+/**
+ * Class WLP that implements the Writer Liveliness Protocol described in the RTPS specification.
+ * @ingroup LIVELINESS_MODULE
+ */
+class WLP
+{
+    friend class WLPListener;
+    friend class StatefulReader;
+    friend class StatelessReader;
+
+public:
+
+    /**
+     * Constructor
+     * @param prot Pointer to the BuiltinProtocols object.
+     */
+    WLP(
+            BuiltinProtocols* prot);
+    virtual ~WLP();
+    /**
+     * Initialize the WLP protocol.
+     * @param p Pointer to the RTPS participant implementation.
+     * @return true if the initialziacion was succesful.
+     */
+    bool initWL(
+            RTPSParticipantImpl* p);
+    /**
+     * Assign the remote endpoints for a newly discovered RTPSParticipant.
+     * @param pdata Pointer to the RTPSParticipantProxyData object.
+     * @return True if correct.
+     */
+    bool assignRemoteEndpoints(
+            const ParticipantProxyData& pdata);
+    /**
+     * Remove remote endpoints from the liveliness protocol.
+     * @param pdata Pointer to the ParticipantProxyData to remove
+     */
+    void removeRemoteEndpoints(
+            ParticipantProxyData* pdata);
+    /**
+     * Add a local writer to the liveliness protocol.
+     * @param W Pointer to the RTPSWriter.
+     * @param wqos Quality of service policies for the writer.
+     * @return True if correct.
+     */
+    bool add_local_writer(
+            RTPSWriter* W,
+            const WriterQos& wqos);
+    /**
+     * Remove a local writer from the liveliness protocol.
+     * @param W Pointer to the RTPSWriter.
+     * @return True if removed.
+     */
+    bool remove_local_writer(
+            RTPSWriter* W);
+
+    /**
+     * @brief Adds a local reader to the liveliness protocol
+     * @param reader Pointer to the RTPS reader
+     * @param rqos Quality of service policies for the reader
+     * @return True if added successfully
+     */
+    bool add_local_reader(
+            RTPSReader* reader,
+            const ReaderQos& rqos);
+
+    /**
+     * @brief Removes a local reader from the livliness protocol
+     * @param reader Pointer to the reader to remove
+     * @return True if removed successfully
+     */
+    bool remove_local_reader(
+            RTPSReader* reader);
+
+    /**
+     * @brief A method to assert liveliness of a given writer
+     * @param writer The writer, specified via its id
+     * @param kind The writer liveliness kind
+     * @param lease_duration The writer lease duration
+     * @return True if liveliness was asserted
+     */
+    bool assert_liveliness(
+            GUID_t writer,
+            LivelinessQosPolicyKind kind,
+            Duration_t lease_duration);
+
+    /**
+     * @brief A method to assert liveliness of MANUAL_BY_PARTICIPANT writers
+     * @return True if there were any MANUAL_BY_PARTICIPANT writers
+     */
+    bool assert_liveliness_manual_by_participant();
+
+    /**
+     * Get the livelines builtin writer
+     * @return stateful writer
+     */
+    StatefulWriter* builtin_writer();
+
+    /**
+     * Get the livelines builtin writer's history
+     * @return writer history
+     */
+    WriterHistory* builtin_writer_history();
+
+#if HAVE_SECURITY
+    bool pairing_remote_reader_with_local_writer_after_security(
+            const GUID_t& local_writer,
+            const ReaderProxyData& remote_reader_data);
+
+    bool pairing_remote_writer_with_local_reader_after_security(
+            const GUID_t& local_reader,
+            const WriterProxyData& remote_writer_data);
+#endif
+
+private:
+
+    /**
+     * Create the endpoints used in the WLP.
+     * @return true if correct.
+     */
+    bool createEndpoints();
+
+    //! Minimum time among liveliness periods of automatic writers, in milliseconds
+    double min_automatic_ms_;
+    //! Minimum time among liveliness periods of manual by participant writers, in milliseconds
+    double min_manual_by_participant_ms_;
+    //!Pointer to the local RTPSParticipant.
+    RTPSParticipantImpl* mp_participant;
+    //!Pointer to the builtinprotocol class.
+    BuiltinProtocols* mp_builtinProtocols;
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    StatefulWriter* mp_builtinWriter;
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    StatefulReader* mp_builtinReader;
+    //!Writer History
+    WriterHistory* mp_builtinWriterHistory;
+    //!Reader History
+    ReaderHistory* mp_builtinReaderHistory;
+    //!Listener object.
+    WLPListener* mp_listener;
+    //!Pointer to the periodic assertion timer object for automatic liveliness writers
+    TimedEvent* automatic_liveliness_assertion_;
+    //!Pointer to the periodic assertion timer object for manual by participant liveliness writers
+    TimedEvent* manual_liveliness_assertion_;
+    //! List of the writers using automatic liveliness.
+    std::vector<RTPSWriter*> automatic_writers_;
+    //! List of the writers using manual by participant liveliness.
+    std::vector<RTPSWriter*> manual_by_participant_writers_;
+    //! List of writers using manual by topic liveliness
+    std::vector<RTPSWriter*> manual_by_topic_writers_;
+
+    //! List of readers
+    std::vector<RTPSReader*> readers_;
+    //! A boolean indicating that there is at least one reader requesting automatic liveliness
+    bool automatic_readers_;
+
+    //! A class used by writers in this participant to keep track of their liveliness
+    LivelinessManager* pub_liveliness_manager_;
+    //! A class used by readers in this participant to keep track of liveliness of matched writers
+    LivelinessManager* sub_liveliness_manager_;
+
+    InstanceHandle_t automatic_instance_handle_;
+    InstanceHandle_t manual_by_participant_instance_handle_;
+
+    /**
+     * @brief A method invoked by pub_liveliness_manager_ to inform that a writer changed its liveliness
+     * @param writer The writer losing liveliness
+     * @param kind The liveliness kind
+     * @param lease_duration The liveliness lease duration
+     * @param alive_change The change in the alive count
+     * @param not_alive_change The change in the not alive count
+     */
+    void pub_liveliness_changed(
+            const GUID_t& writer,
+            const LivelinessQosPolicyKind& kind,
+            const Duration_t& lease_duration,
+            int32_t alive_change,
+            int32_t not_alive_change);
+
+    /**
+     * @brief A method invoked by sub_liveliness_manager_ to inform that a writer changed its liveliness
+     * @param writer The writer losing liveliness
+     * @param kind The liveliness kind of the writer losing liveliness
+     * @param lease_duration The liveliness lease duration of the writer losing liveliness
+     * @param alive_change The change in the alive count
+     * @param not_alive_change The change in the not alive count
+     */
+    void sub_liveliness_changed(
+            const GUID_t& writer,
+            const LivelinessQosPolicyKind& kind,
+            const Duration_t& lease_duration,
+            int32_t alive_change,
+            int32_t not_alive_change);
+
+    /**
+     * @brief A method to update the liveliness changed status of a given reader
+     * @param writer The writer changing liveliness, specified by its guid
+     * @param reader The reader whose liveliness needs to be updated
+     * @param alive_change The change requested for alive count. Should be -1, 0 or +1
+     * @param not_alive_change The change requested for not alive count. Should be -1, 0 or +1
+     */
+    void update_liveliness_changed_status(
+            GUID_t writer,
+            RTPSReader* reader,
+            int32_t alive_change,
+            int32_t not_alive_change);
+
+    /**
+     * Implements the automatic liveliness timed event
+     */
+    bool automatic_liveliness_assertion();
+
+    /**
+     * Implements the manual by participant liveliness timed event
+     */
+    bool participant_liveliness_assertion();
+
+    /**
+     * Adds a cache change to the WLP writer
+     * @param instance key of the change to add
+     * @return true if change is correctly added
+     */
+    bool send_liveliness_message(
+            const InstanceHandle_t& instance);
+
+#if HAVE_SECURITY
+    //!Pointer to the builtinRTPSParticipantMEssageWriter.
+    StatefulWriter* mp_builtinWriterSecure;
+    //!Pointer to the builtinRTPSParticipantMEssageReader.
+    StatefulReader* mp_builtinReaderSecure;
+    //!Writer History
+    WriterHistory* mp_builtinWriterSecureHistory;
+    //!Reader History
+    ReaderHistory* mp_builtinReaderSecureHistory;
+
+    /**
+     * Create the secure endpoitns used in the WLP.
+     * @return true if correct.
+     */
+    bool createSecureEndpoints();
+#endif
+
+    std::mutex temp_data_lock_;
+    ReaderProxyData temp_reader_proxy_data_;
+    WriterProxyData temp_writer_proxy_data_;
+};
+
+} /* namespace rtps */
+} /* namespace fastrtps */
+} /* namespace eprosima */
+
+#endif
+#endif /* _FASTDDS_RTPS_WLP_H_ */

+ 94 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/builtin/liveliness/WLPListener.h

@@ -0,0 +1,94 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file WLPListener.h
+ *
+ */
+
+#ifndef _FASTDDS_RTPS_WLPLISTENER_H_
+#define _FASTDDS_RTPS_WLPLISTENER_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/reader/ReaderListener.h>
+#include <fastdds/rtps/common/Guid.h>
+#include <fastdds/rtps/common/InstanceHandle.h>
+
+#include <fastrtps/qos/QosPolicies.h>
+
+namespace eprosima {
+namespace fastrtps{
+namespace rtps {
+
+class WLP;
+class RTPSReader;
+struct CacheChange_t;
+
+/**
+ * Class WLPListener that receives the liveliness messages asserting the liveliness of remote endpoints.
+ * @ingroup LIVELINESS_MODULE
+ */
+class WLPListener: public ReaderListener {
+public:
+
+    /**
+     * @brief Constructor
+     * @param pwlp Pointer to the writer liveliness protocol
+     */
+    WLPListener(WLP* pwlp);
+
+    /**
+     * @brief Destructor
+     */
+    virtual ~WLPListener();
+
+    /**
+     * @brief Method call when this class is notified of a new cache change
+     * @param reader The reader receiving the cache change
+     * @param change The cache change
+     */
+    void onNewCacheChangeAdded(
+            RTPSReader* reader,
+            const CacheChange_t* const  change) override;
+
+private:
+
+    /**
+    * Separate the Key between the GuidPrefix_t and the liveliness Kind
+    * @param key InstanceHandle_t to separate.
+    * @param guidP GuidPrefix_t pointer to store the info.
+    * @param liveliness Liveliness Kind Pointer.
+    * @return True if correctly separated.
+    */
+    bool separateKey(
+            InstanceHandle_t& key,
+            GuidPrefix_t* guidP,
+            LivelinessQosPolicyKind* liveliness);
+
+    /**
+    * Compute the key from a CacheChange_t
+    * @param change
+    */
+    bool computeKey(CacheChange_t* change);
+
+    //! A pointer to the writer liveliness protocol
+    WLP* mp_WLP;
+
+};
+
+} /* namespace rtps */
+} /* namespace eprosima */
+}
+#endif
+#endif /* _FASTDDS_RTPS_WLPLISTENER_H_ */

+ 182 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/BinaryProperty.h

@@ -0,0 +1,182 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*!
+ * @file BinaryProperty.h
+ */
+
+#ifndef _FASTDDS_RTPS_COMMON_BINARYPROPERTY_H_
+#define _FASTDDS_RTPS_COMMON_BINARYPROPERTY_H_
+
+#include <string>
+#include <vector>
+#include <iostream>
+#include <cstdint>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+class BinaryProperty
+{
+    public:
+
+        BinaryProperty() : propagate_(false) {}
+
+        BinaryProperty(const BinaryProperty& property) :
+            name_(property.name_),
+            value_(property.value_),
+            propagate_(property.propagate_) {}
+
+        BinaryProperty(BinaryProperty&& property) :
+            name_(std::move(property.name_)),
+            value_(std::move(property.value_)),
+            propagate_(property.propagate_) {}
+
+        BinaryProperty(const std::string& name,
+                const std::vector<uint8_t>& value) :
+            name_(name), value_(value) {}
+
+        BinaryProperty(std::string&& name,
+                std::vector<uint8_t>&& value) :
+            name_(std::move(name)), value_(std::move(value)) {}
+
+        BinaryProperty& operator=(const BinaryProperty& property)
+        {
+            name_ = property.name_;
+            value_ = property.value_;
+            propagate_ = property.propagate_;
+            return *this;
+        }
+
+        BinaryProperty& operator=(BinaryProperty&& property)
+        {
+            name_ = std::move(property.name_);
+            value_ = std::move(property.value_);
+            propagate_ = property.propagate_;
+            return *this;
+        }
+
+        bool operator==(const BinaryProperty& b) const
+        {
+            return (this->name_ == b.name_) &&
+                   (this->value_ == b.value_);
+        }
+
+        void name(const std::string& name)
+        {
+            name_ = name;
+        }
+
+        void name(std::string&& name)
+        {
+            name_ = std::move(name);
+        }
+
+        const std::string& name() const
+        {
+            return name_;
+        }
+
+        std::string& name()
+        {
+            return name_;
+        }
+
+        void value(const std::vector<uint8_t>& value)
+        {
+            value_ = value;
+        }
+
+        void value(std::vector<uint8_t>&& value)
+        {
+            value_ = std::move(value);
+        }
+
+        const std::vector<uint8_t>& value() const
+        {
+            return value_;
+        }
+
+        std::vector<uint8_t>& value()
+        {
+            return value_;
+        }
+
+        void propagate(bool propagate)
+        {
+            propagate_ = propagate;
+        }
+
+        bool propagate() const
+        {
+            return propagate_;
+        }
+
+        bool& propagate()
+        {
+            return propagate_;
+        }
+
+    private:
+
+        std::string name_;
+
+        std::vector<uint8_t> value_;
+
+        bool propagate_;
+};
+
+typedef std::vector<BinaryProperty> BinaryPropertySeq;
+
+class BinaryPropertyHelper
+{
+    public:
+
+        static size_t serialized_size(const BinaryProperty& binary_property, size_t current_alignment = 0)
+        {
+            if(binary_property.propagate())
+            {
+                size_t initial_alignment = current_alignment;
+
+                current_alignment += 4 + alignment(current_alignment, 4) + binary_property.name().size() + 1;
+                current_alignment += 4 + alignment(current_alignment, 4) + binary_property.value().size();
+
+                return current_alignment - initial_alignment;
+            }
+            else
+                return 0;
+        }
+
+        static size_t serialized_size(const BinaryPropertySeq& binary_properties, size_t current_alignment = 0)
+        {
+            size_t initial_alignment = current_alignment;
+
+            current_alignment += 4 + alignment(current_alignment, 4);
+            for(auto binary_property = binary_properties.begin(); binary_property != binary_properties.end(); ++binary_property)
+                current_alignment += serialized_size(*binary_property, current_alignment);
+
+            return current_alignment - initial_alignment;
+        }
+
+    private:
+
+        inline static size_t alignment(size_t current_alignment, size_t dataSize) { return (dataSize - (current_alignment % dataSize)) & (dataSize-1);}
+};
+
+} //namespace rtps
+} //namespace fastrtps
+} //namespace eprosima
+
+#endif // _FASTDDS_RTPS_COMMON_BINARYPROPERTY_H_

+ 242 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/CDRMessage_t.h

@@ -0,0 +1,242 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file CDRMessage_t.h
+ */
+
+#ifndef _FASTDDS_RTPS_CDRMESSAGE_T_H_
+#define _FASTDDS_RTPS_CDRMESSAGE_T_H_
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+#include <fastdds/rtps/common/SerializedPayload.h>
+#include <fastdds/rtps/common/Types.h>
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+//!Max size of RTPS message in bytes.
+#define RTPSMESSAGE_DEFAULT_SIZE 10500  //max size of rtps message in bytes
+#define RTPSMESSAGE_COMMON_RTPS_PAYLOAD_SIZE 536 //common payload a rtps message has TODO(Ricardo) It is necessary?
+#define RTPSMESSAGE_COMMON_DATA_PAYLOAD_SIZE 10000 //common data size
+#define RTPSMESSAGE_HEADER_SIZE 20  //header size in bytes
+#define RTPSMESSAGE_SUBMESSAGEHEADER_SIZE 4
+#define RTPSMESSAGE_DATA_EXTRA_INLINEQOS_SIZE 4
+#define RTPSMESSAGE_INFOTS_SIZE 12
+
+#define RTPSMESSAGE_OCTETSTOINLINEQOS_DATASUBMSG 16 //may change in future versions
+#define RTPSMESSAGE_OCTETSTOINLINEQOS_DATAFRAGSUBMSG 28 //may change in future versions
+#define RTPSMESSAGE_DATA_MIN_LENGTH 24
+
+/**
+ * @brief Structure CDRMessage_t, contains a serialized message.
+ * @ingroup COMMON_MODULE
+ */
+struct RTPS_DllAPI CDRMessage_t final
+{
+    // TODO(Miguel C): Deprecate when not used in mocks
+    CDRMessage_t()
+        : CDRMessage_t(RTPSMESSAGE_DEFAULT_SIZE)
+    {
+    }
+
+    ~CDRMessage_t()
+    {
+        if (buffer != nullptr && !wraps)
+        {
+            free(buffer);
+        }
+    }
+
+    /**
+     * Constructor with maximum size
+     * @param size Maximum size
+     */
+    explicit CDRMessage_t(
+            uint32_t size)
+    {
+        wraps = false;
+        pos = 0;
+        length = 0;
+
+        if (size != 0)
+        {
+            buffer = (octet*)malloc(size);
+        }
+        else
+        {
+            buffer = nullptr;
+        }
+
+        max_size = size;
+        reserved_size = size;
+
+#if __BIG_ENDIAN__
+        msg_endian = BIGEND;
+#else
+        msg_endian = LITTLEEND;
+#endif
+    }
+
+    /**
+     * Constructor to wrap a serialized payload
+     * @param payload Payload to wrap
+     */
+    explicit CDRMessage_t(
+            const SerializedPayload_t& payload)
+        : wraps(true)
+    {
+        msg_endian = payload.encapsulation == PL_CDR_BE ? BIGEND : LITTLEEND;
+        pos = payload.pos;
+        length = payload.length;
+        buffer = payload.data;
+        max_size = payload.max_size;
+        reserved_size = payload.max_size;
+    }
+
+    CDRMessage_t(
+            const CDRMessage_t& message)
+    {
+        wraps = false;
+        pos = 0;
+        length = message.length;
+        max_size = message.max_size;
+        msg_endian = message.msg_endian;
+
+        reserved_size = max_size;
+        if (max_size != 0)
+        {
+            buffer =  (octet*)malloc(max_size);
+            memcpy(buffer, message.buffer, length);
+        }
+        else
+        {
+            buffer = nullptr;
+        }
+    }
+
+    CDRMessage_t(
+            CDRMessage_t&& message)
+    {
+        wraps = message.wraps;
+        message.wraps = false;
+        pos = message.pos;
+        message.pos = 0;
+        length = message.length;
+        message.length = 0;
+        max_size = message.max_size;
+        message.max_size = 0;
+        reserved_size = message.reserved_size;
+        message.reserved_size = 0;
+        msg_endian = message.msg_endian;
+#if __BIG_ENDIAN__
+        message.msg_endian = BIGEND;
+#else
+        message.msg_endian = LITTLEEND;
+#endif
+        buffer = message.buffer;
+        message.buffer = nullptr;
+    }
+
+    CDRMessage_t& operator =(
+            CDRMessage_t&& message)
+    {
+        wraps = message.wraps;
+        message.wraps = false;
+        pos = message.pos;
+        message.pos = 0;
+        length = message.length;
+        message.length = 0;
+        max_size = message.max_size;
+        message.max_size = 0;
+        reserved_size = message.reserved_size;
+        message.reserved_size = 0;
+        msg_endian = message.msg_endian;
+#if __BIG_ENDIAN__
+        message.msg_endian = BIGEND;
+#else
+        message.msg_endian = LITTLEEND;
+#endif
+        buffer = message.buffer;
+        message.buffer = nullptr;
+
+        return *(this);
+    }
+
+    void init(
+            octet* buffer_ptr,
+            uint32_t size)
+    {
+        assert(buffer == nullptr);
+        wraps = true;
+        pos = 0;
+        length = 0;
+        buffer = buffer_ptr;
+        max_size = size;
+        reserved_size = size;
+
+#if __BIG_ENDIAN__
+        msg_endian = BIGEND;
+#else
+        msg_endian = LITTLEEND;
+#endif
+    }
+
+    void reserve(
+            uint32_t size)
+    {
+        assert(wraps == false);
+        if (size > reserved_size)
+        {
+            octet* new_buffer = (octet*) realloc(buffer, size);
+            if (new_buffer == nullptr)
+            {
+                // TODO: Exception? Assertion?
+            }
+            else
+            {
+                buffer = new_buffer;
+                reserved_size = size;
+            }
+        }
+
+        max_size = size;
+    }
+
+    //!Pointer to the buffer where the data is stored.
+    octet* buffer;
+    //!Read or write position.
+    uint32_t pos;
+    //!Max size of the message.
+    uint32_t max_size;
+    //!Size allocated on buffer. May be higher than max_size.
+    uint32_t reserved_size;
+    //!Current length of the message.
+    uint32_t length;
+    //!Endianness of the message.
+    Endianness_t msg_endian;
+    //Whether this message is wrapping a buffer managed elsewhere.
+    bool wraps;
+};
+
+}  // namespace rtps
+}  // namespace fastrtps
+}  // namespace eprosima
+
+#endif /* DOXYGEN_SHOULD_SKIP_THIS_PUBLIC */
+#endif /* _FASTDDS_RTPS_CDRMESSAGE_T_H_ */

+ 596 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/CacheChange.h

@@ -0,0 +1,596 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file CacheChange.h
+ */
+
+#ifndef _FASTDDS_RTPS_CACHECHANGE_H_
+#define _FASTDDS_RTPS_CACHECHANGE_H_
+
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/WriteParams.h>
+#include <fastdds/rtps/common/SerializedPayload.h>
+#include <fastdds/rtps/common/Time_t.h>
+#include <fastdds/rtps/common/InstanceHandle.h>
+#include <fastdds/rtps/common/FragmentNumber.h>
+
+#include <vector>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+/**
+ * @enum ChangeKind_t, different types of CacheChange_t.
+ * @ingroup COMMON_MODULE
+ */
+enum RTPS_DllAPI ChangeKind_t
+{
+    ALIVE,                            //!< ALIVE
+    NOT_ALIVE_DISPOSED,               //!< NOT_ALIVE_DISPOSED
+    NOT_ALIVE_UNREGISTERED,           //!< NOT_ALIVE_UNREGISTERED
+    NOT_ALIVE_DISPOSED_UNREGISTERED   //!< NOT_ALIVE_DISPOSED_UNREGISTERED
+};
+
+/**
+ * Structure CacheChange_t, contains information on a specific CacheChange.
+ * @ingroup COMMON_MODULE
+ */
+struct RTPS_DllAPI CacheChange_t
+{
+    //!Kind of change, default value ALIVE.
+    ChangeKind_t kind = ALIVE;
+    //!GUID_t of the writer that generated this change.
+    GUID_t writerGUID;
+    //!Handle of the data associated wiht this change.
+    InstanceHandle_t instanceHandle;
+    //!SequenceNumber of the change
+    SequenceNumber_t sequenceNumber;
+    //!Serialized Payload associated with the change.
+    SerializedPayload_t serializedPayload;
+    //!Indicates if the cache has been read (only used in READERS)
+    bool isRead = false;
+    //!Source TimeStamp (only used in Readers)
+    Time_t sourceTimestamp;
+    //!Reception TimeStamp (only used in Readers)
+    Time_t receptionTimestamp;
+
+    WriteParams write_params;
+    bool is_untyped_ = true;
+
+    /*!
+     * @brief Default constructor.
+     * Creates an empty CacheChange_t.
+     */
+    CacheChange_t()
+    {
+    }
+
+    CacheChange_t(
+            const CacheChange_t&) = delete;
+    const CacheChange_t& operator =(
+            const CacheChange_t&) = delete;
+
+    /**
+     * Constructor with payload size
+     * @param payload_size Serialized payload size
+     * @param is_untyped Flag to mark the change as untyped.
+     */
+    CacheChange_t(
+            uint32_t payload_size,
+            bool is_untyped = false)
+        : serializedPayload(payload_size)
+        , is_untyped_(is_untyped)
+    {
+    }
+
+    /*!
+     * Copy a different change into this one. All the elements are copied, included the data, allocating new memory.
+     * @param[in] ch_ptr Pointer to the change.
+     * @return True if correct.
+     */
+    bool copy(
+            const CacheChange_t* ch_ptr)
+    {
+        kind = ch_ptr->kind;
+        writerGUID = ch_ptr->writerGUID;
+        instanceHandle = ch_ptr->instanceHandle;
+        sequenceNumber = ch_ptr->sequenceNumber;
+        sourceTimestamp = ch_ptr->sourceTimestamp;
+        write_params = ch_ptr->write_params;
+        isRead = ch_ptr->isRead;
+        fragment_size_ = ch_ptr->fragment_size_;
+        fragment_count_ = ch_ptr->fragment_count_;
+        first_missing_fragment_ = ch_ptr->first_missing_fragment_;
+
+        return serializedPayload.copy(&ch_ptr->serializedPayload, !ch_ptr->is_untyped_);
+    }
+
+    /*!
+     * Copy information form a different change into this one.
+     * All the elements are copied except data.
+     * @param[in] ch_ptr Pointer to the change.
+     */
+    void copy_not_memcpy(
+            const CacheChange_t* ch_ptr)
+    {
+        kind = ch_ptr->kind;
+        writerGUID = ch_ptr->writerGUID;
+        instanceHandle = ch_ptr->instanceHandle;
+        sequenceNumber = ch_ptr->sequenceNumber;
+        sourceTimestamp = ch_ptr->sourceTimestamp;
+        write_params = ch_ptr->write_params;
+        isRead = ch_ptr->isRead;
+
+        // Copy certain values from serializedPayload
+        serializedPayload.encapsulation = ch_ptr->serializedPayload.encapsulation;
+
+        // Copy fragment size and calculate fragment count
+        setFragmentSize(ch_ptr->fragment_size_, false);
+    }
+
+    ~CacheChange_t()
+    {
+    }
+
+    /*!
+     * Get the number of fragments this change is split into.
+     * @return number of fragments.
+     */
+    uint32_t getFragmentCount() const
+    {
+        return fragment_count_;
+    }
+
+    /*!
+     * Get the size of each fragment this change is split into.
+     * @return size of fragment (0 means change is not fragmented).
+     */
+    uint16_t getFragmentSize() const
+    {
+        return fragment_size_;
+    }
+
+    /*!
+     * Checks if all fragments have been received.
+     * @return true when change is fully assembled (i.e. no missing fragments).
+     */
+    bool is_fully_assembled()
+    {
+        return first_missing_fragment_ >= fragment_count_;
+    }
+
+    /*!
+     * Fills a FragmentNumberSet_t with the list of missing fragments.
+     * @param [out] frag_sns FragmentNumberSet_t where result is stored.
+     */
+    void get_missing_fragments(
+            FragmentNumberSet_t& frag_sns)
+    {
+        // Note: Fragment numbers are 1-based but we keep them 0 based.
+        frag_sns.base(first_missing_fragment_ + 1);
+
+        // Traverse list of missing fragments, adding them to frag_sns
+        uint32_t current_frag = first_missing_fragment_;
+        while (current_frag < fragment_count_)
+        {
+            frag_sns.add(current_frag + 1);
+            current_frag = get_next_missing_fragment(current_frag);
+        }
+    }
+
+    /*!
+     * Set fragment size for this change.
+     *
+     * @param fragment_size Size of fragments.
+     * @param create_fragment_list Whether to create missing fragments list or not.
+     *
+     * @remarks Parameter create_fragment_list should only be true when receiving the first
+     *          fragment of a change.
+     */
+    void setFragmentSize(
+            uint16_t fragment_size,
+            bool create_fragment_list = false)
+    {
+        fragment_size_ = fragment_size;
+        fragment_count_ = 0;
+        first_missing_fragment_ = 0;
+
+        if (fragment_size > 0)
+        {
+            // This follows RTPS 8.3.7.3.5
+            fragment_count_ = (serializedPayload.length + fragment_size - 1) / fragment_size;
+
+            if (create_fragment_list)
+            {
+                // Keep index of next fragment on the payload portion at the beginning of each fragment. Last
+                // fragment will have fragment_count_ as 'next fragment index'
+                size_t offset = 0;
+                for (uint32_t i = 1; i <= fragment_count_; i++, offset += fragment_size_)
+                {
+                    set_next_missing_fragment(i - 1, i);  // index to next fragment in missing list
+                }
+            }
+            else
+            {
+                // List not created. This means we are going to send this change fragmented, so it is already
+                // assembled, and the missing list is empty (i.e. first missing points to fragment count)
+                first_missing_fragment_ = fragment_count_;
+            }
+        }
+    }
+
+    bool add_fragments(
+            const SerializedPayload_t& incoming_data,
+            uint32_t fragment_starting_num,
+            uint32_t fragments_in_submessage)
+    {
+        uint32_t original_offset = (fragment_starting_num - 1) * fragment_size_;
+        uint32_t incoming_length = fragment_size_ * fragments_in_submessage;
+        uint32_t last_fragment_index = fragment_starting_num + fragments_in_submessage - 1;
+
+        // Validate fragment indexes
+        if (last_fragment_index > fragment_count_)
+        {
+            return false;
+        }
+
+        // validate lengths
+        if (last_fragment_index < fragment_count_)
+        {
+            if (incoming_data.length < incoming_length)
+            {
+                return false;
+            }
+        }
+        else
+        {
+            incoming_length = serializedPayload.length - original_offset;
+        }
+
+        if (original_offset + incoming_length > serializedPayload.length)
+        {
+            return false;
+        }
+
+        if (received_fragments(fragment_starting_num - 1, fragments_in_submessage))
+        {
+            memcpy(
+                &serializedPayload.data[original_offset],
+                incoming_data.data, incoming_length);
+        }
+
+        return is_fully_assembled();
+    }
+
+private:
+
+    // Fragment size
+    uint16_t fragment_size_ = 0;
+
+    // Number of fragments
+    uint32_t fragment_count_ = 0;
+
+    // First fragment in missing list
+    uint32_t first_missing_fragment_ = 0;
+
+    uint32_t get_next_missing_fragment(
+            uint32_t fragment_index)
+    {
+        uint32_t* ptr = next_fragment_pointer(fragment_index);
+        return *ptr;
+    }
+
+    void set_next_missing_fragment(
+            uint32_t fragment_index,
+            uint32_t next_fragment_index)
+    {
+        uint32_t* ptr = next_fragment_pointer(fragment_index);
+        *ptr = next_fragment_index;
+    }
+
+    uint32_t* next_fragment_pointer(
+            uint32_t fragment_index)
+    {
+        size_t offset = fragment_size_;
+        offset *= fragment_index;
+        offset = (offset + 3) & ~3;
+        return reinterpret_cast<uint32_t*>(&serializedPayload.data[offset]);
+    }
+
+    /*!
+     * Mark a set of consecutive fragments as received.
+     * This will remove a set of consecutive fragments from the missing list.
+     * Should be called BEFORE copying the received data into the serialized payload.
+     *
+     * @param initial_fragment Index (0-based) of first received fragment.
+     * @param num_of_fragments Number of received fragments. Should be strictly positive.
+     * @return true if the list of missing fragments was modified, false otherwise.
+     */
+    bool received_fragments(
+            uint32_t initial_fragment,
+            uint32_t num_of_fragments)
+    {
+        bool at_least_one_changed = false;
+
+        if ( (fragment_size_ > 0) && (initial_fragment < fragment_count_) )
+        {
+            uint32_t last_fragment = initial_fragment + num_of_fragments;
+            if (last_fragment > fragment_count_)
+            {
+                last_fragment = fragment_count_;
+            }
+
+            if (initial_fragment <= first_missing_fragment_)
+            {
+                // Perform first = *first until first >= last_received
+                while (first_missing_fragment_ < last_fragment)
+                {
+                    first_missing_fragment_ = get_next_missing_fragment(first_missing_fragment_);
+                    at_least_one_changed = true;
+                }
+            }
+            else
+            {
+                // Find prev in missing list
+                uint32_t current_frag = first_missing_fragment_;
+                while (current_frag < initial_fragment)
+                {
+                    uint32_t next_frag = get_next_missing_fragment(current_frag);
+                    if (next_frag >= initial_fragment)
+                    {
+                        // This is the fragment previous to initial_fragment.
+                        // Find future value for next by repeating next = *next until next >= last_fragment.
+                        uint32_t next_missing_fragment = next_frag;
+                        while (next_missing_fragment < last_fragment)
+                        {
+                            next_missing_fragment = get_next_missing_fragment(next_missing_fragment);
+                            at_least_one_changed = true;
+                        }
+
+                        // Update next and finish loop
+                        if (at_least_one_changed)
+                        {
+                            set_next_missing_fragment(current_frag, next_missing_fragment);
+                        }
+                        break;
+                    }
+                    current_frag = next_frag;
+                }
+            }
+        }
+
+        return at_least_one_changed;
+    }
+
+};
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ * Enum ChangeForReaderStatus_t, possible states for a CacheChange_t in a ReaderProxy.
+ *  @ingroup COMMON_MODULE
+ */
+enum ChangeForReaderStatus_t
+{
+    UNSENT = 0,                    //!< UNSENT
+    REQUESTED = 1,                 //!< REQUESTED
+    UNACKNOWLEDGED = 2,            //!< UNACKNOWLEDGED
+    ACKNOWLEDGED = 3,              //!< ACKNOWLEDGED
+    UNDERWAY = 4                   //!< UNDERWAY
+};
+
+/**
+ * Struct ChangeForReader_t used to represent the state of a specific change with respect to a specific reader, as well as its relevance.
+ *  @ingroup COMMON_MODULE
+ */
+class ChangeForReader_t
+{
+    friend struct ChangeForReaderCmp;
+
+public:
+
+    ChangeForReader_t()
+        : status_(UNSENT)
+        , is_relevant_(true)
+        , change_(nullptr)
+    {
+    }
+
+    ChangeForReader_t(
+            const ChangeForReader_t& ch)
+        : status_(ch.status_)
+        , is_relevant_(ch.is_relevant_)
+        , seq_num_(ch.seq_num_)
+        , change_(ch.change_)
+        , unsent_fragments_(ch.unsent_fragments_)
+    {
+    }
+
+    //TODO(Ricardo) Temporal
+    //ChangeForReader_t(const CacheChange_t* change) : status_(UNSENT),
+    ChangeForReader_t(
+            CacheChange_t* change)
+        : status_(UNSENT)
+        , is_relevant_(true)
+        , seq_num_(change->sequenceNumber)
+        , change_(change)
+    {
+        if (change->getFragmentSize() != 0)
+        {
+            unsent_fragments_.base(1u);
+            unsent_fragments_.add_range(1u, change->getFragmentCount() + 1u);
+        }
+    }
+
+    ChangeForReader_t(
+            const SequenceNumber_t& seq_num)
+        : status_(UNSENT)
+        , is_relevant_(true)
+        , seq_num_(seq_num)
+        , change_(nullptr)
+    {
+    }
+
+    ~ChangeForReader_t()
+    {
+    }
+
+    ChangeForReader_t& operator =(
+            const ChangeForReader_t& ch)
+    {
+        status_ = ch.status_;
+        is_relevant_ = ch.is_relevant_;
+        seq_num_ = ch.seq_num_;
+        change_ = ch.change_;
+        unsent_fragments_ = ch.unsent_fragments_;
+        return *this;
+    }
+
+    /**
+     * Get the cache change
+     * @return Cache change
+     */
+    // TODO(Ricardo) Temporal
+    //const CacheChange_t* getChange() const
+    CacheChange_t* getChange() const
+    {
+        return change_;
+    }
+
+    void setStatus(
+            const ChangeForReaderStatus_t status)
+    {
+        status_ = status;
+    }
+
+    ChangeForReaderStatus_t getStatus() const
+    {
+        return status_;
+    }
+
+    void setRelevance(
+            const bool relevance)
+    {
+        is_relevant_ = relevance;
+    }
+
+    bool isRelevant() const
+    {
+        return is_relevant_;
+    }
+
+    const SequenceNumber_t getSequenceNumber() const
+    {
+        return seq_num_;
+    }
+
+    //! Set change as not valid
+    void notValid()
+    {
+        is_relevant_ = false;
+        change_ = nullptr;
+    }
+
+    //! Set change as valid
+    bool isValid() const
+    {
+        return change_ != nullptr;
+    }
+
+    FragmentNumberSet_t getUnsentFragments() const
+    {
+        return unsent_fragments_;
+    }
+
+    void markAllFragmentsAsUnsent()
+    {
+        if (change_ != nullptr && change_->getFragmentSize() != 0)
+        {
+            unsent_fragments_.base(1u);
+            unsent_fragments_.add_range(1u, change_->getFragmentCount() + 1u);
+        }
+    }
+
+    void markFragmentsAsSent(
+            const FragmentNumber_t& sentFragment)
+    {
+        unsent_fragments_.remove(sentFragment);
+
+        if (!unsent_fragments_.empty() && unsent_fragments_.max() < change_->getFragmentCount())
+        {
+            FragmentNumber_t base = unsent_fragments_.base();
+            FragmentNumber_t max = unsent_fragments_.max();
+            assert(!unsent_fragments_.is_set(base));
+
+            // Update base to first bit set
+            base = unsent_fragments_.min();
+            unsent_fragments_.base_update(base);
+
+            // Add all possible fragments
+            unsent_fragments_.add_range(max + 1u, change_->getFragmentCount() + 1u);
+        }
+    }
+
+    void markFragmentsAsUnsent(
+            const FragmentNumberSet_t& unsentFragments)
+    {
+        FragmentNumber_t other_base = unsentFragments.base();
+        if (other_base < unsent_fragments_.base())
+        {
+            unsent_fragments_.base_update(other_base);
+        }
+        unsentFragments.for_each(
+            [this](
+                    FragmentNumber_t element)
+            {
+                unsent_fragments_.add(element);
+            });
+    }
+
+private:
+
+    //!Status
+    ChangeForReaderStatus_t status_;
+
+    //!Boolean specifying if this change is relevant
+    bool is_relevant_;
+
+    //!Sequence number
+    SequenceNumber_t seq_num_;
+
+    // TODO(Ricardo) Temporal
+    //const CacheChange_t* change_;
+    CacheChange_t* change_;
+
+    FragmentNumberSet_t unsent_fragments_;
+};
+
+struct ChangeForReaderCmp
+{
+    bool operator ()(
+            const ChangeForReader_t& a,
+            const ChangeForReader_t& b) const
+    {
+        return a.seq_num_ < b.seq_num_;
+    }
+
+};
+
+#endif
+}
+}
+}
+#endif /* _FASTDDS_RTPS_CACHECHANGE_H_ */

+ 340 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/EntityId_t.hpp

@@ -0,0 +1,340 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file EntityId_t.hpp
+ */
+
+#ifndef _FASTDDS_RTPS_COMMON_ENTITYID_T_HPP_
+#define _FASTDDS_RTPS_COMMON_ENTITYID_T_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/rtps/common/Types.h>
+
+#include <cstdint>
+#include <cstring>
+#include <sstream>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+
+#define ENTITYID_UNKNOWN 0x00000000
+#define ENTITYID_RTPSParticipant  0x000001c1
+#define ENTITYID_SEDP_BUILTIN_TOPIC_WRITER  0x000002c2
+#define ENTITYID_SEDP_BUILTIN_TOPIC_READER 0x000002c7
+#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER  0x000003c2
+#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER  0x000003c7
+#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER 0x000004c2
+#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER  0x000004c7
+#define ENTITYID_SPDP_BUILTIN_RTPSParticipant_WRITER  0x000100c2
+#define ENTITYID_SPDP_BUILTIN_RTPSParticipant_READER  0x000100c7
+#define ENTITYID_P2P_BUILTIN_RTPSParticipant_MESSAGE_WRITER  0x000200C2
+#define ENTITYID_P2P_BUILTIN_RTPSParticipant_MESSAGE_READER  0x000200C7
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER  0x000201C3
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER  0x000201C4
+
+#define ENTITYID_TL_SVC_REQ_WRITER  0x000300C3
+#define ENTITYID_TL_SVC_REQ_READER  0x000300C4
+#define ENTITYID_TL_SVC_REPLY_WRITER  0x000301C3
+#define ENTITYID_TL_SVC_REPLY_READER  0x000301C4
+
+#if HAVE_SECURITY
+#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER  0xff0003c2
+#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER  0xff0003c7
+#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER 0xff0004c2
+#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER  0xff0004c7
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER 0xff0200c2
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER 0xff0200c7
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER  0xff0202C3
+#define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER  0xff0202C4
+#define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER 0xff0101c2
+#define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER 0xff0101c7
+#endif
+
+//!@brief Structure EntityId_t, entity id part of GUID_t.
+//!@ingroup COMMON_MODULE
+struct RTPS_DllAPI EntityId_t
+{
+    static constexpr unsigned int size = 4;
+    octet value[size];
+    //! Default constructor. Uknown entity.
+    EntityId_t(){
+        *this = ENTITYID_UNKNOWN;
+    }
+    /**
+     * Main constructor.
+     * @param id Entity id
+     */
+    EntityId_t(
+            uint32_t id)
+    {
+        memcpy(value, &id, size);
+#if !__BIG_ENDIAN__
+        reverse();
+#endif
+    }
+
+    /*!
+     * @brief Copy constructor
+     */
+    EntityId_t(
+            const EntityId_t& id)
+    {
+        memcpy(value, id.value, size);
+    }
+
+    /*!
+     * @brief Move constructor
+     */
+    EntityId_t(
+            EntityId_t&& id)
+    {
+        memmove(value, id.value, size);
+    }
+
+    EntityId_t& operator =(
+            const EntityId_t& id)
+    {
+        memcpy(value, id.value, size);
+        return *this;
+    }
+
+    EntityId_t& operator =(
+            EntityId_t&& id)
+    {
+        memmove(value, id.value, size);
+        return *this;
+    }
+
+    /**
+     * Assignment operator.
+     * @param id Entity id to copy
+     */
+    EntityId_t& operator =(
+            uint32_t id)
+    {
+        memcpy(value, &id, size);
+#if !__BIG_ENDIAN__
+        reverse();
+#endif
+        return *this;
+        //return id;
+    }
+#if !__BIG_ENDIAN__
+    //!
+    void reverse(){
+        octet oaux;
+        oaux = value[3];
+        value[3] = value[0];
+        value[0] = oaux;
+        oaux = value[2];
+        value[2] = value[1];
+        value[1] = oaux;
+    }
+#endif
+
+    static EntityId_t unknown()
+    {
+        return EntityId_t();
+    }
+};
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ * Guid prefix comparison operator
+ * @param id1 EntityId to compare
+ * @param id2 ID prefix to compare
+ * @return True if equal
+ */
+inline bool operator ==(
+        EntityId_t& id1,
+        const uint32_t id2)
+{
+#if !__BIG_ENDIAN__
+    id1.reverse();
+#endif
+    const bool result = 0 == memcmp(id1.value, &id2, sizeof(id2));
+#if !__BIG_ENDIAN__
+    id1.reverse();
+#endif
+    return result;
+}
+/**
+ * Guid prefix comparison operator
+ * @param id1 First EntityId to compare
+ * @param id2 Second EntityId to compare
+ * @return True if equal
+ */
+inline bool operator ==(
+        const EntityId_t& id1,
+        const EntityId_t& id2)
+{
+    for (uint8_t i = 0; i < 4; ++i)
+    {
+        if (id1.value[i] != id2.value[i])
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
+/**
+ * Guid prefix comparison operator
+ * @param id1 First EntityId to compare
+ * @param id2 Second EntityId to compare
+ * @return True if not equal
+ */
+inline bool operator !=(
+        const EntityId_t& id1,
+        const EntityId_t& id2)
+{
+    for (uint8_t i = 0; i < 4; ++i)
+    {
+        if (id1.value[i] != id2.value[i])
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
+#endif
+
+inline std::ostream& operator <<(
+        std::ostream& output,
+        const EntityId_t& enI)
+{
+    output << std::hex;
+    output << (int)enI.value[0] << "." << (int)enI.value[1] << "." << (int)enI.value[2] << "." << (int)enI.value[3];
+    return output << std::dec;
+}
+
+inline std::istream& operator >>(
+        std::istream& input,
+        EntityId_t& enP)
+{
+    std::istream::sentry s(input);
+
+    if (s)
+    {
+        char point;
+        unsigned short hex;
+        std::ios_base::iostate excp_mask = input.exceptions();
+
+        try
+        {
+            input.exceptions(excp_mask | std::ios_base::failbit | std::ios_base::badbit);
+            input >> std::hex >> hex;
+
+            if (hex > 255)
+            {
+                input.setstate(std::ios_base::failbit);
+            }
+
+            enP.value[0] = static_cast<octet>(hex);
+
+            for (int i = 1; i < 4; ++i)
+            {
+                input >> point >> hex;
+                if ( point != '.' || hex > 255 )
+                {
+                    input.setstate(std::ios_base::failbit);
+                }
+                enP.value[i] = static_cast<octet>(hex);
+            }
+
+            input >> std::dec;
+        }
+        catch (std::ios_base::failure& ){}
+
+        input.exceptions(excp_mask);
+    }
+
+    return input;
+}
+
+const EntityId_t c_EntityId_Unknown = ENTITYID_UNKNOWN;
+const EntityId_t c_EntityId_SPDPReader = ENTITYID_SPDP_BUILTIN_RTPSParticipant_READER;
+const EntityId_t c_EntityId_SPDPWriter = ENTITYID_SPDP_BUILTIN_RTPSParticipant_WRITER;
+
+const EntityId_t c_EntityId_SEDPPubWriter = ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER;
+const EntityId_t c_EntityId_SEDPPubReader = ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER;
+const EntityId_t c_EntityId_SEDPSubWriter = ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER;
+const EntityId_t c_EntityId_SEDPSubReader = ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER;
+
+const EntityId_t c_EntityId_RTPSParticipant = ENTITYID_RTPSParticipant;
+
+const EntityId_t c_EntityId_WriterLiveliness = ENTITYID_P2P_BUILTIN_RTPSParticipant_MESSAGE_WRITER;
+const EntityId_t c_EntityId_ReaderLiveliness = ENTITYID_P2P_BUILTIN_RTPSParticipant_MESSAGE_READER;
+
+const EntityId_t participant_stateless_message_writer_entity_id = ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER;
+const EntityId_t participant_stateless_message_reader_entity_id = ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER;
+
+const EntityId_t c_EntityId_TypeLookup_request_writer = ENTITYID_TL_SVC_REQ_WRITER;
+const EntityId_t c_EntityId_TypeLookup_request_reader = ENTITYID_TL_SVC_REQ_READER;
+const EntityId_t c_EntityId_TypeLookup_reply_writer = ENTITYID_TL_SVC_REPLY_WRITER;
+const EntityId_t c_EntityId_TypeLookup_reply_reader = ENTITYID_TL_SVC_REPLY_READER;
+
+#if HAVE_SECURITY
+const EntityId_t sedp_builtin_publications_secure_writer = ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER;
+const EntityId_t sedp_builtin_publications_secure_reader = ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER;
+const EntityId_t sedp_builtin_subscriptions_secure_writer = ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER;
+const EntityId_t sedp_builtin_subscriptions_secure_reader = ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER;
+
+const EntityId_t participant_volatile_message_secure_writer_entity_id =
+        ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER;
+const EntityId_t participant_volatile_message_secure_reader_entity_id =
+        ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER;
+
+const EntityId_t c_EntityId_WriterLivelinessSecure = ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER;
+const EntityId_t c_EntityId_ReaderLivelinessSecure = ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER;
+#endif
+
+} // namespace rtps
+} // namespace fastrtps
+} // namespace eprosima
+
+namespace std {
+template <>
+struct hash<eprosima::fastrtps::rtps::EntityId_t>
+{
+    std::size_t operator()(
+            const eprosima::fastrtps::rtps::EntityId_t& k) const
+    {
+        // recover the participant entity counter
+        eprosima::fastrtps::rtps::octet value[4];
+
+#if __BIG_ENDIAN__
+        value[3] = k.value[2];
+        value[2] = k.value[1];
+        value[1] = k.value[0];
+        value[0] = 0;
+#else
+        value[3] = 0;
+        value[2] = k.value[0];
+        value[1] = k.value[1];
+        value[0] = k.value[2];
+#endif
+        return static_cast<std::size_t>(*reinterpret_cast<const uint32_t*>(&value));
+    }
+};
+
+} // namespace std
+
+
+#endif /* _FASTDDS_RTPS_COMMON_ENTITYID_T_HPP_ */

+ 55 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/FragmentNumber.h

@@ -0,0 +1,55 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file FragmentNumber.h
+ */
+
+#ifndef _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_
+#define _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastrtps/utils/fixed_size_bitmap.hpp>
+#include <fastdds/rtps/common/Types.h>
+
+#include <set>
+#include <cmath>
+#include <algorithm>
+
+namespace eprosima{
+namespace fastrtps{
+namespace rtps{
+
+using FragmentNumber_t = uint32_t;
+
+//!Structure FragmentNumberSet_t, contains a group of fragmentnumbers.
+//!@ingroup COMMON_MODULE
+using FragmentNumberSet_t = BitmapRange<FragmentNumber_t>;
+
+inline std::ostream& operator<<(std::ostream& output, const FragmentNumberSet_t& fns)
+{
+    output << fns.base() << ":";
+    fns.for_each([&](FragmentNumber_t it)
+    {
+        output << it << "-";
+    });
+
+    return output;
+}
+
+}
+}
+}
+
+#endif /* _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_ */

+ 264 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/Guid.h

@@ -0,0 +1,264 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Guid.h
+ */
+
+#ifndef _FASTDDS_RTPS_RTPS_GUID_H_
+#define _FASTDDS_RTPS_RTPS_GUID_H_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/GuidPrefix_t.hpp>
+#include <fastdds/rtps/common/EntityId_t.hpp>
+
+#include <cstdint>
+#include <cstring>
+#include <sstream>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+struct InstanceHandle_t;
+
+//!@brief Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
+//!@ingroup COMMON_MODULE
+struct RTPS_DllAPI GUID_t
+{
+    //!Guid prefix
+    GuidPrefix_t guidPrefix;
+    //!Entity id
+    EntityId_t entityId;
+
+    /*!
+     * Default constructor. Contructs an unknown GUID.
+     */
+    GUID_t() noexcept
+    {
+    }
+
+    /**
+     * Construct
+     * @param guid_prefix Guid prefix
+     * @param id Entity id
+     */
+    GUID_t(
+            const GuidPrefix_t& guid_prefix,
+            uint32_t id) noexcept
+        : guidPrefix(guid_prefix)
+        , entityId(id)
+    {
+    }
+
+    /**
+     * @param guid_prefix Guid prefix
+     * @param entity_id Entity id
+     */
+    GUID_t(
+            const GuidPrefix_t& guid_prefix,
+            const EntityId_t& entity_id) noexcept
+        : guidPrefix(guid_prefix)
+        , entityId(entity_id)
+    {
+    }
+
+    /**
+     * Checks whether this guid is for an entity on the same host as another guid.
+     *
+     * @param other_guid GUID_t to compare to.
+     *
+     * @return true when this guid is on the same host, false otherwise.
+     */
+    bool is_on_same_host_as(
+            const GUID_t& other_guid) const
+    {
+        return memcmp(guidPrefix.value, other_guid.guidPrefix.value, 4) == 0;
+    }
+
+    /**
+     * Checks whether this guid is for an entity on the same host and process as another guid.
+     *
+     * @param other_guid GUID_t to compare to.
+     *
+     * @return true when this guid is on the same host and process, false otherwise.
+     */
+    bool is_on_same_process_as(
+            const GUID_t& other_guid) const
+    {
+        return memcmp(guidPrefix.value, other_guid.guidPrefix.value, 8) == 0;
+    }
+
+    /**
+     * Checks whether this guid corresponds to a builtin entity.
+     *
+     * @return true when this guid corresponds to a builtin entity, false otherwise.
+     */
+    bool is_builtin() const
+    {
+        return entityId.value[3] >= 0xC0;
+    }
+
+    static GUID_t unknown() noexcept
+    {
+        return GUID_t();
+    };
+
+    // TODO Review this conversion once InstanceHandle_t is implemented as DDS standard defines
+    explicit operator const InstanceHandle_t&() const
+    {
+        return *reinterpret_cast<const InstanceHandle_t*>(this);
+    }
+};
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ * GUID comparison operator
+ * @param g1 First GUID to compare
+ * @param g2 Second GUID to compare
+ * @return True if equal
+ */
+inline bool operator ==(
+        const GUID_t& g1,
+        const GUID_t& g2)
+{
+    if (g1.guidPrefix == g2.guidPrefix && g1.entityId == g2.entityId)
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+/**
+ * GUID comparison operator
+ * @param g1 First GUID to compare
+ * @param g2 Second GUID to compare
+ * @return True if not equal
+ */
+inline bool operator !=(
+        const GUID_t& g1,
+        const GUID_t& g2)
+{
+    if (g1.guidPrefix != g2.guidPrefix || g1.entityId != g2.entityId)
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+inline bool operator <(
+        const GUID_t& g1,
+        const GUID_t& g2)
+{
+    for (uint8_t i = 0; i < 12; ++i)
+    {
+        if (g1.guidPrefix.value[i] < g2.guidPrefix.value[i])
+        {
+            return true;
+        }
+        else if (g1.guidPrefix.value[i] > g2.guidPrefix.value[i])
+        {
+            return false;
+        }
+    }
+    for (uint8_t i = 0; i < 4; ++i)
+    {
+        if (g1.entityId.value[i] < g2.entityId.value[i])
+        {
+            return true;
+        }
+        else if (g1.entityId.value[i] > g2.entityId.value[i])
+        {
+            return false;
+        }
+    }
+    return false;
+}
+#endif
+
+const GUID_t c_Guid_Unknown;
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ * Stream operator, prints a GUID.
+ * @param output Output stream.
+ * @param guid GUID_t to print.
+ * @return Stream operator.
+ */
+inline std::ostream& operator <<(
+        std::ostream& output,
+        const GUID_t& guid)
+{
+    if (guid !=c_Guid_Unknown)
+    {
+        output << guid.guidPrefix << "|" << guid.entityId;
+    }
+    else
+    {
+        output << "|GUID UNKNOWN|";
+    }
+    return output;
+}
+
+/**
+ * Stream operator, retrieves a GUID.
+ * @param input Input stream.
+ * @param guid GUID_t to print.
+ * @return Stream operator.
+ */
+inline std::istream& operator >>(
+        std::istream& input,
+        GUID_t& guid)
+{
+    std::istream::sentry s(input);
+
+    if (s)
+    {
+        std::ios_base::iostate excp_mask = input.exceptions();
+
+        try
+        {
+            input.exceptions(excp_mask | std::ios_base::failbit | std::ios_base::badbit);
+
+            input >> guid.guidPrefix;
+            input >> guid.entityId;
+        }
+        catch (std::ios_base::failure&)
+        {
+            // maybe is unknown or just invalid
+            guid = c_Guid_Unknown;
+        }
+
+        input.exceptions(excp_mask);
+    }
+
+    return input;
+}
+
+#endif
+
+} // namespace rtps
+} // namespace fastrtps
+} // namespace eprosima
+
+#endif /* _FASTDDS_RTPS_RTPS_GUID_H_ */

+ 142 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/GuidPrefix_t.hpp

@@ -0,0 +1,142 @@
+// Copyright 2016-2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file GuidPrefix_t.hpp
+ */
+
+#ifndef _FASTDDS_RTPS_COMMON_GUIDPREFIX_T_HPP_
+#define _FASTDDS_RTPS_COMMON_GUIDPREFIX_T_HPP_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/rtps/common/Types.h>
+
+#include <cstdint>
+#include <cstring>
+#include <sstream>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+//!@brief Structure GuidPrefix_t, Guid Prefix of GUID_t.
+//!@ingroup COMMON_MODULE
+struct RTPS_DllAPI GuidPrefix_t
+{
+    static constexpr unsigned int size = 12;
+    octet value[size];
+
+    //!Default constructor. Set the Guid prefix to 0.
+    GuidPrefix_t()
+    {
+        memset(value, 0, size);
+    }
+
+    static GuidPrefix_t unknown()
+    {
+        return GuidPrefix_t();
+    }
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+    /**
+     * Guid prefix comparison operator
+     * @param prefix guid prefix to compare
+     * @return True if the guid prefixes are equal
+     */
+    bool operator==(
+            const GuidPrefix_t& prefix) const
+    {
+        return (memcmp(value, prefix.value, size) == 0);
+    }
+
+    /**
+     * Guid prefix comparison operator
+     * @param prefix Second guid prefix to compare
+     * @return True if the guid prefixes are not equal
+     */
+    bool operator!=(
+            const GuidPrefix_t& prefix) const
+    {
+        return (memcmp(value, prefix.value, size) != 0);
+    }
+
+#endif
+};
+
+const GuidPrefix_t c_GuidPrefix_Unknown;
+
+
+inline std::ostream& operator <<(
+        std::ostream& output,
+        const GuidPrefix_t& guiP)
+{
+    output << std::hex;
+    for (uint8_t i = 0; i < 11; ++i)
+    {
+        output << (int)guiP.value[i] << ".";
+    }
+    output << (int)guiP.value[11];
+    return output << std::dec;
+}
+
+inline std::istream& operator >>(
+        std::istream& input,
+        GuidPrefix_t& guiP)
+{
+    std::istream::sentry s(input);
+
+    if (s)
+    {
+        char point;
+        unsigned short hex;
+        std::ios_base::iostate excp_mask = input.exceptions();
+
+        try
+        {
+            input.exceptions(excp_mask | std::ios_base::failbit | std::ios_base::badbit);
+            input >> std::hex >> hex;
+
+            if (hex > 255)
+            {
+                input.setstate(std::ios_base::failbit);
+            }
+
+            guiP.value[0] = static_cast<octet>(hex);
+
+            for (int i = 1; i < 12; ++i)
+            {
+                input >> point >> hex;
+                if ( point != '.' || hex > 255 )
+                {
+                    input.setstate(std::ios_base::failbit);
+                }
+                guiP.value[i] = static_cast<octet>(hex);
+            }
+
+            input >> std::dec;
+        }
+        catch (std::ios_base::failure& ){}
+
+        input.exceptions(excp_mask);
+    }
+
+    return input;
+}
+
+} // namespace rtps
+} // namespace fastrtps
+} // namespace eprosima
+
+#endif /* _FASTDDS_RTPS_COMMON_GUIDPREFIX_T_HPP_ */

+ 243 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/InstanceHandle.h

@@ -0,0 +1,243 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file InstanceHandle.h
+ */
+
+#ifndef _FASTDDS_RTPS_INSTANCEHANDLE_H_
+#define _FASTDDS_RTPS_INSTANCEHANDLE_H_
+
+#include <fastrtps/fastrtps_dll.h>
+#include <fastdds/rtps/common/Types.h>
+#include <fastdds/rtps/common/Guid.h>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+/**
+ * Struct InstanceHandle_t, used to contain the key for WITH_KEY topics.
+ * @ingroup COMMON_MODULE
+ */
+struct RTPS_DllAPI InstanceHandle_t
+{
+    //!Value
+    octet value[16];
+    InstanceHandle_t()
+    {
+        for (uint8_t i = 0; i < 16; i++)
+        {
+            value[i] = 0;
+        }
+    }
+
+    InstanceHandle_t(
+            const InstanceHandle_t& ihandle)
+    {
+        for (uint8_t i = 0; i < 16; i++)
+        {
+            value[i] = ihandle.value[i];
+        }
+    }
+
+    InstanceHandle_t(
+            const GUID_t& guid)
+    {
+        for (uint8_t i = 0; i < 16; ++i)
+        {
+            if (i < 12)
+            {
+                value[i] = guid.guidPrefix.value[i];
+            }
+            else
+            {
+                value[i] = guid.entityId.value[i - 12];
+            }
+        }
+    }
+
+    /**
+     * Assingment operator
+     * @param ihandle Instance handle to copy the data from
+     */
+    InstanceHandle_t& operator =(
+            const InstanceHandle_t& ihandle)
+    {
+
+        for (uint8_t i = 0; i < 16; i++)
+        {
+            value[i] = ihandle.value[i];
+        }
+        return *this;
+    }
+
+    /**
+     * Assingment operator
+     * @param guid GUID to copy the data from
+     */
+    InstanceHandle_t& operator =(
+            const GUID_t& guid)
+    {
+        for (uint8_t i = 0; i < 16; i++)
+        {
+            if (i < 12)
+            {
+                value[i] = guid.guidPrefix.value[i];
+            }
+            else
+            {
+                value[i] = guid.entityId.value[i - 12];
+            }
+        }
+        return *this;
+    }
+
+    /**
+     * Know if the instance handle is defined
+     * @return True if the values are not zero.
+     */
+    bool isDefined() const
+    {
+        for (uint8_t i = 0; i < 16; ++i)
+        {
+            if (value[i] != 0)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    // TODO Review this conversion once InstanceHandle_t is implemented as DDS standard defines
+    explicit operator const GUID_t&() const
+    {
+        return *reinterpret_cast<const GUID_t*>(this);
+    }
+
+};
+
+const InstanceHandle_t c_InstanceHandle_Unknown;
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ * Comparison operator
+ * @param ihandle1 First InstanceHandle_t to compare
+ * @param ihandle2 Second InstanceHandle_t to compare
+ * @return True if equal
+ */
+inline bool operator ==(
+        const InstanceHandle_t& ihandle1,
+        const InstanceHandle_t& ihandle2)
+{
+    for (uint8_t i = 0; i < 16; ++i)
+    {
+        if (ihandle1.value[i] != ihandle2.value[i])
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
+inline bool operator !=(
+        const InstanceHandle_t& ihandle1,
+        const InstanceHandle_t& ihandle2)
+{
+    return !(ihandle1 == ihandle2);
+}
+
+#endif
+
+/**
+ * Convert InstanceHandle_t to GUID
+ * @param guid GUID to store the results
+ * @param ihandle InstanceHandle_t to copy
+ */
+inline void iHandle2GUID(
+        GUID_t& guid,
+        const InstanceHandle_t& ihandle)
+{
+    for (uint8_t i = 0; i < 16; ++i)
+    {
+        if (i < 12)
+        {
+            guid.guidPrefix.value[i] = ihandle.value[i];
+        }
+        else
+        {
+            guid.entityId.value[i - 12] = ihandle.value[i];
+        }
+    }
+    return;
+}
+
+/**
+ * Convert GUID to InstanceHandle_t
+ * @param ihandle InstanceHandle_t to store the results
+ * @return GUID_t
+ */
+inline GUID_t iHandle2GUID(
+        const InstanceHandle_t& ihandle)
+{
+    GUID_t guid;
+    for (uint8_t i = 0; i < 16; ++i)
+    {
+        if (i < 12)
+        {
+            guid.guidPrefix.value[i] = ihandle.value[i];
+        }
+        else
+        {
+            guid.entityId.value[i - 12] = ihandle.value[i];
+        }
+    }
+    return guid;
+}
+
+inline bool operator <(
+        const InstanceHandle_t& h1,
+        const InstanceHandle_t& h2)
+{
+    return memcmp(h1.value, h2.value, 16) < 0;
+}
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
+
+/**
+ *
+ * @param output
+ * @param iHandle
+ */
+inline std::ostream& operator <<(
+        std::ostream& output,
+        const InstanceHandle_t& iHandle)
+{
+    output << std::hex;
+    for (uint8_t i = 0; i < 15; ++i)
+    {
+        output << (int)iHandle.value[i] << ".";
+    }
+    output << (int)iHandle.value[15] << std::dec;
+    return output;
+}
+
+#endif
+
+}
+}
+}
+
+#endif /* _FASTDDS_RTPS_INSTANCEHANDLE_H_ */

+ 465 - 0
thirdpartylib/FastRTPS/include/fastdds/rtps/common/Locator.h

@@ -0,0 +1,465 @@
+// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @file Locator.h
+ */
+
+#ifndef _FASTDDS_RTPS_ELEM_LOCATOR_H_
+#define _FASTDDS_RTPS_ELEM_LOCATOR_H_
+
+#include <fastrtps/fastrtps_dll.h>
+
+#include <fastdds/rtps/common/Types.h>
+
+#include <sstream>
+#include <vector>
+#include <cstdint>
+#include <cstring>
+#include <iomanip>
+#include <algorithm>
+
+namespace eprosima {
+namespace fastrtps {
+namespace rtps {
+
+#define LOCATOR_INVALID(loc)  {loc.kind=LOCATOR_KIND_INVALID;loc.port= LOCATOR_PORT_INVALID;LOCATOR_ADDRESS_INVALID(loc.address);}
+#define LOCATOR_KIND_INVALID -1
+
+#define LOCATOR_ADDRESS_INVALID(a) {std::memset(a,0x00,16*sizeof(octet));}
+#define LOCATOR_PORT_INVALID 0
+#define LOCATOR_KIND_RESERVED 0
+#define LOCATOR_KIND_UDPv4 1
+#define LOCATOR_KIND_UDPv6 2
+#define LOCATOR_KIND_TCPv4 4
+#define LOCATOR_KIND_TCPv6 8
+#define LOCATOR_KIND_SHM 16
+
+//!@brief Class Locator_t, uniquely identifies a communication channel for a particular transport.
+//For example, an address+port combination in the case of UDP.
+//!@ingroup COMMON_MODULE
+class RTPS_DllAPI Locator_t
+{
+public:
+
+    /*!
+        * @brief Specifies the locator type. Valid values are:
+        * LOCATOR_KIND_UDPv4
+        * LOCATOR_KIND_UDPv6
+        * LOCATOR_KIND_TCPv4
+        * LOCATOR_KIND_TCPv6
+        * LOCATOR_KIND_SHM
+        */
+    int32_t kind;
+    uint32_t port;
+    octet address[16];
+
+    //!Default constructor
+    Locator_t()
+        : kind(LOCATOR_KIND_UDPv4)
+    {
+        port = 0;
+        LOCATOR_ADDRESS_INVALID(address);
+    }
+
+    //!Move constructor
+    Locator_t(Locator_t&& loc)
+        : kind(loc.kind)
+    {
+        port = loc.port;
+        std::memcpy(address, loc.address, 16 * sizeof(octet));
+    }
+
+    //!Copy constructor
+    Locator_t(const Locator_t& loc)
+        : kind(loc.kind)
+    {
+        port = loc.port;
+        std::memcpy(address, loc.address, 16 * sizeof(octet));
+    }
+
+    //!Port constructor
+    Locator_t(uint32_t portin)
+        : kind(LOCATOR_KIND_UDPv4)
+    {
+        port = portin;
+        LOCATOR_ADDRESS_INVALID(address);
+    }
+
+    //!Kind and port constructor
+    Locator_t(
+            int32_t kindin,
+            uint32_t portin)
+        : kind(kindin)
+    {
+        port = portin;
+        LOCATOR_ADDRESS_INVALID(address);
+    }
+
+    Locator_t& operator=(const Locator_t& loc)
+    {
+        kind = loc.kind;
+        port = loc.port;
+        std::memcpy(address, loc.address, 16 * sizeof(octet));
+        return *this;
+    }
+
+    bool set_address(const Locator_t &other)
+    {
+        memcpy(address, other.address, sizeof(octet) * 16);
+        return true;
+    }
+
+    octet* get_address()
+    {
+        return address;
+    }
+
+    octet get_address(uint16_t field) const
+    {
+        return address[field];
+    }
+
+    void set_Invalid_Address()
+    {
+        LOCATOR_ADDRESS_INVALID(address);
+    }
+};
+
+
+inline bool IsAddressDefined(const Locator_t& loc)
+{
+    if (loc.kind == LOCATOR_KIND_UDPv4 || loc.kind == LOCATOR_KIND_TCPv4) // WAN addr in TCPv4 is optional, isn't?
+    {
+        for (uint8_t i = 12; i < 16; ++i)
+        {
+            if (loc.address[i] != 0)
+                return true;
+        }
+    }
+    else if (loc.kind == LOCATOR_KIND_UDPv6 || loc.kind == LOCATOR_KIND_TCPv6)
+    {
+        for (uint8_t i = 0; i < 16; ++i)
+        {
+            if (loc.address[i] != 0)
+                return true;
+        }
+    }
+    return false;
+}
+
+inline bool IsLocatorValid(const Locator_t&loc)
+{
+    return (0 <= loc.kind);
+}
+
+inline bool operator<(const Locator_t &loc1, const Locator_t &loc2)
+{
+    return memcmp(&loc1, &loc2, sizeof(Locator_t)) < 0;
+}
+
+inline bool operator==(const Locator_t&loc1, const Locator_t& loc2)
+{
+    if (loc1.kind != loc2.kind)
+        return false;
+    if (loc1.port != loc2.port)
+        return false;
+    if (!std::equal(loc1.address, loc1.address + 16, loc2.address))
+        return false;
+    return true;
+}
+
+inline bool operator!=(const Locator_t&loc1, const Locator_t& loc2)
+{
+    return !(loc1 == loc2);
+}
+
+inline std::ostream& operator<<(std::ostream& output, const Locator_t& loc)
+{
+    if (loc.kind == LOCATOR_KIND_UDPv4 || loc.kind == LOCATOR_KIND_TCPv4)
+    {
+        output << (int)loc.address[12] << "." << (int)loc.address[13]
+            << "." << (int)loc.address[14] << "." << (int)loc.address[15]
+            << ":" << loc.port;
+    }
+    else if (loc.kind == LOCATOR_KIND_UDPv6 || loc.kind == LOCATOR_KIND_TCPv6)
+    {
+        for (uint8_t i = 0; i < 16; ++i)
+        {
+            output << (int)loc.address[i];
+            if (i < 15)
+                output << ".";
+        }
+        output << ":" << loc.port;
+    }
+    else if (loc.kind == LOCATOR_KIND_SHM)
+    {
+        if (loc.address[0] == 'M')
+        {
+            output << "SHM:M" << loc.port;
+        }
+        else
+        {
+            output << "SHM:" << loc.port;
+        }
+    }
+
+    return output;
+}
+
+typedef std::vector<Locator_t>::iterator LocatorListIterator;
+typedef std::vector<Locator_t>::const_iterator LocatorListConstIterator;
+
+/**
+ * Provides a Locator's iterator interface that can be used by different Locator's
+ * containers
+ */
+class LocatorsIterator
+{
+public:
+
+    virtual LocatorsIterator& operator++() = 0;
+    virtual bool operator==(
+            const LocatorsIterator& other) const = 0;
+    virtual bool operator!=(
+            const LocatorsIterator& other) const = 0;
+    virtual const Locator_t& operator*() const = 0;
+};
+
+/**
+ * Adapter class that provides a LocatorsIterator interface from a LocatorListConstIterator
+ */
+class Locators : public LocatorsIterator
+{
+public:
+
+    Locators(
+            const LocatorListConstIterator& it)
+        : it_(it)
+    {
+    }
+
+	Locators(
+		const Locators& other)
+		: it_(other.it_)
+	{
+	}
+
+    LocatorsIterator& operator++()
+    {
+        ++it_;
+        return *this;
+    }
+
+    bool operator==(
+            const LocatorsIterator& other) const
+    {
+        return it_ == static_cast<const Locators&>(other).it_;
+    }
+
+    bool operator!=(
+            const LocatorsIterator& other) const
+    {
+        return it_ != static_cast<const Locators&>(other).it_;
+    }
+
+    const Locator_t& operator*() const
+    {
+        return (*it_);
+    }
+
+private:
+
+    LocatorListConstIterator it_;
+};
+
+
+/**
+    * Class LocatorList_t, a Locator_t vector that doesn't avoid duplicates.
+    * @ingroup COMMON_MODULE
+    */
+class LocatorList_t
+{
+public:
+    RTPS_DllAPI LocatorList_t() {};
+
+    RTPS_DllAPI ~LocatorList_t() {};
+
+    RTPS_DllAPI LocatorList_t(const LocatorList_t& list) : m_locators(list.m_locators) {}
+
+    RTPS_DllAPI LocatorList_t(LocatorList_t&& list) : m_locators(std::move(list.m_locators)) {}
+
+    RTPS_DllAPI LocatorList_t& operator=(const LocatorList_t& list)
+    {
+        m_locators = list.m_locators;
+        return *this;
+    }
+
+    RTPS_DllAPI LocatorList_t& operator=(LocatorList_t&& list)
+    {
+        m_locators = std::move(list.m_locators);
+        return *this;
+    }
+
+    RTPS_DllAPI bool operator==(const LocatorList_t& locator_list) const
+    {
+        if (locator_list.m_locators.size() == m_locators.size())
+        {
+            bool returnedValue = true;
+
+            for (auto it = locator_list.m_locators.begin(); returnedValue &&
+                it != locator_list.m_locators.end(); ++it)
+            {
+                returnedValue = false;
+
+                for (auto it2 = m_locators.begin(); !returnedValue && it2 != m_locators.end(); ++it2)
+                {
+                    if (*it == *it2)
+                        returnedValue = true;
+                }
+            }
+
+            return returnedValue;
+        }
+
+        return false;
+    }
+
+    RTPS_DllAPI LocatorListIterator begin() {
+        return m_locators.begin();
+    }
+
+    RTPS_DllAPI LocatorListIterator end() {
+        return m_locators.end();
+    }
+
+    RTPS_DllAPI LocatorListConstIterator begin() const {
+        return m_locators.begin();
+    }
+
+    RTPS_DllAPI LocatorListConstIterator end() const {
+        return m_locators.end();
+    }
+
+    RTPS_DllAPI size_t size() const {
+        return m_locators.size();
+    }
+
+    RTPS_DllAPI LocatorList_t& assign(const LocatorList_t& list)
+    {
+        if (!(*this == list))
+        {
+            m_locators = list.m_locators;
+        }
+        return *this;
+    }
+
+    RTPS_DllAPI void clear(){ return m_locators.clear(); }
+
+    RTPS_DllAPI void reserve(size_t num) { return m_locators.reserve(num); }
+
+    RTPS_DllAPI void resize(size_t num) { return m_locators.resize(num); }
+
+    RTPS_DllAPI void push_back(const Locator_t& loc)
+    {
+        bool already = false;
+        for (LocatorListIterator it = this->begin(); it != this->end(); ++it)
+        {
+            if (loc == *it)
+            {
+                already = true;
+                break;
+            }
+        }
+        if (!already)
+            m_locators.push_back(loc);
+    }
+
+    RTPS_DllAPI void push_back(const LocatorList_t& locList)
+    {
+        for (auto it = locList.m_locators.begin(); it != locList.m_locators.end(); ++it)
+        {
+            this->push_back(*it);
+        }
+    }
+
+    RTPS_DllAPI bool empty() const {
+        return m_locators.empty();
+    }
+
+    RTPS_DllAPI void erase(const Locator_t& loc)
+    {
+        auto it = std::find(m_locators.begin(), m_locators.end(), loc);
+        if (it != m_locators.end())
+        {
+            m_locators.erase(it);
+        }
+    }
+
+    RTPS_DllAPI bool contains(const Locator_t& loc)
+    {
+        for (LocatorListIterator it = this->begin(); it != this->end(); ++it)
+        {
+            if (IsAddressDefined(*it))
+            {
+                if (loc == *it)
+                    return true;
+            }
+            else
+            {
+                if (loc.kind == (*it).kind && loc.port == (*it).port)
+                    return true;
+            }
+        }
+
+        return false;
+    }
+
+    RTPS_DllAPI bool isValid() const
+    {
+        for (LocatorListConstIterator it = this->begin(); it != this->end(); ++it)
+        {
+            if (!IsLocatorValid(*it))
+                return false;
+        }
+        return true;
+    }
+
+
+    RTPS_DllAPI void swap(LocatorList_t& locatorList)
+    {
+        this->m_locators.swap(locatorList.m_locators);
+    }
+
+    friend std::ostream& operator <<(std::ostream& output, const LocatorList_t& loc);
+
+private:
+
+    std::vector<Locator_t> m_locators;
+};
+
+inline std::ostream& operator<<(std::ostream& output, const LocatorList_t& locList)
+{
+    for (auto it = locList.m_locators.begin(); it != locList.m_locators.end(); ++it)
+    {
+        output << *it << ",";
+    }
+    return output;
+}
+
+}
+}
+}
+
+#endif /* _FASTDDS_RTPS_ELEM_LOCATOR_H_ */

Some files were not shown because too many files changed in this diff