Skip to content

Commit

Permalink
Refs #20129: apply review suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>
  • Loading branch information
JLBuenoLopez committed Jan 25, 2024
1 parent 8c1d94b commit 54ba34d
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 102 deletions.
2 changes: 1 addition & 1 deletion cmake/testing/GoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ function(gtest_discover_tests TARGET)

set(CMAKE_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_win_wrapper_$<CONFIG>.bat")
endif()
set(_DISCOVERY_TIMEOUT "DISCOVERY_TIMEOUT;10")
set(_DISCOVERY_TIMEOUT "DISCOVERY_TIMEOUT;30")
_gtest_discover_tests(${TARGET} ${ARGN} ${_DISCOVERY_TIMEOUT})
endfunction()
5 changes: 2 additions & 3 deletions include/fastdds/dds/domain/DomainParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@

#include <fastdds/dds/builtin/topic/ParticipantBuiltinTopicData.hpp>
#include <fastdds/dds/builtin/topic/TopicBuiltinTopicData.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/core/status/StatusMask.hpp>
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/core/status/StatusMask.hpp>
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/dds/topic/ContentFilteredTopic.hpp>
#include <fastdds/dds/topic/IContentFilterFactory.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TopicListener.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.h>
#include <fastdds/rtps/common/Guid.h>
#include <fastdds/rtps/common/SampleIdentity.h>
Expand Down
6 changes: 3 additions & 3 deletions include/fastdds/dds/domain/DomainParticipantFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_
#define _FASTDDS_DOMAINPARTICIPANT_HPP_
#ifndef _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_
#define _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_

#include <map>
#include <memory>
Expand Down Expand Up @@ -331,4 +331,4 @@ class DomainParticipantFactory
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_DOMAINPARTICIPANT_HPP_*/
#endif /* _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_*/
2 changes: 1 addition & 1 deletion include/fastdds/dds/topic/IContentFilterFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include <fastrtps/fastrtps_dll.h>

#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/core/LoanableTypedCollection.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/topic/IContentFilter.hpp>
#include <fastdds/dds/topic/TopicDataType.hpp>
#include <fastrtps/types/TypeDescriptor.h>
Expand Down
47 changes: 0 additions & 47 deletions src/cpp/fastdds/domain/DomainParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,53 +1451,6 @@ ReturnCode_t DomainParticipantImpl::register_type(
return RETCODE_OK;
}

// TODO(XTypes): PENDING design to register discovered remote types
// bool DomainParticipantImpl::register_dynamic_type_to_factories(
// const TypeSupport& type) const
// {
// using namespace eprosima::fastrtps::types;
// DynamicPubSubType* dpst = dynamic_cast<DynamicPubSubType*>(type.get());
// if (dpst != nullptr) // Registering a dynamic type.
// {
// TypeObjectFactory* objectFactory = TypeObjectFactory::get_instance();
// eprosima::fastrtps::types::DynamicTypeBuilderFactory* dynFactory =
// eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance();
// const TypeIdentifier* id = objectFactory->get_type_identifier_trying_complete(dpst->getName());
// if (id == nullptr)
// {
// std::map<MemberId, fastrtps::types::DynamicTypeMember*> membersMap;
// dpst->GetDynamicType()->get_all_members(membersMap);
// std::vector<const MemberDescriptor*> members;
// for (auto it : membersMap)
// {
// members.push_back(it.second->get_descriptor());
// }
// TypeObject typeObj;
// dynFactory->build_type_object(dpst->GetDynamicType()->get_type_descriptor(), typeObj, &members);
// // Minimal too
// dynFactory->build_type_object(dpst->GetDynamicType()->get_type_descriptor(), typeObj, &members, false);
// const TypeIdentifier* type_id2 = objectFactory->get_type_identifier(dpst->getName());
// const TypeObject* type_obj = objectFactory->get_type_object(dpst->getName());
// if (type_id2 == nullptr)
// {
// EPROSIMA_LOG_ERROR(DOMAIN_PARTICIPANT, "Cannot register dynamic type " << dpst->getName());
// }
// else
// {
// objectFactory->add_type_object(dpst->getName(), type_id2, type_obj);

// // Complete, just to make sure it is generated
// const TypeIdentifier* type_id_complete = objectFactory->get_type_identifier(dpst->getName(), true);
// const TypeObject* type_obj_complete = objectFactory->get_type_object(dpst->getName(), true);
// objectFactory->add_type_object(dpst->getName(), type_id_complete, type_obj_complete); // Add complete
// return true;
// }
// }
// }

// return false; // Isn't a registered dynamic type.
// }

ReturnCode_t DomainParticipantImpl::unregister_type(
const std::string& type_name)
{
Expand Down
4 changes: 0 additions & 4 deletions src/cpp/fastdds/domain/DomainParticipantImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,6 @@ class DomainParticipantImpl
ReturnCode_t register_dynamic_type(
fastrtps::types::DynamicType_ptr dyn_type);

// TODO(XTypes): PENDING design to register discovered remote types
// bool register_dynamic_type_to_factories(
// const TypeSupport& type) const;

virtual PublisherImpl* create_publisher_impl(
const PublisherQos& qos,
PublisherListener* listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ struct identifier_processor
case TI_STRING8_LARGE:
return DDSFilterValue::ValueKind::STRING;

case eprosima::fastdds::dds::xtypes::TK_INT8:
case eprosima::fastdds::dds::xtypes::TK_INT16:
case eprosima::fastdds::dds::xtypes::TK_INT32:
case eprosima::fastdds::dds::xtypes::TK_INT64:
return DDSFilterValue::ValueKind::SIGNED_INTEGER;

case eprosima::fastdds::dds::xtypes::TK_BYTE:
case eprosima::fastdds::dds::xtypes::TK_UINT8:
case eprosima::fastdds::dds::xtypes::TK_UINT16:
case eprosima::fastdds::dds::xtypes::TK_UINT32:
case eprosima::fastdds::dds::xtypes::TK_UINT64:
Expand Down
31 changes: 0 additions & 31 deletions src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,37 +530,6 @@ ReturnCode_t DDSFilterFactory::create_content_filter(
auto node = parser::parse_filter_expression(filter_expression, &type_object);
if (node)
{
eprosima::fastdds::dds::xtypes::TypeIdentifierPair type_ids;
eprosima::fastdds::dds::xtypes::TypeIdentifier type_id;
ret = DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
type_name, type_ids);
if (eprosima::fastdds::dds::xtypes::TK_NONE == type_ids.type_identifier2()._d() ||
eprosima::fastdds::dds::xtypes::EK_COMPLETE == type_ids.type_identifier1()._d() ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_SEQUENCE_SMALL == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().seq_sdefn().header().equiv_kind()) ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_SEQUENCE_LARGE == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().seq_ldefn().header().equiv_kind()) ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_ARRAY_SMALL == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().array_sdefn().header().equiv_kind()) ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_ARRAY_LARGE == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().array_ldefn().header().equiv_kind()) ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_MAP_SMALL == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().map_sdefn().header().equiv_kind()) ||
(eprosima::fastdds::dds::xtypes::TI_PLAIN_MAP_LARGE == type_ids.type_identifier1()._d() &&
eprosima::fastdds::dds::xtypes::EK_COMPLETE ==
type_ids.type_identifier1().map_ldefn().header().equiv_kind()))
{
type_id = type_ids.type_identifier1();
}
else
{
type_id = type_ids.type_identifier2();
}
// TODO(XTypes): PENDING implementation DynamicTypeBuilderFactory::create_type_w_type_object
eprosima::fastrtps::types::DynamicType_ptr dyn_type; //= TypeObjectFactory::get_instance()->build_dynamic_type(type_name, type_id, type_object);
DDSFilterExpression* expr = get_expression();
Expand Down
5 changes: 5 additions & 0 deletions src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ bool DDSFilterField::set_value(
string_value = data->get_string_value(member_id);
break;

case eprosima::fastdds::dds::xtypes::TK_INT8:
signed_integer_value = data->get_int8_value(member_id);
break;

case eprosima::fastdds::dds::xtypes::TK_INT16:
signed_integer_value = data->get_int16_value(member_id);
break;
Expand All @@ -141,6 +145,7 @@ bool DDSFilterField::set_value(
break;

case eprosima::fastdds::dds::xtypes::TK_BYTE:
case eprosima::fastdds::dds::xtypes::TK_UINT8:
unsigned_integer_value = data->get_uint8_value(member_id);
break;

Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <vector>

#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/rtps/common/SerializedPayload.h>
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
#include <fastdds/rtps/common/SerializedPayload.h>
#include <fastrtps/types/DynamicData.h>

#include "DDSFilterPredicate.hpp"
Expand Down
16 changes: 8 additions & 8 deletions test/blackbox/api/dds-pim/PubSubReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@
#include <string>

#include <asio.hpp>
#include <gtest/gtest.h>
#if _MSC_VER
#include <Windows.h>
#endif // _MSC_VER
#include <fastdds/dds/core/condition/StatusCondition.hpp>
#include <fastdds/dds/core/condition/GuardCondition.hpp>
#include <fastdds/dds/core/condition/StatusCondition.hpp>
#include <fastdds/dds/core/condition/WaitSet.hpp>
#include <fastdds/dds/core/UserAllocatedSequence.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/core/UserAllocatedSequence.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/domain/DomainParticipantListener.hpp>
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/rtps/transport/UDPTransportDescriptor.h>
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.h>
#include <fastdds/rtps/transport/UDPv6TransportDescriptor.h>
#include <fastrtps/utils/IPLocator.h>
#include <fastrtps/xmlparser/XMLParser.h>
#include <fastrtps/xmlparser/XMLTree.h>
#include <fastrtps/utils/IPLocator.h>
#include <gtest/gtest.h>
#if _MSC_VER
#include <Windows.h>
#endif // _MSC_VER

using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory;
using eprosima::fastrtps::rtps::IPLocator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
*/

#ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_
#define _FASTDDS_DOMAINPARTICIPANT_HPP_
#ifndef _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_
#define _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_

#include <memory>

Expand Down Expand Up @@ -66,4 +66,4 @@ class DomainParticipantFactory
} // namespace fastdds
} // namespace eprosima

#endif /* _FASTDDS_DOMAINPARTICIPANT_HPP_*/
#endif /* _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_*/

0 comments on commit 54ba34d

Please sign in to comment.