Ejemplo n.º 1
0
        internal void FromNative(SubscriberQosWrapper 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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the <see cref="Subscriber" /> QoS policies.
        /// </summary>
        /// <param name="qos">The <see cref="SubscriberQos" /> to be filled up.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode GetQos(SubscriberQos qos)
        {
            if (qos == null)
            {
                return(ReturnCode.BadParameter);
            }

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

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

            qos.Release();

            return(ret);
        }
Ejemplo n.º 3
0
        internal SubscriberQosWrapper ToNative()
        {
            var data = new SubscriberQosWrapper
            {
                Presentation  = Presentation,
                EntityFactory = EntityFactory,
            };

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

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

            return(data);
        }
Ejemplo n.º 4
0
 public static extern ReturnCode SetQos(IntPtr sub, [MarshalAs(UnmanagedType.Struct), In] SubscriberQosWrapper qos);