示例#1
0
        internal void FromNative(PublisherQosWrapper wrapper)
        {
            Presentation  = wrapper.Presentation;
            EntityFactory = wrapper.EntityFactory;

            if (GroupData == null)
            {
                GroupData = new GroupDataQosPolicy();
            }
            GroupData.FromNative(wrapper.GroupData);

            if (Partition == null)
            {
                Partition = new PartitionQosPolicy();
            }
            Partition.FromNative(wrapper.Partition);
        }
示例#2
0
        /// <summary>
        /// Gets the <see cref="Publisher" /> QoS policies.
        /// </summary>
        /// <param name="qos">The <see cref="PublisherQos" /> to be filled up.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode GetQos(PublisherQos qos)
        {
            if (qos == null)
            {
                return(ReturnCode.BadParameter);
            }

            PublisherQosWrapper qosWrapper = default;
            var ret = UnsafeNativeMethods.GetQos(_native, ref qosWrapper);

            if (ret == ReturnCode.Ok)
            {
                qos.FromNative(qosWrapper);
            }

            qos.Release();

            return(ret);
        }
示例#3
0
        internal PublisherQosWrapper ToNative()
        {
            var data = new PublisherQosWrapper
            {
                Presentation  = Presentation,
                EntityFactory = EntityFactory,
            };

            if (GroupData != null)
            {
                data.GroupData = GroupData.ToNative();
            }

            if (Partition != null)
            {
                data.Partition = Partition.ToNative();
            }

            return(data);
        }
示例#4
0
 public static extern ReturnCode SetQos(IntPtr pub, [MarshalAs(UnmanagedType.Struct), In] PublisherQosWrapper qos);