Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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;
        }