Exemplo n.º 1
0
        public ReturnCode SetDefaultDataReaderQos(DataReaderQos qos)
        {
            ReturnCode result = DDS.ReturnCode.AlreadyDeleted;

            ReportStack.Start();
            lock (this)
            {
                if (this.rlReq_isAlive)
                {
                    result = QosManager.checkQos(qos);
                    if (result == DDS.ReturnCode.Ok)
                    {
                        using (OpenSplice.CustomMarshalers.DataReaderQosMarshaler marshaler =
                                   new OpenSplice.CustomMarshalers.DataReaderQosMarshaler())
                        {
                            result = marshaler.CopyIn(qos);
                            if (result == ReturnCode.Ok)
                            {
                                marshaler.CopyOut(ref defaultDataReaderQos);
                            }
                        }
                    }
                }
            }
            ReportStack.Flush(this, result != ReturnCode.Ok);
            return(result);
        }
Exemplo n.º 2
0
        public ReturnCode GetQos(ref DataReaderQos qos)
        {
            ReturnCode result  = DDS.ReturnCode.AlreadyDeleted;
            IntPtr     userQos = IntPtr.Zero;

            ReportStack.Start();
            if (this.rlReq_isAlive)
            {
                result = uResultToReturnCode(
                    User.DataReader.GetQos(rlReq_UserPeer, ref userQos));
                if (result == ReturnCode.Ok)
                {
                    using (OpenSplice.CustomMarshalers.DataReaderQosMarshaler marshaler =
                               new OpenSplice.CustomMarshalers.DataReaderQosMarshaler(userQos, true))
                    {
                        marshaler.CopyOut(ref qos);
                    }
                }
                else
                {
                    ReportStack.Report(result, "Could not copy DataReaderQos.");
                }
            }
            ReportStack.Flush(this, result != ReturnCode.Ok);
            return(result);
        }
Exemplo n.º 3
0
        internal Subscriber()
        {
            DDS.ReturnCode result;

            using (OpenSplice.CustomMarshalers.DataReaderQosMarshaler marshaler =
                       new OpenSplice.CustomMarshalers.DataReaderQosMarshaler())
            {
                result = marshaler.CopyIn(QosManager.defaultDataReaderQos);
                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref defaultDataReaderQos);
                }
            }
        }
Exemplo n.º 4
0
        public ReturnCode GetQos(ref DataReaderQos qos)
        {
            ReturnCode result;

            using (OpenSplice.CustomMarshalers.DataReaderQosMarshaler marshaler =
                       new OpenSplice.CustomMarshalers.DataReaderQosMarshaler())
            {
                result = Gapi.DataReader.get_qos(GapiPeer, marshaler.GapiPtr);
                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref qos);
                }
            }

            return(result);
        }
Exemplo n.º 5
0
        public ReturnCode CopyFromTopicQos(ref DataReaderQos dataReaderQos, TopicQos topicQos)
        {
            ReturnCode result = ReturnCode.Ok;

            if (dataReaderQos == null)
            {
                result = GetDefaultDataReaderQos(ref dataReaderQos);
            }

            if (result == ReturnCode.Ok)
            {
                using (OpenSplice.CustomMarshalers.TopicQosMarshaler marshaler =
                           new OpenSplice.CustomMarshalers.TopicQosMarshaler())
                {
                    result = marshaler.CopyIn(topicQos);
                    if (result == ReturnCode.Ok)
                    {
                        using (OpenSplice.CustomMarshalers.DataReaderQosMarshaler dataReaderMarshaler =
                                   new OpenSplice.CustomMarshalers.DataReaderQosMarshaler())
                        {
                            result = dataReaderMarshaler.CopyIn(dataReaderQos);
                            if (result == ReturnCode.Ok)
                            {
                                result = OpenSplice.Gapi.Subscriber.copy_from_topic_qos(
                                    GapiPeer,
                                    dataReaderMarshaler.GapiPtr,
                                    marshaler.GapiPtr);

                                if (result == ReturnCode.Ok)
                                {
                                    dataReaderMarshaler.CopyOut(ref dataReaderQos);
                                }
                            }
                        }
                    }
                }
            }

            return(result);
        }