diff --git a/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt b/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt index b5834bf749e..ea93ded57f6 100644 --- a/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt +++ b/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt @@ -19,4 +19,5 @@ message(STATUS "Configuring fuzz_processCDRMsg...") file(GLOB SOURCES_CXX "fuzz_*.cxx") add_executable(fuzz_processCDRMsg ${SOURCES_CXX}) +target_include_directories(fuzz_processCDRMsg PRIVATE ${CMAKE_SOURCE_DIR}/src/cpp/rtps/messages) target_link_libraries(fuzz_processCDRMsg fastdds fastcdr foonathan_memory $ENV{LIB_FUZZING_ENGINE}) diff --git a/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx b/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx index ad5eb5e139d..cc1d1faa45c 100644 --- a/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx +++ b/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx @@ -5,7 +5,8 @@ #include #include -#include + +#include #define MIN_SIZE RTPSMESSAGE_HEADER_SIZE #define MAX_SIZE 64000 diff --git a/include/fastdds/dds/domain/DomainParticipant.hpp b/include/fastdds/dds/domain/DomainParticipant.hpp index 5cca4358a0b..3e8b5a00a67 100644 --- a/include/fastdds/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/dds/domain/DomainParticipant.hpp @@ -27,20 +27,21 @@ #include #include -#include #include +#include #include +#include +#include #include #include -#include #include #include -#include +#include #include #include #include -#include #include +#include using eprosima::fastrtps::types::ReturnCode_t; @@ -60,10 +61,6 @@ namespace types { class TypeInformation; } // namespace types -class ParticipantAttributes; -class PublisherAttributes; -class SubscriberAttributes; - } //namespace fastrtps namespace fastdds { @@ -668,6 +665,28 @@ class DomainParticipant : public Entity const std::string& profile_name, TopicQos& qos) const; + /** + * Fills the ReplierQos with the values of the XML profile. + * + * @param profile_name Replier profile name. + * @param qos ReplierQos object where the qos is returned. + * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t get_replier_qos_from_profile( + const std::string& profile_name, + ReplierQos& qos) const; + + /** + * Fills the RequesterQos with the values of the XML profile. + * + * @param profile_name Requester profile name. + * @param qos RequesterQos object where the qos is returned. + * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t get_requester_qos_from_profile( + const std::string& profile_name, + RequesterQos& qos) const; + /** * Retrieves the list of DomainParticipants that have been discovered in the domain and are not "ignored". * diff --git a/include/fastdds/dds/domain/qos/ReplierQos.hpp b/include/fastdds/dds/domain/qos/ReplierQos.hpp new file mode 100644 index 00000000000..3b992a202b3 --- /dev/null +++ b/include/fastdds/dds/domain/qos/ReplierQos.hpp @@ -0,0 +1,80 @@ +// Copyright 2024 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 ReplierQos.hpp + */ + +#ifndef _FASTDDS_REPLIERQOS_HPP_ +#define _FASTDDS_REPLIERQOS_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class ReplierQos +{ +public: + + /** + * @brief Constructor + */ + FASTDDS_EXPORTED_API ReplierQos() = default; + + /** + * @brief Equal comparison operator + */ + FASTDDS_EXPORTED_API bool operator ==( + const ReplierQos& b) const + { + return (this->service_name == b.service_name) && + (this->request_topic_name == b.request_topic_name) && + (this->reply_topic_name == b.reply_topic_name) && + (this->writer_qos == b.writer_qos) && + (this->reader_qos == b.reader_qos); + } + + //! Service name + std::string service_name; + + //! Request type + std::string request_type; + + //! Reply type + std::string reply_type; + + //! Request topic name + std::string request_topic_name; + + //! Reply topic name + std::string reply_topic_name; + + //! DataWriter QoS for the reply writer + DataWriterQos writer_qos; + + //! DataReader QoS for the reply reader + DataReaderQos reader_qos; +}; + +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_REPLIERQOS_HPP_ */ diff --git a/include/fastdds/dds/domain/qos/RequesterQos.hpp b/include/fastdds/dds/domain/qos/RequesterQos.hpp new file mode 100644 index 00000000000..fb31447c4bc --- /dev/null +++ b/include/fastdds/dds/domain/qos/RequesterQos.hpp @@ -0,0 +1,80 @@ +// Copyright 2024 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 RequesterQos.hpp + */ + +#ifndef _FASTDDS_REQUESTERQOS_HPP_ +#define _FASTDDS_REQUESTERQOS_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class RequesterQos +{ +public: + + /** + * @brief Constructor + */ + FASTDDS_EXPORTED_API RequesterQos() = default; + + /** + * @brief Equal comparison operator + */ + FASTDDS_EXPORTED_API bool operator ==( + const RequesterQos& b) const + { + return (this->service_name == b.service_name) && + (this->request_topic_name == b.request_topic_name) && + (this->reply_topic_name == b.reply_topic_name) && + (this->writer_qos == b.writer_qos) && + (this->reader_qos == b.reader_qos); + } + + //! Service name + std::string service_name; + + //! Request type + std::string request_type; + + //! Reply type + std::string reply_type; + + //! Request topic name + std::string request_topic_name; + + //! Reply topic name + std::string reply_topic_name; + + //! DataWriter QoS for the request writer + DataWriterQos writer_qos; + + //! DataReader QoS for the request reader + DataReaderQos reader_qos; +}; + +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_REQUESTERQOS_HPP_ */ diff --git a/include/fastdds/rtps/rtps_all.h b/include/fastdds/rtps/rtps_all.h deleted file mode 100644 index 1c16cf680eb..00000000000 --- a/include/fastdds/rtps/rtps_all.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 rtps_all.h - * - */ - -#ifndef _FASTDDS_RTPS_ALL_H_ -#define _FASTDDS_RTPS_ALL_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#endif /* _FASTDDS_RTPS_ALL_H_ */ diff --git a/include/fastrtps/Domain.h b/include/fastrtps/Domain.h deleted file mode 100644 index 27511afe8cd..00000000000 --- a/include/fastrtps/Domain.h +++ /dev/null @@ -1,251 +0,0 @@ -// 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 Domain.h - * - */ - -#ifndef DOMAIN_H_ -#define DOMAIN_H_ - -#include -#include -#include - -#ifdef USE_DEPRECATION -#if defined(__GNUC__) || defined(__clang__) -#define DEPRECATED __attribute__ ((deprecated)) -#elif defined(_MSC_VER) -#define DEPRECATED __declspec(deprecated) -#else -#define DEPRECATED /** --Deprecated-- */ -#endif // if defined(__GNUC__) || defined(__clang__) -#else -#define DEPRECATED -#endif // ifdef USE_DEPRECATION - -namespace eprosima { -namespace fastrtps { - -class ParticipantListener; -class Participant; -class ParticipantImpl; -class Publisher; -class PublisherAttributes; -class PublisherListener; -class Subscriber; -class SubscriberAttributes; -class SubscriberListener; - -namespace types { -class DynamicPubSubType; -} // namespace types - -/** - * Class Domain, use to interact with the Publisher Subscriber API of the Fast RTPS implementation. - * @ingroup FASTRTPS_MODULE - */ -class Domain -{ -public: - - /** - * Create a Participant from a profile name. - * @param participant_profile Participant profile name. - * @param listen ParticipantListener Pointer. - * @return Participant pointer. (nullptr if not created.) - */ - FASTDDS_EXPORTED_API DEPRECATED static Participant* createParticipant( - const std::string& participant_profile, - ParticipantListener* listen = nullptr); - - /** - * Create a Participant. - * @param att Participant Attributes. - * @param listen ParticipantListener Pointer. - * @return Participant pointer. (nullptr if not created.) - */ - FASTDDS_EXPORTED_API DEPRECATED static Participant* createParticipant( - const ParticipantAttributes& att, - ParticipantListener* listen = nullptr); - - //!Fills participant_attributes with the default values. - FASTDDS_EXPORTED_API static void getDefaultParticipantAttributes( - ParticipantAttributes& participant_attributes); - - /** - * Create a Publisher in a Participant from a profile name. - * @param part Pointer to the participant where you want to create the Publisher. - * @param publisher_profile Publisher profile name. - * @param listen Pointer to the PublisherListener. - * @return Pointer to the created Publisher (nullptr if not created). - */ - FASTDDS_EXPORTED_API static Publisher* createPublisher( - Participant* part, - const std::string& publisher_profile, - PublisherListener* listen = nullptr); - - /** - * Create a Publisher in a Participant. - * @param part Pointer to the participant where you want to create the Publisher. - * @param att PublisherAttributes. - * @param listen Pointer to the PublisherListener. - * @return Pointer to the created Publisher (nullptr if not created). - */ - FASTDDS_EXPORTED_API static Publisher* createPublisher( - Participant* part, - const PublisherAttributes& att, - PublisherListener* listen = nullptr); - - //!Fills publisher_attributes with the default values. - FASTDDS_EXPORTED_API static void getDefaultPublisherAttributes( - PublisherAttributes& publisher_attributes); - - /** - * Create a Subscriber in a Participant from a profile name. - * @param part Pointer to the participant where you want to create the Publisher. - * @param subscriber_profile Subscriber profile name. - * @param listen Pointer to the SubscriberListener. - * @return Pointer to the created Subscriber (nullptr if not created). - */ - FASTDDS_EXPORTED_API static Subscriber* createSubscriber( - Participant* part, - const std::string& subscriber_profile, - SubscriberListener* listen = nullptr); - - /** - * Create a Subscriber in a Participant. - * @param part Pointer to the participant where you want to create the Publisher. - * @param att SubscriberAttributes. - * @param listen Pointer to the SubscriberListener. - * @return Pointer to the created Subscriber (nullptr if not created). - */ - FASTDDS_EXPORTED_API static Subscriber* createSubscriber( - Participant* part, - const SubscriberAttributes& att, - SubscriberListener* listen = nullptr); - - //!Fills subscriber_attributes with the default values. - FASTDDS_EXPORTED_API static void getDefaultSubscriberAttributes( - SubscriberAttributes& subscriber_attributes); - - /** - * Remove a Participant and all associated publishers and subscribers. - * @param part Pointer to the participant. - * @return True if correctly removed. - */ - FASTDDS_EXPORTED_API static bool removeParticipant( - Participant* part); - - /** - * Remove a Publisher. - * @param pub Pointer to the Publisher. - * @return True if correctly removed. - */ - FASTDDS_EXPORTED_API static bool removePublisher( - Publisher* pub); - - /** - * Remove a Subscriber. - * @param sub Pointer to the Subscriber. - * @return True if correctly removed. - */ - FASTDDS_EXPORTED_API static bool removeSubscriber( - Subscriber* sub); - - /** - * Return a registered type. - * @param part Pointer to the Participant. - * @param typeName Name of the type. - * @param type Returned type. - * @return True if type was found. - */ - FASTDDS_EXPORTED_API static bool getRegisteredType( - Participant* part, - const char* typeName, - fastdds::dds::TopicDataType** type); - - /** - * Register a type in a participant. - * @param part Pointer to the Participant. - * @param type Pointer to the Type. - * @return True if correctly registered. - */ - FASTDDS_EXPORTED_API static bool registerType( - Participant* part, - fastdds::dds::TopicDataType* type); - - /** - * Register a type in a participant. - * @param part Pointer to the Participant. - * @param type Pointer to the Type. - * @return True if correctly registered. - */ - FASTDDS_EXPORTED_API static bool registerDynamicType( - Participant* part, - types::DynamicPubSubType* type); - - /** - * Unregister a type in a participant. - * @param part Pointer to the Participant. - * @param typeName Name of the type. - * @return True if correctly unregistered. - */ - FASTDDS_EXPORTED_API static bool unregisterType( - Participant* part, - const char* typeName); - - /** - * Stop and remove all participants, publishers and subscribers in this Domain. - */ - FASTDDS_EXPORTED_API static void stopAll(); - - /** - * Load profiles from XML file. - * @param xml_profile_file XML profile file. - * @return True if correctly loaded. - */ - FASTDDS_EXPORTED_API static bool loadXMLProfilesFile( - const std::string& xml_profile_file); - - /** - * Load profiles from XML string. - * @param data buffer containing XML data. - * @param length length of data. - * @return True if correctly loaded. - */ - FASTDDS_EXPORTED_API static bool loadXMLProfilesString( - const char* data, - size_t length); - -private: - - typedef std::pair t_p_Participant; - - Domain(); - - virtual ~Domain(); - - static std::mutex m_mutex; - - static std::vector m_participants; - - static bool default_xml_profiles_loaded; -}; - -} /* namespace */ -} /* namespace eprosima */ - -#endif /* DOMAIN_H_ */ diff --git a/include/fastrtps/attributes/all_attributes.h b/include/fastrtps/attributes/all_attributes.h deleted file mode 100644 index 4377f2eb3f6..00000000000 --- a/include/fastrtps/attributes/all_attributes.h +++ /dev/null @@ -1,29 +0,0 @@ -// 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 all_attributes.h - */ - -#ifndef ALL_ATTRIBUTES_H_ -#define ALL_ATTRIBUTES_H_ - -#include -#include -#include -#include -#include -#include - -#endif /* ALL_ATTRIBUTES_H_ */ diff --git a/include/fastrtps/fastrtps_all.h b/include/fastrtps/fastrtps_all.h deleted file mode 100644 index f40573d056b..00000000000 --- a/include/fastrtps/fastrtps_all.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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 rtps_all.h - * - */ - -#ifndef FASTRTPS_ALL_H_ -#define FASTRTPS_ALL_H_ - -//USER THIS HEADER TO CREATE RAPID PROTOTYPES AND TESTS -//DO NOT INCLUDE IN PROJETCTS WERE COMPILATION TIME OR SIZE IS REVELANT -//SINCE IT INCLUDES ALL NECESSARY HEADERS. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* FASTRTPS_ALL_H_ */ diff --git a/include/fastrtps/participant/Participant.h b/include/fastrtps/participant/Participant.h deleted file mode 100644 index d79557cf6f4..00000000000 --- a/include/fastrtps/participant/Participant.h +++ /dev/null @@ -1,105 +0,0 @@ -// 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 Participant.h - * - */ - -#ifndef PARTICIPANT_H_ -#define PARTICIPANT_H_ - -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { - -class ParticipantImpl; -class ParticipantAttributes; - -namespace rtps { -class WriterProxyData; -class ReaderProxyData; -class ResourceEvent; -class RTPSParticipant; -} // namespace rtps - -/** - * Class Participant used to group Publishers and Subscribers into a single working unit. - * @ingroup FASTRTPS_MODULE - */ -class FASTDDS_EXPORTED_API Participant -{ -public: - - /** - * Get the rtps::GUID_t of the associated RTPSParticipant. - * @return rtps::GUID_t - */ - const rtps::GUID_t& getGuid() const; - - /** - * Get the ParticipantAttributes. - * @return ParticipantAttributes. - */ - const ParticipantAttributes& getAttributes() const; - - /** - * Called when using a StaticEndpointDiscovery mechanism different that the one - * included in FastRTPS, for example when communicating with other implementations. - * It indicates to the Participant that an Endpoint from the XML has been discovered and - * should be activated. - * @param partguid Participant rtps::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. - */ - bool newRemoteEndpointDiscovered( - const rtps::GUID_t& partguid, - uint16_t userId, - rtps::EndpointKind_t kind); - - /** - * Returns a list with the participant names. - * @return list of participant names. - */ - std::vector getParticipantNames() const; - - /** - * @brief Asserts liveliness of manual by participant publishers - */ - void assert_liveliness(); - - rtps::ResourceEvent& get_resource_event() const; - -private: - - Participant(); - - virtual ~Participant(); - - ParticipantImpl* mp_impl; - - friend class Domain; - - friend class ParticipantImpl; -}; - -} // namespace fastrtps -} /* namespace eprosima */ - -#endif /* PARTICIPANT_H_ */ diff --git a/include/fastrtps/participant/ParticipantListener.h b/include/fastrtps/participant/ParticipantListener.h deleted file mode 100644 index cde1fec1602..00000000000 --- a/include/fastrtps/participant/ParticipantListener.h +++ /dev/null @@ -1,88 +0,0 @@ -// 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 ParticipantListener.h - * - */ - -#ifndef __PARTICIPANT_PARTICIPANTLISTENER_H__ -#define __PARTICIPANT_PARTICIPANTLISTENER_H__ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Participant; - -/** - * Class ParticipantListener, overrides behaviour towards certain events. - * @ingroup FASTRTPS_MODULE - */ -class ParticipantListener -{ - public: - - ParticipantListener() {} - - virtual ~ParticipantListener() {} - - /*! - * 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 onParticipantDiscovery(Participant* participant, rtps::ParticipantDiscoveryInfo&& info) - { - (void)participant, (void)info; - } - -#if HAVE_SECURITY - virtual void onParticipantAuthentication(Participant* participant, 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 onSubscriberDiscovery(Participant* participant, 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 onPublisherDiscovery(Participant* participant, rtps::WriterDiscoveryInfo&& info) - { - (void)participant, (void)info; - } -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif // __PARTICIPANT_PARTICIPANTLISTENER_H__ diff --git a/include/fastrtps/publisher/Publisher.h b/include/fastrtps/publisher/Publisher.h deleted file mode 100644 index 027e427920e..00000000000 --- a/include/fastrtps/publisher/Publisher.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 Publisher.h - * - */ - -#ifndef PUBLISHER_H_ -#define PUBLISHER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { -struct GUID_t; -class WriteParams; -class RTPSParticipant; -} // namespace rtps - -class Participant; -class PublisherImpl; - -/** - * Class Publisher, used to send data to associated subscribers. - * @ingroup FASTRTPS_MODULE - */ -class FASTDDS_EXPORTED_API Publisher -{ - friend class PublisherImpl; - virtual ~Publisher(); - -public: - - /** - * Constructor from a PublisherImpl pointer - * @param pimpl Actual implementation of the publisher - */ - Publisher( - PublisherImpl* pimpl); - - /*! - * @brief Writes a sample of the topic. - * @param sample Pointer to the sample. - * @return true when operation works successfully. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time. - */ - bool write( - void* sample); - - /*! - * @brief Writes a sample of the topic with additional options. - * @param sample Pointer to the sample. - * @param wparams Extra write parameters. - * @return true when operation works successfully. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time. - */ - bool write( - void* sample, - rtps::WriteParams& wparams); - - /*! - * @brief Informs that the application will be modifying a particular instance. - * It gives and 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. - */ - fastrtps::rtps::InstanceHandle_t register_instance( - void* instance); - - /*! - * @brief Requests the middleware to delete the instance. - * Applications are made aware of the deletion through the DataReader objects. - * @param[in] data 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, `true` is returned. - */ - bool dispose( - void* data, - const rtps::InstanceHandle_t& handle); - /*! - * @brief This operation reserves the action of `register_instance`. - * 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, `true` is returned. - */ - bool unregister_instance( - void* instance, - const rtps::InstanceHandle_t& handle); - - /** - * Remove all the Changes in the associated RTPSWriter. - * @param[out] removed Number of elements removed - * @return True if all elements were removed. - */ - bool removeAllChange( - size_t* removed = nullptr); - - /** - * Waits until all changes were acknowledged or max_wait. - * @param max_wait Maximum time to wait until all changes are acknowledged. - * @return True if all were acknowledged. - */ - bool wait_for_all_acked( - const Duration_t& max_wait); - - /** - * Get the GUID_t of the associated RTPSWriter. - * @return GUID_t. - */ - const rtps::GUID_t& getGuid(); - - /** - * Get the Attributes of the Publisher. - * @return Attributes of the publisher - */ - const PublisherAttributes& getAttributes() const; - - /** - * Update the Attributes of the publisher. - * @param att Reference to a PublisherAttributes object to update the parameters. - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated. - */ - bool updateAttributes( - const PublisherAttributes& att); - - /** - * @brief Returns the offered deadline missed status - * @param status missed status struct - */ - void get_offered_deadline_missed_status( - OfferedDeadlineMissedStatus& status); - - /** - * @brief Asserts liveliness - */ - void assert_liveliness(); - - /** - * @brief Returns the liveliness lost status - * @param status Liveliness lost status - */ - void get_liveliness_lost_status( - LivelinessLostStatus& status); - - /** - * Get the list of locators from which this publisher may send data. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_sending_locators( - rtps::LocatorList_t& locators) const; - -private: - - PublisherImpl* mp_impl; -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* PUBLISHER_H_ */ diff --git a/include/fastrtps/publisher/PublisherHistory.h b/include/fastrtps/publisher/PublisherHistory.h deleted file mode 100644 index 87fa2c9c703..00000000000 --- a/include/fastrtps/publisher/PublisherHistory.h +++ /dev/null @@ -1,206 +0,0 @@ -// 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 PublisherHistory.h - * - */ - -#ifndef PUBLISHERHISTORY_H_ -#define PUBLISHERHISTORY_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class PublisherHistory, implementing a WriterHistory with support for keyed topics and HistoryQOS. - * This class is created by the PublisherImpl and should not be used by the user directly. - * @ingroup FASTRTPS_MODULE - */ -class PublisherHistory : public rtps::WriterHistory -{ -public: - - /** - * Constructor of the PublisherHistory. - * @param topic_att TopicAttributed - * @param payloadMax Maximum payload size. - * @param mempolicy Set whether the payloads ccan dynamically resized or not. - */ - PublisherHistory( - const TopicAttributes& topic_att, - uint32_t payloadMax, - rtps::MemoryManagementPolicy_t mempolicy); - - virtual ~PublisherHistory(); - - /** - * Rebuild instances loaded from DB. Does nothing if the topic doesn't have key. - */ - void rebuild_instances(); - - /*! - * @brief Tries to reserve resources for the new instance. - * @param instance_handle Instance's key. - * @param lock Lock which should be unlock in case the operation has to wait. - * @param max_blocking_time Maximum time the operation should be waiting. - * @return True if resources was reserved successfully. - */ - bool register_instance( - const rtps::InstanceHandle_t& instance_handle, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - - /** - * Add a change comming from the Publisher. - * @param change Pointer to the change - * @param wparams Extra write parameters. - * @param lock - * @param max_blocking_time - * @return True if added. - */ - bool add_pub_change( - rtps::CacheChange_t* change, - rtps::WriteParams& wparams, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - - /** - * Remove all change from the associated history. - * @param removed Number of elements removed. - * @return True if all elements were removed. - */ - bool removeAllChange( - size_t* removed); - - /** - * Remove the change with the minimum sequence Number. - * @return True if removed. - */ - bool removeMinChange(); - - /** - * Remove a change by the publisher History. - * @param change Pointer to the CacheChange_t. - * @return True if removed. - */ - bool remove_change_pub( - rtps::CacheChange_t* change); - - bool remove_change_g( - rtps::CacheChange_t* a_change) override; - - bool remove_change_g( - rtps::CacheChange_t* a_change, - const std::chrono::time_point& max_blocking_time) override; - - bool remove_instance_changes( - const rtps::InstanceHandle_t& handle, - const rtps::SequenceNumber_t& seq_up_to); - - /** - * @brief Sets the next deadline for the given instance - * @param handle The instance handle - * @param next_deadline_us The time point when the deadline will occur - * @return True if deadline was set successfully - */ - bool set_next_deadline( - const rtps::InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us); - - /** - * @brief Returns the deadline for the instance that is next going to 'expire' - * @param handle The handle for the instance that will next miss the deadline - * @param next_deadline_us The time point when the deadline will occur - * @return True if deadline could be retrieved for the given instance - */ - bool get_next_deadline( - rtps::InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us); - - /*! - * @brief Checks if the instance's key is registered. - * @param[in] handle Instance's key. - * return `true` if instance's key is registered in the history. - */ - bool is_key_registered( - const rtps::InstanceHandle_t& handle); - - /** - * Waits till the last change in the instance history has been acknowledged. - * @param handle Instance's handle. - * @param lock Lock which should be unlock in case the operation has to wait. - * @param max_blocking_time Maximum time the operation should be waiting. - * @return true when the last change of the instance history is acknowleged, false when timeout is reached. - */ - bool wait_for_acknowledgement_last_change( - const rtps::InstanceHandle_t& handle, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - -private: - - typedef std::map t_m_Inst_Caches; - - //!Map where keys are instance handles and values are vectors of cache changes associated - t_m_Inst_Caches keyed_changes_; - //!Time point when the next deadline will occur (only used for topics with no key) - std::chrono::steady_clock::time_point next_deadline_us_; - //!HistoryQosPolicy values. - HistoryQosPolicy history_qos_; - //!ResourceLimitsQosPolicy values. - ResourceLimitsQosPolicy resource_limited_qos_; - //!Topic Attributes - TopicAttributes topic_att_; - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param instance_handle Instance of the key. - * @param map_it A map iterator to the given key - * @return True if the key was found or could be added to the map - */ - bool find_or_add_key( - const rtps::InstanceHandle_t& instance_handle, - t_m_Inst_Caches::iterator* map_it); - - /** - * Add a change comming from the Publisher. - * @param change Pointer to the change - * @param lock - * @param max_blocking_time - * @return True if added. - */ - bool prepare_change( - rtps::CacheChange_t* change, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif // PUBLISHERHISTORY_H_ diff --git a/include/fastrtps/publisher/PublisherListener.h b/include/fastrtps/publisher/PublisherListener.h deleted file mode 100644 index 71dcae16409..00000000000 --- a/include/fastrtps/publisher/PublisherListener.h +++ /dev/null @@ -1,90 +0,0 @@ -// 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 PublisherListener.h - */ - -#ifndef PUBLISHERLISTENER_H_ -#define PUBLISHERLISTENER_H_ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Publisher; - -/** - * Class PublisherListener, allows the end user to implement callbacks triggered by certain events. - */ -class FASTDDS_EXPORTED_API PublisherListener -{ -public: - - PublisherListener() - { - } - - virtual ~PublisherListener() - { - } - - /** - * This method is called when the Publisher is matched (or unmatched) against an endpoint. - * @param pub Pointer to the associated Publisher - * @param info Information regarding the matched subscriber - */ - virtual void onPublicationMatched( - Publisher* pub, - rtps::MatchingInfo& info) - { - (void)pub; - (void)info; - } - - /** - * A method called when a deadline is missed - * @param pub Pointer to the associated Publisher - * @param status The deadline missed status - */ - virtual void on_offered_deadline_missed( - Publisher* pub, - const OfferedDeadlineMissedStatus& status) - { - (void)pub; - (void)status; - } - - /** - * @brief Method called when the liveliness of a publisher is lost - * @param pub The publisher - * @param status The liveliness lost status - */ - virtual void on_liveliness_lost( - Publisher* pub, - const LivelinessLostStatus& status) - { - (void)pub; - (void)status; - } - -}; - -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif /* PUBLISHERLISTENER_H_ */ diff --git a/include/fastrtps/rtps/builtin/BuiltinProtocols.h b/include/fastrtps/rtps/builtin/BuiltinProtocols.h deleted file mode 100644 index ea38baed60e..00000000000 --- a/include/fastrtps/rtps/builtin/BuiltinProtocols.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 BUILTINPROTOCOLS_H_ -#define BUILTINPROTOCOLS_H_ - -#include - -#endif /* BUILTINPROTOCOLS_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h deleted file mode 100644 index 4d125388162..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 EDP_H_ -#define EDP_H_ - -#include - -#endif /* EDP_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h deleted file mode 100644 index 513ec92a66d..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 EDPSIMPLE_H_ -#define EDPSIMPLE_H_ - -#include - -#endif /* EDPSIMPLE_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h deleted file mode 100644 index 86a1c8892ad..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 EDPSTATIC_H_ -#define EDPSTATIC_H_ - -#include - -#endif /* EDPSTATIC_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDP.h b/include/fastrtps/rtps/builtin/discovery/participant/PDP.h deleted file mode 100644 index 3b8a8f6c549..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDP.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 PDP_H_ -#define PDP_H_ - -#include - -#endif /* PDP_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h b/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h deleted file mode 100644 index 277d1a8c2e8..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 PDPLISTENER_H_ -#define PDPLISTENER_H_ - -#include - -#endif /* PDPLISTENER_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h b/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h deleted file mode 100644 index 55d338e9452..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 _RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ -#define _RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ - -#include - -#endif //_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/include/fastrtps/rtps/builtin/liveliness/WLP.h b/include/fastrtps/rtps/builtin/liveliness/WLP.h deleted file mode 100644 index 380a170e384..00000000000 --- a/include/fastrtps/rtps/builtin/liveliness/WLP.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 WLP_H_ -#define WLP_H_ - -#include - -#endif /* WLP_H_ */ diff --git a/include/fastrtps/rtps/builtin/liveliness/WLPListener.h b/include/fastrtps/rtps/builtin/liveliness/WLPListener.h deleted file mode 100644 index 49e76e8f8a8..00000000000 --- a/include/fastrtps/rtps/builtin/liveliness/WLPListener.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 WLPLISTENER_H_ -#define WLPLISTENER_H_ - -#include - -#endif /* WLPLISTENER_H_ */ diff --git a/include/fastrtps/rtps/messages/MessageReceiver.h b/include/fastrtps/rtps/messages/MessageReceiver.h deleted file mode 100644 index 3ee6062aae8..00000000000 --- a/include/fastrtps/rtps/messages/MessageReceiver.h +++ /dev/null @@ -1,26 +0,0 @@ -// 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 MessageReceiver.h - */ - - - -#ifndef MESSAGERECEIVER_H_ -#define MESSAGERECEIVER_H_ - -#include - -#endif /* MESSAGERECEIVER_H_ */ diff --git a/include/fastrtps/rtps/rtps_all.h b/include/fastrtps/rtps/rtps_all.h deleted file mode 100644 index 78f0b99f7cf..00000000000 --- a/include/fastrtps/rtps/rtps_all.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 rtps_all.h - * - */ - -#ifndef RTPS_ALL_H_ -#define RTPS_ALL_H_ - -#include - -#endif /* RTPS_ALL_H_ */ diff --git a/include/fastrtps/rtps/writer/LivelinessData.h b/include/fastrtps/rtps/writer/LivelinessData.h deleted file mode 100644 index 980e1dadebc..00000000000 --- a/include/fastrtps/rtps/writer/LivelinessData.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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 LivelinessData.h - */ -#ifndef LIVELINESS_DATA_H_ -#define LIVELINESS_DATA_H_ - -#include - -#endif /* LIVELINESS_DATA_H_ */ diff --git a/include/fastrtps/rtps/writer/LivelinessManager.h b/include/fastrtps/rtps/writer/LivelinessManager.h deleted file mode 100644 index f2cafe2155c..00000000000 --- a/include/fastrtps/rtps/writer/LivelinessManager.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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 LivelinessManager.h - */ -#ifndef LIVELINESS_MANAGER_H_ -#define LIVELINESS_MANAGER_H_ - -#include - -#endif /* LIVELINESS_MANAGER_H_ */ diff --git a/include/fastrtps/subscriber/SampleInfo.h b/include/fastrtps/subscriber/SampleInfo.h deleted file mode 100644 index e8cd4fcb07a..00000000000 --- a/include/fastrtps/subscriber/SampleInfo.h +++ /dev/null @@ -1,73 +0,0 @@ -// 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 SampleInfo.h - */ - -#ifndef SAMPLEINFO_H_ -#define SAMPLEINFO_H_ - -#include - -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class SampleInfo_t with information that is provided along a sample when reading data from a Subscriber. - * @ingroup FASTRTPS_MODULE - */ -class FASTDDS_EXPORTED_API SampleInfo_t -{ -public: - - SampleInfo_t() - : sampleKind(rtps::ALIVE) - , ownershipStrength(0) - , sample_identity(rtps::SampleIdentity::unknown()) - , related_sample_identity(rtps::SampleIdentity::unknown()) - { - } - - virtual ~SampleInfo_t() - { - } - - //!Sample kind. - rtps::ChangeKind_t sampleKind; - //!Ownership Strength of the writer of the sample (0 if the ownership kind is set to SHARED_OWNERSHIP_QOS). - uint32_t ownershipStrength; - //!Source timestamp of the sample. - rtps::Time_t sourceTimestamp; - //!Reception timestamp of the sample. - rtps::Time_t receptionTimestamp; - //!InstanceHandle of the data - rtps::InstanceHandle_t iHandle; - - rtps::SampleIdentity sample_identity; - - rtps::SampleIdentity related_sample_identity; -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* SAMPLEINFO_H_ */ diff --git a/include/fastrtps/subscriber/Subscriber.h b/include/fastrtps/subscriber/Subscriber.h deleted file mode 100644 index 25c9ebba8a1..00000000000 --- a/include/fastrtps/subscriber/Subscriber.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 Subscriber.h - */ - - -#ifndef SUBSCRIBER_H_ -#define SUBSCRIBER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class SubscriberImpl; -class SampleInfo_t; - -/** - * 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. - */ -class FASTDDS_EXPORTED_API Subscriber -{ - friend class SubscriberImpl; - - virtual ~Subscriber() - { - } - -public: - - /** - * Constructor from a SubscriberImpl pointer - * @param pimpl Actual implementation of the subscriber - */ - Subscriber( - SubscriberImpl* pimpl) - : mp_impl(pimpl) - { - } - - /** - * Get the associated GUID - * @return Associated GUID - */ - const rtps::GUID_t& getGuid(); - - /** - * Method to block the current thread until an unread message is available - */ - inline void waitForUnreadMessage() - { - const Duration_t one_day{ 24 * 3600, 0 }; - while (!wait_for_unread_samples(one_day)) - { - } - } - - /*! - * @brief Blocks the current thread until an unread sample is available. - * @param timeout Maximum time the function will be blocked if any sample is received. - * @return true in case unread samples are available. - * In other case, false. - */ - bool wait_for_unread_samples( - const Duration_t& timeout); - - /** - * @brief Reads next unread sample from the Subscriber. - * @param sample Pointer to the object where you want the sample stored. - * @param info Pointer to a SampleInfo_t structure that informs you about your sample. - * @return True if a sample was read. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on SubscriberAttributes defines this period of time. - */ - bool readNextData( - void* sample, - SampleInfo_t* info); - - /** - * @brief Takes next sample from the Subscriber. The sample is removed from the subscriber. - * @param sample Pointer to the object where you want the sample stored. - * @param info Pointer to a SampleInfo_t structure that informs you about your sample. - * @return True if a sample was taken. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on SubscriberAttributes defines this period of time. - */ - bool takeNextData( - void* sample, - SampleInfo_t* 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 true if sample info was returned. false if there is no sample to take. - */ - bool get_first_untaken_info( - SampleInfo_t* info); - - /** - * Update the Attributes of the subscriber; - * @param att Reference to a SubscriberAttributes object to update the parameters; - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated - */ - bool updateAttributes( - const SubscriberAttributes& att); - - /** - * Get the Attributes of the Subscriber. - * @return Attributes of the subscriber - */ - const SubscriberAttributes& getAttributes() const; - - /*! - * @brief Returns there is a clean state with all Publishers. - * It occurs when the Subscriber received all samples sent by Publishers. In other words, - * its WriterProxies are up to date. - * @return There is a clean state with all Publishers. - */ - bool isInCleanState() const; - - /** - * Get the unread count. - * @return Unread count - */ - inline uint64_t getUnreadCount() const - { - return get_unread_count(); - } - - /** - * Get the unread count. - * @return Unread count - */ - uint64_t get_unread_count() const; - - /** - * @brief Get the requested deadline missed status - * @param status The deadline missed status - */ - void get_requested_deadline_missed_status( - RequestedDeadlineMissedStatus& status); - - /** - * @brief Returns the liveliness changed status - * @param status Liveliness changed status - */ - void get_liveliness_changed_status( - LivelinessChangedStatus& status); - - /** - * Get the list of locators on which this subscriber is listening. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_listening_locators( - rtps::LocatorList_t& locators) const; - -private: - - SubscriberImpl* mp_impl; -}; - - - -} /* namespace pubsub */ -} /* namespace eprosima */ - -#endif /* SUBSCRIBER_H_ */ diff --git a/include/fastrtps/subscriber/SubscriberHistory.h b/include/fastrtps/subscriber/SubscriberHistory.h deleted file mode 100644 index 6fdf3fad4d6..00000000000 --- a/include/fastrtps/subscriber/SubscriberHistory.h +++ /dev/null @@ -1,283 +0,0 @@ -// 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 SubscriberHistory.h - * - */ - -#ifndef SUBSCRIBERHISTORY_H_ -#define SUBSCRIBERHISTORY_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class SubscriberHistory, container of the different CacheChanges of a subscriber - * @ingroup FASTRTPS_MODULE - */ -class SubscriberHistory : public rtps::ReaderHistory -{ -public: - - /** - * Constructor. Requires information about the subscriber. - * @param topic_att TopicAttributes. - * @param type TopicDataType. - * @param qos ReaderQoS policy. - * @param payloadMax Maximum payload size per change. - * @param mempolicy Set whether the payloads ccan dynamically resized or not. - */ - SubscriberHistory( - const TopicAttributes& topic_att, - fastdds::dds::TopicDataType* type, - const fastrtps::ReaderQos& qos, - uint32_t payloadMax, - rtps::MemoryManagementPolicy_t mempolicy); - - ~SubscriberHistory() override; - - /** - * Remove a specific change from the history. - * No Thread Safe - * @param removal iterator to the CacheChange_t to remove. - * @param release defaults to true and hints if the CacheChange_t should return to the pool - * @return iterator to the next CacheChange_t or end iterator. - */ - iterator remove_change_nts( - const_iterator removal, - bool release = true) override; - - /** - * Check if a new change can be added to this history. - * - * @param [in] writer_guid GUID of the writer where the change came from. - * @param [in] total_payload_size Total payload size of the incoming change. - * @param [in] unknown_missing_changes_up_to The number of changes from the same writer with a lower sequence - * number that could potentially be received in the future. - * @param [out] will_never_be_accepted When the method returns @c false, this parameter will inform - * whether the change could be accepted in the future or not. - * - * @pre change should not be present in the history - * - * @return Whether a call to received_change will succeed when called with the same arguments. - */ - bool can_change_be_added_nts( - const rtps::GUID_t& writer_guid, - uint32_t total_payload_size, - size_t unknown_missing_changes_up_to, - bool& will_never_be_accepted) const override; - - /** - * Called when a change is received by the Subscriber. Will add the change to the history. - * @pre Change should not be already present in the history. - * @param[in] change The received change - * @param unknown_missing_changes_up_to Number of missing changes before this one - * @return - */ - bool received_change( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to) override; - - /** - * Called when a fragmented change is received completely by the Subscriber. Will find its instance and store it. - * @pre Change should be already present in the history. - * @param[in] change The received change - * @return - */ - bool completed_change( - rtps::CacheChange_t* change) override; - - /** @name Read or take data methods. - * Methods to read or take data from the History. - * @param data Pointer to the object where you want to read or take the information. - * @param info Pointer to a SampleInfo_t object where you want - * @param max_blocking_time Maximum time the function can be blocked. - * to store the information about the retrieved data - */ - ///@{ - bool readNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time); - - bool takeNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time); - ///@} - - /** - * @brief Returns information about the first untaken sample. - * @param [out] info Pointer to a SampleInfo_t structure to store first untaken sample information. - * @return true if sample info was returned. false if there is no sample to take. - */ - bool get_first_untaken_info( - SampleInfo_t* info); - - /** - * This method is called to remove a change from the SubscriberHistory. - * @param change Pointer to the CacheChange_t. - * @return True if removed. - */ - bool remove_change_sub( - rtps::CacheChange_t* change); - - /** - * This method is called to remove a change from the SubscriberHistory. - * @param [in] change Pointer to the CacheChange_t. - * @param [in,out] it Iterator pointing to change on input. Will point to next valid change on output. - * @return True if removed. - */ - bool remove_change_sub( - rtps::CacheChange_t* change, - iterator& it); - - /** - * @brief A method to set the next deadline for the given instance - * @param handle The handle to the instance - * @param next_deadline_us The time point when the deadline will occur - * @return True if the deadline was set correctly - */ - bool set_next_deadline( - const rtps::InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us); - - /** - * @brief A method to get the next instance handle that will miss the deadline and the time when the deadline will occur - * @param handle The handle to the instance - * @param next_deadline_us The time point when the instance will miss the deadline - * @return True if the deadline was retrieved successfully - */ - bool get_next_deadline( - rtps::InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us); - -private: - - using rtps::ReaderHistory::completed_change; - using rtps::ReaderHistory::received_change; - using rtps::ReaderHistory::remove_change_nts; - - using t_m_Inst_Caches = std::map; - - //!Map where keys are instance handles and values vectors of cache changes - t_m_Inst_Caches keyed_changes_; - //!Time point when the next deadline will occur (only used for topics with no key) - std::chrono::steady_clock::time_point next_deadline_us_; - //!HistoryQosPolicy values. - HistoryQosPolicy history_qos_; - //!ResourceLimitsQosPolicy values. - ResourceLimitsQosPolicy resource_limited_qos_; - //!Topic Attributes - TopicAttributes topic_att_; - //!TopicDataType - fastdds::dds::TopicDataType* type_; - //!ReaderQos - fastrtps::ReaderQos qos_; - - //!Type object to deserialize Key - void* get_key_object_; - - /// Function processing a received change - std::function receive_fn_; - - /// Function processing a completed fragmented change - std::function complete_fn_; - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param a_change The change to get the key from - * @param[out] map_it A map iterator to the given key - * @return True if it was found or could be added to the map - */ - bool find_key( - rtps::CacheChange_t* a_change, - t_m_Inst_Caches::iterator& map_it); - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param a_change The change to get the key from - * @param map_it A map iterator to the given key - * @return True if it was found or could be added to the map - */ - bool find_key_for_change( - rtps::CacheChange_t* a_change, - t_m_Inst_Caches::iterator& map_it); - - /** - * @name Variants of incoming change processing. - * Will be called with the history mutex taken. - * @param[in] change The received change - * @param unknown_missing_changes_up_to Number of missing changes before this one - * @return - */ - ///@{ - bool received_change_keep_all_no_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_last_no_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_all_with_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_last_with_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool completed_change_keep_all_with_key( - rtps::CacheChange_t* change); - - bool completed_change_keep_last_with_key( - rtps::CacheChange_t* change); - ///@} - - bool add_received_change( - rtps::CacheChange_t* a_change); - - bool add_received_change_with_key( - rtps::CacheChange_t* a_change, - std::vector& instance_changes); - - bool deserialize_change( - rtps::CacheChange_t* change, - uint32_t ownership_strength, - void* data, - SampleInfo_t* info); -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif /* SUBSCRIBERHISTORY_H_ */ diff --git a/include/fastrtps/subscriber/SubscriberListener.h b/include/fastrtps/subscriber/SubscriberListener.h deleted file mode 100644 index d7506a992d9..00000000000 --- a/include/fastrtps/subscriber/SubscriberListener.h +++ /dev/null @@ -1,104 +0,0 @@ -// 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 SubscriberListener.h - */ - -#ifndef SUBLISTENER_H_ -#define SUBLISTENER_H_ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { -class MatchingInfo; -} /* namespace rtps */ - -class Subscriber; - -/** - * Class SubscriberListener, it should be used by the end user to implement specific callbacks to certain actions. - */ -class FASTDDS_EXPORTED_API SubscriberListener -{ -public: - - SubscriberListener() - { - } - - virtual ~SubscriberListener() - { - } - - /** - * Virtual function to be implemented by the user containing the actions to be performed when a new Data Message is received. - * @param sub Subscriber - */ - virtual void onNewDataMessage( - Subscriber* sub) - { - (void)sub; - } - - /** - * 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 sub Subscriber - * @param info Matching information - */ - virtual void onSubscriptionMatched( - Subscriber* sub, - rtps::MatchingInfo& info) - { - (void)sub; - (void)info; - } - - /** - * Virtual method to be called when a topic misses the deadline period - * @param sub Subscriber - * @param status The requested deadline missed status - */ - virtual void on_requested_deadline_missed( - Subscriber* sub, - const RequestedDeadlineMissedStatus& status) - { - (void)sub; - (void)status; - } - - /** - * @brief Method called when the liveliness status associated to a subscriber changes - * @param sub The subscriber - * @param status The liveliness changed status - */ - virtual void on_liveliness_changed( - Subscriber* sub, - const LivelinessChangedStatus& status) - { - (void)sub; - (void)status; - } - -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* LISTENER_H_ */ diff --git a/include/fastrtps/utils/Semaphore.h b/include/fastrtps/utils/Semaphore.h deleted file mode 100644 index a2d20af4378..00000000000 --- a/include/fastrtps/utils/Semaphore.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 Esteve Fernandez -// -// 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 FASTRTPS_SEMAPHORE_H_ -#define FASTRTPS_SEMAPHORE_H_ - -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Semaphore { -public: - explicit Semaphore(size_t count = 0); - Semaphore(const Semaphore&) = delete; - Semaphore& operator=(const Semaphore&) = delete; - - void post(); - void wait(); - void disable(); - void enable(); - void post(int n); - -private: - size_t count_; - std::mutex mutex_; - std::condition_variable cv_; - bool disable_; -}; - -inline Semaphore::Semaphore(size_t count) : count_(count), disable_(false) {} - -inline void Semaphore::post() { - std::lock_guard lock(mutex_); - if (!disable_) - { - ++count_; - cv_.notify_one(); - } -} - -inline void Semaphore::post(int n) { - std::lock_guard lock(mutex_); - if (!disable_) - { - count_ += n; - for (int i = 0; i < n; ++i) - { - cv_.notify_one(); - } - } -} - -inline void Semaphore::disable() { - std::lock_guard lock(mutex_); - if (!disable_) - { - count_ = (size_t)-1L; - cv_.notify_all(); - disable_ = true; - } -} - -inline void Semaphore::enable() { - std::lock_guard lock(mutex_); - if (disable_) - { - count_ = 0; - disable_ = false; - } -} - -inline void Semaphore::wait() { - std::unique_lock lock(mutex_); - if (!disable_) - { - cv_.wait(lock, [&] { - if (disable_) return true; - return count_ > 0; - }); - --count_; - } -} - -} // fastrtps -} // eprosima - -#endif // FASTRTPS_SEMAPHORE_H_ diff --git a/include/fastrtps/utils/TimeConversion.h b/include/fastrtps/utils/TimeConversion.h deleted file mode 100644 index e5950a41f49..00000000000 --- a/include/fastrtps/utils/TimeConversion.h +++ /dev/null @@ -1,160 +0,0 @@ -// 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 TimeConversion.h - * - */ - -#ifndef TIMECONVERSION_H_ -#define TIMECONVERSION_H_ - -#include -#include - -namespace eprosima { -namespace fastrtps{ -namespace rtps { - - -namespace TimeConv{ - -/** -* Convert Time_t to seconds as a double -*/ -inline double Time_t2SecondsDouble(const rtps::Time_t& t) -{ - return (double)t.seconds() + (double)(t.fraction()/pow(2.0,32)); -} - -/** -* Convert Time_t to seconds as an int64 -*/ -inline int64_t Time_t2MicroSecondsInt64(const rtps::Time_t& t) -{ - return (int64_t)(t.fraction()/pow(2.0,32)*pow(10.0,6)) + t.seconds()*(int64_t)pow(10.0,6); -} - -/** -* Convert Duration_t to seconds as an int64 -*/ -inline int64_t Duration_t2MicroSecondsInt64(const Duration_t& t) -{ - return (int64_t)(t.nanosec/1000.0)+t.seconds*(int64_t)pow(10.0,6); -} - -/** -* Convert Time_t to microseconds as a double -*/ -inline double Time_t2MicroSecondsDouble(const rtps::Time_t& t) -{ - return ((double)t.fraction()/pow(2.0,32)*pow(10.0,6)) + (double)t.seconds()*pow(10.0,6); -} - -/** -* Convert Time_t to milliseconds as an int64 -*/ -inline int64_t Time_t2MilliSecondsInt64(const rtps::Time_t& t) -{ - return (int64_t)(t.fraction()/pow(2.0,32)*pow(10.0,3)) + t.seconds()*(int64_t)pow(10.0,3); -} - -/** -* Convert Time_t to milliseconds as a double -*/ -inline double Time_t2MilliSecondsDouble(const rtps::Time_t& t) -{ - return ((double)t.fraction()/pow(2.0,32)*pow(10.0,3)) + (double)t.seconds()*pow(10.0,3); -} - -/** -* Convert Duration_t to milliseconds as a double -*/ -inline double Duration_t2MilliSecondsDouble(const Duration_t& t) -{ - return ((double)t.nanosec/1000000.0)+(double)t.seconds*pow(10.0,3); -} - -/** -* Convert milliseconds to Time_t -*/ -inline rtps::Time_t MilliSeconds2Time_t(double millisec) -{ - rtps::Time_t t; - t.seconds((int32_t)(millisec/pow(10.0,3))); - t.fraction((uint32_t)((millisec-(double)t.seconds()*pow(10.0,3))/pow(10.0,3)*pow(2.0,32))); - return t; -} - -/** -* Convert microseconds to Time_t -*/ -inline rtps::Time_t MicroSeconds2Time_t(double microsec) -{ - rtps::Time_t t; - t.seconds((int32_t)(microsec/pow(10.0,6))); - t.fraction((uint32_t)((microsec-(double)t.seconds()*pow(10.0,6))/pow(10.0,6)*pow(2.0,32))); - return t; -} - -/** -* Convert seconds to Time_t -*/ -inline rtps::Time_t Seconds2Time_t(double seconds) -{ - rtps::Time_t t; - t.seconds((int32_t)seconds); - t.fraction((uint32_t)((seconds-(double)t.seconds())*pow(2.0,32))); - return t; -} - -/** -* Get the absolute difference between two Time_t in milliseconds as double -*/ -inline double Time_tAbsDiff2DoubleMillisec(const rtps::Time_t& t1, const rtps::Time_t& t2) -{ - double result = 0; - result +=(double)abs((t2.seconds()-t1.seconds())*1000); - result +=(double)std::abs((t2.fraction()-t1.fraction())/pow(2.0,32)*1000); - return result; -} - -//! Create a random Time_t that is millisec + [-randoff,randoff] -inline rtps::Time_t MilliSecondsWithRandOffset2Time_t(double millisec, double randoff) -{ - randoff = std::abs(randoff); - millisec = millisec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return MilliSeconds2Time_t(millisec); -} -//! Create a random Time_t that is microsec + [-randoff,randoff] -inline rtps::Time_t MicroSecondsWithRandOffset2Time_t(double microsec, double randoff) -{ - randoff = std::abs(randoff); - microsec = microsec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return MicroSeconds2Time_t(microsec); -} -//! Create a random Time_t that is sec + [-randoff,randoff] -inline rtps::Time_t SecondsWithRandOffset2Time_t(double sec, double randoff) -{ - randoff = std::abs(randoff); - sec = sec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return Seconds2Time_t(sec); -} - -} -} -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif /* TIMECONVERSION_H_ */ diff --git a/resources/xsd/fastdds_profiles.xsd b/resources/xsd/fastdds_profiles.xsd index 854a42da1de..92f1c451195 100644 --- a/resources/xsd/fastdds_profiles.xsd +++ b/resources/xsd/fastdds_profiles.xsd @@ -40,7 +40,9 @@ ├ data_writer [0~*], ├ data_reader [0~*], ├ transport_descriptors [0~1], - └ topic [0~*] --> + ├ topic [0~1], + ├ replier [0~1], + └ requester [0~*] --> @@ -50,6 +52,8 @@ + + @@ -211,10 +215,7 @@ - - + @@ -242,14 +243,34 @@ - - - + + + + + + + + + + - + @@ -279,8 +300,32 @@ - - + + + + + + + + + + + + + + + + + + + + + +