Sxta.Rti1516.BoostrapProtocol.InteractionManager.AddReceiveInteractionDelegate C# (CSharp) Method

AddReceiveInteractionDelegate() public method

Adds a delegate for the process of interactions.
public AddReceiveInteractionDelegate ( Type msgType, string name, ReceiveInteractionDelegate interactionDelegate ) : void
msgType Type
name string
interactionDelegate ReceiveInteractionDelegate
return void
        public void AddReceiveInteractionDelegate(Type msgType, string name, ReceiveInteractionDelegate interactionDelegate)
        {
            InteractionClassDescriptor icd = DescriptorManager.GetInteractionClassDescriptor(name);

            interactionClassDescriptorMap[msgType] = icd;
            interactionDelegates[msgType] = interactionDelegate;

            TransportationType transportation = icd.Transportation;
            if (transportation != null)
            {
                interactionChannelMap[msgType] = transportation;
            }
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>Constructor.</summary>
        /// <param name="interactionManager"> the run-time interaction manager</param>
        public BootstrapObjectModelInteractionHelper(InteractionManager interactionManager)
        {
            Type objType;

            manager = interactionManager;
            XrtiSerializerManager serializerMngr = manager.SerializerManager;
            long handle;

            objType = typeof(HLAattributeHandleValuePair);
            handle  = -10;
            serializerMngr.RegisterSerializer(objType, handle, new HLAattributeHandleValuePairXrtiSerializer(serializerMngr));

            objType = typeof(BaseInteractionMessage);
            manager.AddReceiveInteractionDelegate(objType, "BaseInteraction", new InteractionManager.ReceiveInteractionDelegate(this.ReceiveInteraction));
            handle = ((XRTIInteractionClassHandle)manager.DescriptorManager.GetInteractionClassDescriptor("BaseInteraction").Handle).Identifier;
            serializerMngr.RegisterSerializer(objType, handle, new BaseInteractionMessageXrtiSerializer(serializerMngr));

            objType = typeof(HLAGenericInteractionMessage);
            manager.AddReceiveInteractionDelegate(objType, "HLAGenericInteraction", new InteractionManager.ReceiveInteractionDelegate(this.ReceiveInteraction));
            handle = ((XRTIInteractionClassHandle)manager.DescriptorManager.GetInteractionClassDescriptor("HLAGenericInteraction").Handle).Identifier;
            serializerMngr.RegisterSerializer(objType, handle, new HLAGenericInteractionMessageXrtiSerializer(serializerMngr));
#if POSIBLE_MEJORA
            bootstrapInteractionsDelegates[handle].Add(objType, new InteractionDispatcher.ReceiveInteractionDelegate(this.OnReceiveHLAupdateAttributeValuesReliableBase));
#endif
            objType = typeof(HLAinteractionFragmentMessage);
            manager.AddReceiveInteractionDelegate(objType, "HLAinteractionFragment", new InteractionManager.ReceiveInteractionDelegate(this.ReceiveInteraction));
            handle = ((XRTIInteractionClassHandle)manager.DescriptorManager.GetInteractionClassDescriptor("HLAinteractionFragment").Handle).Identifier;
            serializerMngr.RegisterSerializer(objType, handle, new HLAinteractionFragmentMessageXrtiSerializer(serializerMngr));

            objType = typeof(HLAcontinueMessage);
            manager.AddReceiveInteractionDelegate(objType, "HLAcontinue", new InteractionManager.ReceiveInteractionDelegate(this.ReceiveInteraction));
            handle = ((XRTIInteractionClassHandle)manager.DescriptorManager.GetInteractionClassDescriptor("HLAcontinue").Handle).Identifier;
            serializerMngr.RegisterSerializer(objType, handle, new HLAcontinueMessageXrtiSerializer(serializerMngr));

            objType = typeof(PeerAdvertisementInteractionMessage);
            manager.AddReceiveInteractionDelegate(objType, "PeerAdvertisementInteraction", new InteractionManager.ReceiveInteractionDelegate(this.ReceiveInteraction));
            handle = ((XRTIInteractionClassHandle)manager.DescriptorManager.GetInteractionClassDescriptor("PeerAdvertisementInteraction").Handle).Identifier;
            serializerMngr.RegisterSerializer(objType, handle, new PeerAdvertisementInteractionMessageXrtiSerializer(serializerMngr));
        }
All Usage Examples Of Sxta.Rti1516.BoostrapProtocol.InteractionManager::AddReceiveInteractionDelegate