18.1.2.2. DomainParticipantFactory

class fastdds.DomainParticipantFactory(*args, **kwargs)

Class DomainParticipantFactory

create_participant(*args)

Create a Participant.

Parameters
Return type

DomainParticipant

Returns

DomainParticipant pointer. (nullptr if not created.)

create_participant_with_profile(*args)

Overload 1:

Create a Participant.

Parameters
  • domain_id (int) – Domain Id.

  • profile_name (string) – Participant profile name.

  • listener (DomainParticipantListener) – DomainParticipantListener Pointer (default: nullptr)

  • mask (StatusMask) – StatusMask Reference (default: all)

Return type

DomainParticipant

Returns

DomainParticipant pointer. (nullptr if not created.)


Overload 2:

Create a Participant.

Parameters
  • profile_name (string) – Participant profile name.

  • listener (DomainParticipantListener) – DomainParticipantListener Pointer (default: nullptr)

  • mask (StatusMask) – StatusMask Reference (default: all)

Return type

DomainParticipant

Returns

DomainParticipant pointer. (nullptr if not created.)


Overload 3:

Create a Participant.

Parameters
  • profile_name (string) – Participant profile name.

  • listener (DomainParticipantListener) – DomainParticipantListener Pointer (default: nullptr)

  • mask – StatusMask Reference (default: all)

Return type

DomainParticipant

Returns

DomainParticipant pointer. (nullptr if not created.)


Overload 4:

Create a Participant.

Parameters
  • profile_name (string) – Participant profile name.

  • listener – DomainParticipantListener Pointer (default: nullptr)

  • mask – StatusMask Reference (default: all)

Return type

DomainParticipant

Returns

DomainParticipant pointer. (nullptr if not created.)

delete_participant(part)

Remove a Participant and all associated publishers and subscribers.

Parameters

part (DomainParticipant) – Pointer to the participant.

Return type

ReturnCode_t

Returns

RETCODE_PRECONDITION_NOT_MET if the participant has active entities, RETCODE_OK if the participant is correctly deleted and RETCODE_ERROR otherwise.

get_default_participant_qos(*args)

Overload 1:

This operation retrieves the default value of the DomainParticipant QoS, that is, the QoS policies which will be used for newly created DomainParticipant entities in the case where the QoS policies are defaulted in the create_participant operation. The values retrieved get_default_participant_qos will match the set of values specified on the last successful call to set_default_participant_qos, or else, if the call was never made, the default values.

Parameters

qos (DomainParticipantQos) – DomainParticipantQos where the qos is returned

Return type

ReturnCode_t

Returns

RETCODE_OK


Overload 2:

This operation retrieves the default value of the DomainParticipant QoS, that is, the QoS policies which will be used for newly created DomainParticipant entities in the case where the QoS policies are defaulted in the create_participant operation. The values retrieved get_default_participant_qos will match the set of values specified on the last successful call to set_default_participant_qos, or else, if the call was never made, the default values.

Return type

DomainParticipantQos

Returns

A reference to the default DomainParticipantQos

static get_instance()

Returns the DomainParticipantFactory singleton.

Return type

DomainParticipantFactory

Returns

The DomainParticipantFactory singleton.

get_participant_qos_from_profile(profile_name, qos)

Fills the DomainParticipantQos with the values of the XML profile.

Parameters
  • profile_name (string) – DomainParticipant profile name.

  • qos (DomainParticipantQos) – DomainParticipantQos object where the qos is returned.

Return type

ReturnCode_t

Returns

RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise.

get_qos(qos)

This operation returns the value of the DomainParticipantFactory QoS policies.

Parameters

qos (DomainParticipantFactoryQos) – DomaParticipantFactoryQos reference where the qos is returned

Return type

ReturnCode_t

Returns

RETCODE_OK

load_XML_profiles_file(xml_profile_file)

Load profiles from XML file.

Parameters

xml_profile_file (string) – XML profile file.

Return type

ReturnCode_t

Returns

RETCODE_OK if it is correctly loaded, RETCODE_ERROR otherwise.

load_XML_profiles_string(data, length)

Load profiles from XML string.

Parameters
  • data (string) – buffer containing xml data.

  • length (int) – length of data

Return type

ReturnCode_t

Returns

RETCODE_OK if it is correctly loaded, RETCODE_ERROR otherwise.

load_profiles()

Load profiles from default XML file.

Return type

ReturnCode_t

Returns

RETCODE_OK

lookup_participant(domain_id)

This operation retrieves a previously created DomainParticipant belonging to specified domain_id. If no such DomainParticipant exists, the operation will return ‘nullptr’. If multiple DomainParticipant entities belonging to that domain_id exist, then the operation will return one of them. It is not specified which one.

Parameters

domain_id (int) –

Return type

DomainParticipant

Returns

previously created DomainParticipant within the specified domain

lookup_participants(domain_id)

Returns all participants that belongs to the specified domain_id.

Parameters

domain_id (int) –

Return type

std::vector< eprosima::fastdds::dds::DomainParticipant *,std::allocator< eprosima::fastdds::dds::DomainParticipant * > >

Returns

previously created DomainParticipants within the specified domain

set_default_participant_qos(qos)

This operation sets a default value of the DomainParticipant QoS policies which will be used for newly created DomainParticipant entities in the case where the QoS policies are defaulted in the create_participant operation.

This operation will check that the resulting policies are self consistent; if they are not, the operation will have no effect and return INCONSISTENT_POLICY.

The special value PARTICIPANT_QOS_DEFAULT may be passed to this operation to indicate that the default QoS should be reset back to the initial values the factory would use, that is the values that would be used if the set_default_participant_qos operation had never been called.

Parameters

qos (DomainParticipantQos) – DomainParticipantQos to be set

Return type

ReturnCode_t

Returns

RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.

set_qos(qos)

This operation sets the value of the DomainParticipantFactory QoS policies. These policies control the behavior of the object a factory for entities.

Note that despite having QoS, the DomainParticipantFactory is not an Entity.

This operation will check that the resulting policies are self consistent; if they are not, the operation will have no effect and return INCONSISTENT_POLICY.

Parameters

qos (DomainParticipantFactoryQos) – DomainParticipantFactoryQos to be set.

Return type

ReturnCode_t

Returns

RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly.

property thisown

The membership flag