public override void InitEmbeddedMarshalers(IDomainParticipant participant)
 {
     if (attr1Marshaler == null)
     {
         attr1Marshaler = DatabaseMarshaler.GetMarshaler(participant, typeof(DM.__l_WGS84)) as DM.__l_WGS84Marshaler;
         if (attr1Marshaler == null)
         {
             attr1Marshaler = new DM.__l_WGS84Marshaler();
             DatabaseMarshaler.Add(participant, typeof(DM.__l_WGS84), attr1Marshaler);
             attr1Marshaler.InitEmbeddedMarshalers(participant);
         }
     }
     if (attr4Marshaler == null)
     {
         attr4Marshaler = DatabaseMarshaler.GetMarshaler(participant, typeof(DM.__EGI_Data)) as DM.__EGI_DataMarshaler;
         if (attr4Marshaler == null)
         {
             attr4Marshaler = new DM.__EGI_DataMarshaler();
             DatabaseMarshaler.Add(participant, typeof(DM.__EGI_Data), attr4Marshaler);
             attr4Marshaler.InitEmbeddedMarshalers(participant);
         }
     }
     if (attr5Marshaler == null)
     {
         attr5Marshaler = DatabaseMarshaler.GetMarshaler(participant, typeof(__Aircraft)) as __AircraftMarshaler;
         if (attr5Marshaler == null)
         {
             attr5Marshaler = new __AircraftMarshaler();
             DatabaseMarshaler.Add(participant, typeof(__Aircraft), attr5Marshaler);
             attr5Marshaler.InitEmbeddedMarshalers(participant);
         }
     }
 }
예제 #2
0
        // TODO: This operation is currently not thread-safe.
        public virtual ReturnCode RegisterType(
            IDomainParticipant participant,
            string typeName,
            DatabaseMarshaler marshaler)
        {
            ReturnCode result = ReturnCode.BadParameter;

            if (participant != null && marshaler != null)
            {
                // Now that a marshaler is present,
                result = AttachMarshalerDelegates(GapiPeer, marshaler);
                if (result == ReturnCode.Ok)
                {
                    IntPtr domainObj = (participant as DomainParticipant).GapiPeer;
                    result = Gapi.FooTypeSupport.register_type(
                        GapiPeer,
                        domainObj,
                        typeName);

                    if (result == ReturnCode.Ok)
                    {
                        DatabaseMarshaler.Add(participant, dataType, marshaler);
                        marshaler.InitEmbeddedMarshalers(participant);
                    }
                }
            }

            return(result);
        }
예제 #3
0
        private void loadQosInputAttr(
            OpenSplice.CustomMarshalers.DatabaseMarshaler qosMarshaler,
            Type dataType,
            ref OpenSplice.Common.cmn_qosInputAttr attr)
        {
            DatabaseMarshaler.Add(null, dataType, qosMarshaler);
            qosMarshaler.InitEmbeddedMarshalers(null);

            attr.copyOut = qosMarshaler.CopyOutDelegate;
        }
 public override void InitEmbeddedMarshalers(IDomainParticipant participant)
 {
     if (attr2Marshaler == null)
     {
         attr2Marshaler = DatabaseMarshaler.GetMarshaler(participant, typeof(DM.__l_WGS84)) as DM.__l_WGS84Marshaler;
         if (attr2Marshaler == null)
         {
             attr2Marshaler = new DM.__l_WGS84Marshaler();
             DatabaseMarshaler.Add(participant, typeof(DM.__l_WGS84), attr2Marshaler);
             attr2Marshaler.InitEmbeddedMarshalers(participant);
         }
     }
 }
예제 #5
0
        public virtual ReturnCode RegisterType(
            IDomainParticipant participant,
            string typeName,
            DatabaseMarshaler marshaler)
        {
            ReturnCode        result = ReturnCode.BadParameter;
            DomainParticipant dp;

            ReportStack.Start();
            if (participant == null)
            {
                ReportStack.Report(result, "domain '<NULL>' is invalid.");
            }
            else if (marshaler == null)
            {
                ReportStack.Report(result, "marshaler '<NULL>' is invalid.");
            }
            else
            {
                dp = participant as DomainParticipant;
                if (dp == null)
                {
                    ReportStack.Report(result, "domain is invalid, not of type " +
                                       "DDS::OpenSplice::DomainParticipant");
                }
                else
                {
                    if (typeName == null)
                    {
                        typeName = this.typeName;
                    }
                    result = dp.nlReq_LoadTypeSupport(this, typeName);
                    if (result == ReturnCode.AlreadyDeleted)
                    {
                        result = ReturnCode.BadParameter;
                    }
                    else
                    {
                        DatabaseMarshaler.Add(dp, dataType, marshaler);
                        marshaler.InitEmbeddedMarshalers(dp);
                    }
                }
            }
            ReportStack.Flush(null, result != ReturnCode.Ok);
            return(result);
        }