Skip to content

Commit

Permalink
Create DomainParticipantExtendedQos.i (#146)
Browse files Browse the repository at this point in the history
* Refs #20869: Create DomainParticipantExtendedQos.i

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>

* Refs #20869: Add create_participant test with ExtendedQos

Signed-off-by: Lucia Echevarria <luciaechevarria@eprosima.com>

* Extend DomainParticipantFactory.i API

Signed-off-by: Lucia Echevarria <luciaechevarria@eprosima.com>

---------

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: Lucia Echevarria <luciaechevarria@eprosima.com>
Co-authored-by: elianalf <62831776+elianalf@users.noreply.github.com>
  • Loading branch information
LuciaEchevarria99 and elianalf authored Jun 24, 2024
1 parent 2c25e60 commit fb1dba6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions fastdds_python/src/swig/fastdds.i
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions fastdds_python/test/api/test_domainparticipantfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down

0 comments on commit fb1dba6

Please sign in to comment.