コード例 #1
0
        /// <summary>
        /// This operation gets the default DomainParticipantQos of the DomainParticipantFactory
        /// </summary>
        /// <remarks>
        /// This operation gets the default DomainParticipantQos of the
        /// DomainParticipantFactory (that is the struct with the QosPolicy settings)
        /// which is used for newly created IDomainParticipant objects, in case no QoS is used
        /// in the CreateParticipant operation.
        ///
        /// The application must provide the DomainParticipantQos struct in which the
        /// QosPolicy settings can be stored and provide a reference to the struct. The
        /// operation writes the default QosPolicy settings to the struct referenced to by qos.<br>
        /// Any settings in the struct are overwritten.<br>
        /// The values retrieved by this operation match the set of values specified on the last
        /// successful call to SetDefaultParticipantQos(), or, if the call was never
        /// made, the default values as specified for each QosPolicy setting.
        /// </remarks>
        /// @param qos A reference to the DomainParticipantQos in which the default
        ///            DomainParticipantQos for the IDomainParticipant is written
        /// @return DDS.ReturnCode Ok - The new default DomainParticipantQos is set
        /// @return DDS.ReturnCode Error - An internal error has occured
        /// @return DDS.ReturnCode OutOfResources - The DDS ran out of resources to complete this operation
        public ReturnCode GetDefaultParticipantQos(ref DomainParticipantQos qos)
        {
            ReturnCode result;

            using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler =
                       new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
            {
                lock (singleton_lock)
                {
                    ReportStack.Start();
                    result = marshaler.CopyIn(defaultParticipantQos);
                    if (result == ReturnCode.Ok)
                    {
                        marshaler.CopyOut(ref qos);
                        // Listener scheduling qospolicy is not part of User Layer, so obtain it separately from participant.
                        if (qos.ListenerScheduling.SchedulingClass == null)
                        {
                            qos.ListenerScheduling.SchedulingClass = new SchedulingClassQosPolicy();
                        }
                        qos.ListenerScheduling.SchedulingClass.Kind = this.defaultParticipantQos.ListenerScheduling.SchedulingClass.Kind;
                        if (qos.ListenerScheduling.SchedulingPriorityKind == null)
                        {
                            qos.ListenerScheduling.SchedulingPriorityKind = new SchedulingPriorityQosPolicy();
                        }
                        qos.ListenerScheduling.SchedulingPriorityKind.Kind = this.defaultParticipantQos.ListenerScheduling.SchedulingPriorityKind.Kind;
                        qos.ListenerScheduling.SchedulingPriority          = this.defaultParticipantQos.ListenerScheduling.SchedulingPriority;
                    }
                    ReportStack.Flush(null, result != ReturnCode.Ok);
                }
            }

            return(result);
        }
コード例 #2
0
        /// @cond
        /// Constructor for DomainParticipantFactory.
        /// Only to be used by the static <code>GetInstance</code> operation.
        protected DomainParticipantFactory()
        {
            DDS.ReturnCode result;

            // Init default ParticipantFactoryQos and default ParticipantQos.
            using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler =
                       new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
            {
                result = marshaler.CopyIn(QosManager.defaultDomainParticipantQos);
                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref defaultParticipantQos);
                }
            }
            myQos.EntityFactory = new EntityFactoryQosPolicy();
            myQos.EntityFactory.AutoenableCreatedEntities = true;
        }
コード例 #3
0
        public ReturnCode GetDefaultParticipantQos(ref DomainParticipantQos qos)
        {
            ReturnCode result;

            using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler =
                       new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
            {
                // Invoke the corresponding gapi function.
                result = OpenSplice.Gapi.DomainParticipantFactory.get_default_participant_qos(GapiPeer, marshaler.GapiPtr);

                // When no error occured, copy the QoS settings from the gapi Qos representation.
                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref qos);
                }
            }

            return(result);
        }
コード例 #4
0
        /// <summary>
        /// This operation sets the default DomainParticipantQos of the DomainParticipantFactory.
        /// </summary>
        /// <remarks>
        /// This operation sets the default DomainParticipantQos of the DomainParticipantFactory
        /// (that is the struct with the QosPolicy settings) which is used for newly created
        /// IDomainParticipant objects, in case no QoS was provided in the CreateParticipant operation.
        ///
        /// The DomainParticipantQos is always self consistent, because its policies do not
        /// depend on each other. <br>
        /// This means this operation never returns the ReturnCode InconsistentPolicy.
        ///
        /// The values set by this operation are returned by GetDefaultParticipantQos().
        /// </remarks>
        /// @param qos The DomainParticipantQos which contains the new default
        ///            DomainParticipantQos for the newly created DomainParticipants
        /// @return DDS.ReturnCode Ok - The new default DomainParticipantQos is set
        /// @return DDS.ReturnCode Error - An internal error has occured
        /// @return DDS.ReturnCode OutOfResources - The DDS ran out of resources to complete this operation
        public ReturnCode SetDefaultParticipantQos(DomainParticipantQos qos)
        {
            ReturnCode result;

            lock (singleton_lock)
            {
                ReportStack.Start();
                result = QosManager.checkQos(qos);
                if (result == DDS.ReturnCode.Ok)
                {
                    using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler =
                               new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
                    {
                        result = marshaler.CopyIn(qos);
                        if (result == ReturnCode.Ok)
                        {
                            marshaler.CopyOut(ref defaultParticipantQos);
                            // Listener scheduling qospolicy is not part of User Layer, so obtain it separately from participant.
                            if (qos.ListenerScheduling.SchedulingClass == null)
                            {
                                return(ReturnCode.BadParameter);
                            }
                            this.defaultParticipantQos.ListenerScheduling.SchedulingClass.Kind = qos.ListenerScheduling.SchedulingClass.Kind;
                            if (qos.ListenerScheduling.SchedulingPriorityKind == null)
                            {
                                return(ReturnCode.BadParameter);
                            }
                            this.defaultParticipantQos.ListenerScheduling.SchedulingPriorityKind.Kind = qos.ListenerScheduling.SchedulingPriorityKind.Kind;
                            this.defaultParticipantQos.ListenerScheduling.SchedulingPriority          = qos.ListenerScheduling.SchedulingPriority;
                        }
                    }
                }
                ReportStack.Flush(null, result != ReturnCode.Ok);
            }
            return(result);
        }
コード例 #5
0
        public ReturnCode GetDefaultParticipantQos(ref DomainParticipantQos qos)
        {
            ReturnCode result;

            using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler = 
                    new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
            {
                // Invoke the corresponding gapi function.
                result = OpenSplice.Gapi.DomainParticipantFactory.get_default_participant_qos(GapiPeer, marshaler.GapiPtr);

                // When no error occured, copy the QoS settings from the gapi Qos representation.
                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref qos);
                }
            }

            return result;
        }
コード例 #6
0
ファイル: DomainParticipant.cs プロジェクト: eax/opensplice
        public ReturnCode GetQos(ref DomainParticipantQos qos)
        {
            ReturnCode result;

            using (OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler marshaler =
                    new OpenSplice.CustomMarshalers.DomainParticipantQosMarshaler())
            {
                result = Gapi.DomainParticipant.get_qos(
                        GapiPeer,
                        marshaler.GapiPtr);

                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref qos);
                }
            }

            return result;
        }