/// <summary> /// Sets a default value of the <see cref="DomainParticipant" /> QoS policies which will be used for newly created /// <see cref="DomainParticipant" /> entities in the case where the QoS policies are defaulted in the CreateParticipant operation. /// </summary> /// <remarks> /// This operation will check that the resulting policies are self consistent; if they are not, /// the operation will have no effect and return <see cref="ReturnCode.InconsistentPolicy" />. /// </remarks> /// <param name="qos">The default <see cref="DomainParticipantQos" /> to be set.</param> /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns> public ReturnCode SetDefaultDomainParticipantQos(DomainParticipantQos qos) { if (qos is null) { return(ReturnCode.BadParameter); } var qosNative = qos.ToNative(); var ret = UnsafeNativeMethods.SetDefaultDomainParticipantQos(_native, qosNative); qos.Release(); return(ret); }
/// <summary> /// Gets the default value of the <see cref="DomainParticipant" /> QoS, that is, the QoS policies which will be used for /// newly created <see cref="DomainParticipant" /> entities in the case where the QoS policies are defaulted in the CreateParticipant operation. /// </summary> /// <remarks> /// The values retrieved <see cref="GetDefaultDomainParticipantQos(DomainParticipantQos)" /> will match the set of values specified on the last successful call to /// <see cref="SetDefaultDomainParticipantQos(DomainParticipantQos)" />, or else, if the call was never made, the default values defined by the DDS standard. /// </remarks> /// <param name="qos">The <see cref="DomainParticipantQos" /> to be filled up.</param> /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns> public ReturnCode GetDefaultDomainParticipantQos(DomainParticipantQos qos) { if (qos is null) { return(ReturnCode.BadParameter); } DomainParticipantQosWrapper qosWrapper = default; var ret = UnsafeNativeMethods.GetDefaultDomainParticipantQos(_native, ref qosWrapper); if (ret == ReturnCode.Ok) { qos.FromNative(qosWrapper); } qos.Release(); return(ret); }