Ejemplo n.º 1
0
        internal TopicQosWrapper ToNative()
        {
            var data = new TopicQosWrapper
            {
                Durability        = Durability,
                DurabilityService = DurabilityService,
                Deadline          = Deadline,
                LatencyBudget     = LatencyBudget,
                Liveliness        = Liveliness,
                Reliability       = Reliability,
                DestinationOrder  = DestinationOrder,
                History           = History,
                ResourceLimits    = ResourceLimits,
                TransportPriority = TransportPriority,
                Lifespan          = Lifespan,
                Ownership         = Ownership,
            };

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

            return(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the <see cref="Topic" /> QoS policies.
        /// </summary>
        /// <param name="qos">The <see cref="TopicQos" /> to be filled up.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode GetQos(TopicQos qos)
        {
            if (qos == null)
            {
                return(ReturnCode.BadParameter);
            }

            TopicQosWrapper 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 void FromNative(TopicQosWrapper wrapper)
        {
            Durability        = wrapper.Durability;
            DurabilityService = wrapper.DurabilityService;
            Deadline          = wrapper.Deadline;
            LatencyBudget     = wrapper.LatencyBudget;
            Liveliness        = wrapper.Liveliness;
            Reliability       = wrapper.Reliability;
            DestinationOrder  = wrapper.DestinationOrder;
            History           = wrapper.History;
            ResourceLimits    = wrapper.ResourceLimits;
            TransportPriority = wrapper.TransportPriority;
            Lifespan          = wrapper.Lifespan;
            Ownership         = wrapper.Ownership;

            if (TopicData == null)
            {
                TopicData = new TopicDataQosPolicy();
            }
            TopicData.FromNative(wrapper.TopicData);
        }
Ejemplo n.º 4
0
 public static extern ReturnCode SetQos(IntPtr t, [MarshalAs(UnmanagedType.Struct), In] TopicQosWrapper qos);