Esempio n. 1
0
        /**
         * Register the four builtin topics:
         *     "DDS::ParticipantBuiltinTopicData"
         *     "DDS::TopicBuiltinTopicData"
         *     "DDS::PublicationBuiltinTopicData"
         *     "DDS::SubscriptionBuiltinTopicData"
         */
        internal static ReturnCode BuiltinTopicRegisterTypeSupport(DomainParticipant participant)
        {
            ReturnCode result;

            DDS.ParticipantBuiltinTopicDataTypeSupport DDSParticipant =
                    new DDS.ParticipantBuiltinTopicDataTypeSupport();
            result = DDSParticipant.RegisterType(participant, DDSParticipant.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                        DDS.OpenSplice.ReportType.OS_ERROR,
                        "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                        "DDS/OpenSplice/DomainParticipant.cs",
                        DDS.ErrorCode.Error,
                        "Failed to register builtin topic: DCPSParticipant");
            } else {
               participant.ParticipantDataMarshaler = DatabaseMarshaler.GetMarshaler(
                       participant, DDSParticipant.TypeSpec);
            }

            DDS.TopicBuiltinTopicDataTypeSupport DDSTopic =
                    new DDS.TopicBuiltinTopicDataTypeSupport();
            result = DDSTopic.RegisterType(participant, DDSTopic.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                        DDS.OpenSplice.ReportType.OS_ERROR,
                        "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                        "DDS/OpenSplice/DomainParticipant.cs",
                        DDS.ErrorCode.Error,
                        "Failed to register builtin topic: DCPSTopic");
            } else {
               participant.TopicDataMarshaler = DatabaseMarshaler.GetMarshaler(
                       participant, DDSTopic.TypeSpec);
            }

            DDS.PublicationBuiltinTopicDataTypeSupport DDSPublication =
                    new DDS.PublicationBuiltinTopicDataTypeSupport();
            result = DDSPublication.RegisterType(participant, DDSPublication.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                        DDS.OpenSplice.ReportType.OS_ERROR,
                        "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                        "DDS/OpenSplice/DomainParticipant.cs",
                        DDS.ErrorCode.Error,
                        "Failed to register builtin topic: DCPSPublication");
            }

            DDS.SubscriptionBuiltinTopicDataTypeSupport DDSSubscription =
                    new DDS.SubscriptionBuiltinTopicDataTypeSupport();
            result = DDSSubscription.RegisterType(participant, DDSSubscription.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                        DDS.OpenSplice.ReportType.OS_ERROR,
                        "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                        "DDS/OpenSplice/DomainParticipant.cs",
                        DDS.ErrorCode.Error,
                        "Failed to register builtin topic: DCPSSubscription");
            }
            return result;
        }
Esempio n. 2
0
        /**
         * Register the four builtin topics:
         *     "DDS::ParticipantBuiltinTopicData"
         *     "DDS::TopicBuiltinTopicData"
         *     "DDS::PublicationBuiltinTopicData"
         *     "DDS::SubscriptionBuiltinTopicData"
         */
        internal static ReturnCode BuiltinTopicRegisterTypeSupport(DomainParticipant participant)
        {
            ReturnCode result;

            DDS.ParticipantBuiltinTopicDataTypeSupport DDSParticipant =
                new DDS.ParticipantBuiltinTopicDataTypeSupport();
            result = DDSParticipant.RegisterType(participant, DDSParticipant.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                    DDS.OpenSplice.ReportType.OS_ERROR,
                    "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                    "DDS/OpenSplice/DomainParticipant.cs",
                    DDS.ErrorCode.Error,
                    "Failed to register builtin topic: DCPSParticipant");
            }
            else
            {
                participant.ParticipantDataMarshaler = DatabaseMarshaler.GetMarshaler(
                    participant, DDSParticipant.TypeSpec);
            }

            DDS.TopicBuiltinTopicDataTypeSupport DDSTopic =
                new DDS.TopicBuiltinTopicDataTypeSupport();
            result = DDSTopic.RegisterType(participant, DDSTopic.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                    DDS.OpenSplice.ReportType.OS_ERROR,
                    "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                    "DDS/OpenSplice/DomainParticipant.cs",
                    DDS.ErrorCode.Error,
                    "Failed to register builtin topic: DCPSTopic");
            }
            else
            {
                participant.TopicDataMarshaler = DatabaseMarshaler.GetMarshaler(
                    participant, DDSTopic.TypeSpec);
            }

            DDS.PublicationBuiltinTopicDataTypeSupport DDSPublication =
                new DDS.PublicationBuiltinTopicDataTypeSupport();
            result = DDSPublication.RegisterType(participant, DDSPublication.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                    DDS.OpenSplice.ReportType.OS_ERROR,
                    "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                    "DDS/OpenSplice/DomainParticipant.cs",
                    DDS.ErrorCode.Error,
                    "Failed to register builtin topic: DCPSPublication");
            }

            DDS.SubscriptionBuiltinTopicDataTypeSupport DDSSubscription =
                new DDS.SubscriptionBuiltinTopicDataTypeSupport();
            result = DDSSubscription.RegisterType(participant, DDSSubscription.TypeName);
            if (result != ReturnCode.Ok)
            {
                DDS.OpenSplice.OS.Report(
                    DDS.OpenSplice.ReportType.OS_ERROR,
                    "DDS.OpenSplice.DomainParticipant.builtinTopicRegisterTypeSupport",
                    "DDS/OpenSplice/DomainParticipant.cs",
                    DDS.ErrorCode.Error,
                    "Failed to register builtin topic: DCPSSubscription");
            }
            return(result);
        }