diff --git a/fastdds_python/src/swig/fastdds.i b/fastdds_python/src/swig/fastdds.i index 73489eec..c901598d 100644 --- a/fastdds_python/src/swig/fastdds.i +++ b/fastdds_python/src/swig/fastdds.i @@ -226,6 +226,7 @@ namespace xtypes { %include "fastdds/dds/domain/DomainParticipantListener.i" %include "fastdds/dds/domain/qos/DomainParticipantFactoryQos.i" %include "fastdds/dds/domain/qos/DomainParticipantQos.i" +%include "fastdds/dds/domain/qos/DomainParticipantExtendedQos.i" %include "fastdds/dds/domain/qos/ReplierQos.i" %include "fastdds/dds/domain/qos/RequesterQos.i" %include "fastdds/dds/domain/DomainParticipant.i" diff --git a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i index 51a0e3dc..950579bc 100644 --- a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i +++ b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i @@ -48,6 +48,34 @@ return self->create_participant(domain_id, qos, listener, mask); } + /** + * Create a Participant. + * + * @param extended_qos DomainParticipantExtendedQos Reference. + * @param listener DomainParticipantListener Pointer (default: nullptr) + * @param mask StatusMask Reference (default: all) + * @return DomainParticipant pointer. (nullptr if not created.) + */ + DomainParticipant* create_participant( + const DomainParticipantExtendedQos& extended_qos, + DomainParticipantListener* listener = nullptr, + const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all()) + { + if (nullptr != listener) + { + Swig::Director* director = SWIG_DIRECTOR_CAST(listener); + + if (nullptr != director) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_INCREF(director->swig_get_self()); + SWIG_PYTHON_THREAD_END_BLOCK; + } + } + + return self->create_participant(extended_qos.domainId(), extended_qos, listener, mask); + } + /** * Create a Participant. * diff --git a/fastdds_python/src/swig/fastdds/dds/domain/qos/DomainParticipantExtendedQos.i b/fastdds_python/src/swig/fastdds/dds/domain/qos/DomainParticipantExtendedQos.i new file mode 100644 index 00000000..a91533b1 --- /dev/null +++ b/fastdds_python/src/swig/fastdds/dds/domain/qos/DomainParticipantExtendedQos.i @@ -0,0 +1,19 @@ +// Copyright 2022 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. + +%{ +#include "fastdds/dds/domain/qos/DomainParticipantExtendedQos.hpp" +%} + +%include "fastdds/dds/domain/qos/DomainParticipantExtendedQos.hpp" diff --git a/fastdds_python/test/api/test_domainparticipantfactory.py b/fastdds_python/test/api/test_domainparticipantfactory.py index 4a9bc0fc..d992be31 100644 --- a/fastdds_python/test/api/test_domainparticipantfactory.py +++ b/fastdds_python/test/api/test_domainparticipantfactory.py @@ -111,6 +111,16 @@ def test(status_mask_1, status_mask_2, listnr=None): m, listener) + # Overload 4 + extended_qos = fastdds.DomainParticipantExtendedQos() + participant = factory.create_participant( + extended_qos) + assert(participant.is_enabled()) + assert(fastdds.StatusMask.all() == participant.get_status_mask()) + assert(participant is not None) + assert(fastdds.RETCODE_OK == + factory.delete_participant(participant)) + def test_create_participant_with_profile(): """