Beispiel #1
0
 public DiscoverObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, long federateHandle, long interactionIndex, IObjectInstanceHandle theObjectParam, IObjectClassHandle theObjectClassParam, string objectNameParam)
     : base(federate, time, federateHandle, interactionIndex)
 {
     this.theObject      = theObjectParam;
     this.theObjectClass = theObjectClassParam;
     this.objectName     = objectNameParam;
 }
Beispiel #2
0
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, IDictionary <string, object> methodNameValueMap, ILogicalTime time)
        {
            HLAattributeHandleValuePair[] attributeHandleValuePair = CreateAttributesHandleValuePairList(methodNameValueMap, instanceHandle);

            // TODO ANGEL: que pasa con userSuppliedTag
            rti.UpdateAttributeValues(instanceHandle, attributeHandleValuePair, new byte[1], time);
        }
Beispiel #3
0
 public DiscoverObjectInstanceCallback(IFederateAmbassador federate, IObjectInstanceHandle theObjectParam, IObjectClassHandle theObjectClassParam, string objectNameParam)
     : base(federate)
 {
     this.theObject      = theObjectParam;
     this.theObjectClass = theObjectClassParam;
     this.objectName     = objectNameParam;
 }
Beispiel #4
0
 public ReflectAttributeValuesExtCallback(IFederateAmbassador federate, IObjectInstanceHandle theObjectParam, HLAattributeHandleValuePair[] theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate)
 {
     this.theObject       = theObjectParam;
     this.theAttributes   = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #5
0
 public RemoveObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, byte[] userSuppliedTagParam, OrderType sentOrderingParam)
     : base(federate, time)
 {
     this.theObject       = theObjectParam;
     this.userSuppliedTag = userSuppliedTagParam;
     this.sentOrdering    = sentOrderingParam;
 }
Beispiel #6
0
 public ProvideAttributeValueUpdateCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, IAttributeHandleSet theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate, time)
 {
     this.theObject       = theObjectParam;
     this.theAttributes   = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #7
0
 public ReflectAttributeValuesExtCallback(IFederateAmbassador federate, ILogicalTime time, long federateHandle, long interactionIndex, IObjectInstanceHandle theObjectParam, HLAattributeHandleValuePair[] theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate, time, federateHandle, interactionIndex)
 {
     this.theObject       = theObjectParam;
     this.theAttributes   = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #8
0
        public void TestObjectInstanceName()
        {
            // get the FOM handles //
            try
            {
                JoinFederation();

                IObjectClassHandle countryHandle = rtiAmbassador.GetObjectClassHandle("Country");
#if TODO
                IObjectClassHandle countryHandle = rtiAmbassador.GetObjectClassHandle("HLAobjectRoot.Country");
#endif
                rtiAmbassador.ReserveObjectInstanceName("Country1");
                IObjectInstanceHandle objHandle1 = rtiAmbassador.RegisterObjectInstance(countryHandle, "Country1");
                string objName = rtiAmbassador.GetObjectInstanceName(objHandle1);
                Assert.AreEqual("Country1", objName);

                IObjectInstanceHandle objHandle2 = rtiAmbassador.RegisterObjectInstance(countryHandle);
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error(e.Message);
                }
                Assert.Fail("Unexpected exception while testing object instances:" + e);
            }

            // clean up for the next test
            Resign();
        }
Beispiel #9
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="pName">the name of the object instance
        /// </param>
        /// <param name="pHandle">the handle of the object instance
        /// </param>
        /// <param name="pClassHandle">the handle of the object instance class
        /// </param>
        public ObjectInstanceDescriptor(System.String pName, IObjectInstanceHandle pHandle, IObjectClassHandle pClassHandle, long pFederationHandle)
        {
            name        = pName;
            handle      = pHandle;
            classHandle = pClassHandle;
            federationExecutionHandle = pFederationHandle;

            ownedAttributes = new XRTIAttributeHandleSet();
        }
Beispiel #10
0
 public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, IDictionary <string, object> methodNameValueMap)
 {
     if (log.IsDebugEnabled)
     {
         foreach (KeyValuePair <string, object> entry in methodNameValueMap)
         {
             log.Debug("The method " + entry.Key + " from object " + instanceHandle + " has been called; new value:" + entry.Value + "; parameter type = " + entry.Value.GetType());
         }
     }
 }
Beispiel #11
0
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, string methodName, object newValue)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("The method " + methodName + " from object " + instanceHandle + " has been called; new value:" + newValue + "; parameter type = " + newValue.GetType());
            }

            HLAattributeHandleValuePair[] attributeHandleValuePair = CreateAttributeHandleValuePairList(methodName, newValue, instanceHandle);

            // TODO ANGEL: que pasa con userSuppliedTag
            rti.UpdateAttributeValues(instanceHandle, attributeHandleValuePair, null);
        }
Beispiel #12
0
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, IDictionary <string, object> methodNameValueMap)
        {
            if (log.IsDebugEnabled)
            {
                Sxta.Rti1516.HLAAttributes.HLAobjectRoot obj = registedObjects[instanceHandle] as Sxta.Rti1516.HLAAttributes.HLAobjectRoot;
                log.Debug("The object is " + obj);

                foreach (KeyValuePair <string, object> entry in methodNameValueMap)
                {
                    log.Debug("The method " + entry.Key + " from object " + instanceHandle + " has been called; new value:" + entry.Value + "; parameter type = " + entry.Value.GetType());
                }
            }
        }
Beispiel #13
0
 public override void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
 {
     // TODO ANGEL: LOCK DUDOSO
     //lock (this)
     //{
     if (objectInstanceHandleProxyMap.ContainsKey(theObject))
     {
         object instance = objectInstanceHandleProxyMap[theObject];
         rti.objectManager.UpdateAttributeValuesProxyObject(instance, theAttributes);
     }
     else
     {
         if (log.IsErrorEnabled)
         {
             log.Error("Object " + theObject + " not found. Attributes to reflect: " + theAttributes);
         }
     }
     //}
 }
        public override void DiscoverObjectInstance(IObjectInstanceHandle theObject, IObjectClassHandle theObjectClass, string objectName)
        {
            long instanceHandle = ((XRTIObjectInstanceHandle)theObject).Identifier;
            long classHandle = ((XRTIObjectClassHandle)theObjectClass).Identifier;

            object proxy = rti.objectManager.CreateProxyObject(objectName, instanceHandle, classHandle);

            if (proxy != null)
            {
                RegisterObjectInstance(proxy);
            }
            else
            {
                throw new RTIinternalError("Type not found: " + objectName + ".");
            }
            if (OnNewObject != null)
            {
                if (log.IsInfoEnabled)
                    log.Info("Discovered a new object: " + proxy);
                OnNewObject(proxy);
            }
        }
Beispiel #15
0
        public override void DiscoverObjectInstance(IObjectInstanceHandle theObject, IObjectClassHandle theObjectClass, string objectName)
        {
            long instanceHandle = ((XRTIObjectInstanceHandle)theObject).Identifier;
            long classHandle    = ((XRTIObjectClassHandle)theObjectClass).Identifier;

            object proxy = rti.objectManager.CreateProxyObject(objectName, instanceHandle, classHandle);

            if (proxy != null)
            {
                RegisterObjectInstance(proxy);
            }
            else
            {
                throw new RTIinternalError("Type not found: " + objectName + ".");
            }
            if (OnNewObject != null)
            {
                if (log.IsInfoEnabled)
                {
                    log.Info("Discovered a new object: " + proxy);
                }
                OnNewObject(proxy);
            }
        }
Beispiel #16
0
 public virtual void AttributeOwnershipAcquisitionNotification(IObjectInstanceHandle theObject, IAttributeHandleSet securedAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #17
0
 public virtual void TurnUpdatesOnForObjectInstance(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #18
0
 public virtual void RequestAttributeOwnershipRelease(IObjectInstanceHandle theObject, IAttributeHandleSet candidateAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #19
0
 public virtual void RemoveObjectInstance(IObjectInstanceHandle theObject, byte[] userSuppliedTag, OrderType sentOrdering)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        private HLAattributeHandleValuePair[] CreateAttributesHandleValuePairList(IDictionary<string, object> methodNameValueMap, IObjectInstanceHandle instanceHandle)
        {
            HLAattributeHandleValuePair[] attributeHandleValuePairList = new HLAattributeHandleValuePair[methodNameValueMap.Count];

            ObjectInstanceDescriptor oid = rti.descriptorManager.GetObjectInstanceDescriptor(instanceHandle);
            IObjectClassHandle och = oid.ClassHandle;
            ObjectClassDescriptor ocd = rti.descriptorManager.GetObjectClassDescriptor(och);

            int count = 0;
            foreach (KeyValuePair<string, object> entry in methodNameValueMap)
            {
                if (log.IsDebugEnabled)
                    log.Debug("The method " + entry.Key + " from object " + instanceHandle + " has been called; new value:" + entry.Value + "; parameter type = " + entry.Value.GetType());

                attributeHandleValuePairList[count] = new HLAattributeHandleValuePair();
                attributeHandleValuePairList[count].AttributeHandle = ((XRTIAttributeHandle)ocd.GetAttributeDescriptor(entry.Key).Handle).Identifier;
                attributeHandleValuePairList[count].AttributeValue = entry.Value;
                count++;
            }

            return attributeHandleValuePairList;
        }
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, string methodName, object newValue, ILogicalTime time)
        {
            if (log.IsDebugEnabled)
                log.Debug("The method " + methodName + " from object " + instanceHandle + " has been called; new value:" + newValue + "; parameter type = " + newValue.GetType());

            HLAattributeHandleValuePair[] attributeHandleValuePair = CreateAttributeHandleValuePairList(methodName, newValue, instanceHandle);

            // TODO ANGEL: que pasa con userSuppliedTag
            rti.UpdateAttributeValues(instanceHandle, attributeHandleValuePair, null, time);
        }
Beispiel #22
0
 public ReflectAttributeValuesExtCallback(IFederateAmbassador federate, IObjectInstanceHandle theObjectParam, HLAattributeHandleValuePair[] theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate)
 {
     this.theObject = theObjectParam;
     this.theAttributes = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #23
0
 public virtual void InformAttributeOwnership(IObjectInstanceHandle theObject, IAttributeHandle theAttribute, IFederateHandle theOwner)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #24
0
 public virtual void AttributeIsOwnedByRTI(IObjectInstanceHandle theObject, IAttributeHandle theAttribute)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #25
0
        public override void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
        {
            // TODO ANGEL: LOCK DUDOSO
            lock (this)
            {
                base.ReflectAttributeValuesExt(theObject, theAttributes, userSuppliedTag, sentOrdering, theTransport);

                if (objectInstanceHandleProxyMap.ContainsKey(theObject))
                {
                    object instance = objectInstanceHandleProxyMap[theObject];

                    // TODO ANGEL: ¿Esto debería estar aquí o dentro de la funcionalidad del objectManager?
                    //             El problema es que si lo hace objectManager debe poder acceder al federationsMap del rti
                    foreach (HLAattributeHandleValuePair entry in theAttributes)
                    {
                        string attributeName = GetAttributeName(instance, entry.AttributeHandle);

                        // Checks if the object created is an instance of HLAfederation and its properties are modificated
                        if (instance is HLAfederation)
                        {
                            if (attributeName == "HLAfederationName")
                            {
                                rti.federationsMap.Add((string)entry.AttributeValue, instance as HLAfederation);
                            }
                            else if (attributeName == "HLAFDDID")
                            {
                                rti.interactionManager.RegisterHelperClass((string)entry.AttributeValue);
                            }
                        }

                        // Checks if the object created is an instance of HLAfederate and its properties are modificated
                        if (instance is HLAfederate)
                        {
                            if (attributeName == "HLAfederateHandle")
                            {
                                if (instance is Sxtafederate)
                                {
                                    Sxtafederate federate = instance as Sxtafederate;

                                    // TODO ANGEL: OJO! Implica que la propiedad HLAfederationNameJoined se haya recibido antes que ésta
                                    HLAfederateHandle federateHandle = (HLAfederateHandle)entry.AttributeValue;
                                    rti.federationsMap[federate.HLAfederationNameJoined].HLAfederatesinFederation.Add(federateHandle);
                                }
                            }

                            if (attributeName == "HLAfederationNameJoined")
                            {
                                if (instance is Sxtafederate)
                                {
                                    Sxtafederate federate = instance as Sxtafederate;

                                    HLAfederation federation = rti.federationsMap[federate.HLAfederationNameJoined];
                                    federate.Federation = federation;
                                }
                            }

                            /*
                             * if (attributeName == "HLAlogicalTime" || attributeName == "HLApendingTime"
                             || attributeName == "HLAlookahead" || attributeName == "HLAGALT" || attributeName == "HLALITS")
                             ||{
                             || //System.Threading.Monitor.Pulse(rti);
                             || //rti.PushFederates();
                             ||}
                             */
                        }
                    }
                }
            }
        }
Beispiel #26
0
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, IDictionary<string, object> methodNameValueMap)
        {
            if (log.IsDebugEnabled)
            {
                Sxta.Rti1516.HLAAttributes.HLAobjectRoot obj = registedObjects[instanceHandle] as Sxta.Rti1516.HLAAttributes.HLAobjectRoot;
                log.Debug("The object is " + obj);

                foreach (KeyValuePair<string, object> entry in methodNameValueMap)
                {
                    log.Debug("The method " + entry.Key + " from object " + instanceHandle + " has been called; new value:" + entry.Value + "; parameter type = " + entry.Value.GetType());
                }
            }
        }
Beispiel #27
0
 /// <summary> 
 /// Returns the descriptor for the object instance with the given handle.
 /// </summary>
 /// <param name="handle">the handle of the object instance
 /// </param>
 /// <returns> the object instance descriptor, or <code>null</code> if no such
 /// descriptor exists
 /// </returns>
 public virtual ObjectInstanceDescriptor GetObjectInstanceDescriptor(IObjectInstanceHandle handle)
 {
     return objectInstanceHandleDescriptorMap[handle];
 }
Beispiel #28
0
 // TODO ANGEL: Se añade un método de actualización específico para las propiedades de los objetos.
 //             Es debido a que usaban un IAttributeHandleValueMap que imponía una serie de problemas: implicaba la conversión de los values de object a byte[]
 public virtual void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #29
0
 public virtual void ProvideAttributeValueUpdate(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #30
0
 public virtual void ConfirmAttributeOwnershipAcquisitionCancellation(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #31
0
 public DiscoverObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, long federateHandle, long interactionIndex, IObjectInstanceHandle theObjectParam, IObjectClassHandle theObjectClassParam, string objectNameParam)
     : base(federate, time, federateHandle, interactionIndex)
 {
     this.theObject = theObjectParam;
     this.theObjectClass = theObjectClassParam;
     this.objectName = objectNameParam;
 }
Beispiel #32
0
 public TimeStampedRemoveObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, byte[] userSuppliedTagParam, OrderType sentOrderingParam, ILogicalTime theTimeParam, OrderType receivedOrderingParam)
     : base(federate, time, theObjectParam, userSuppliedTagParam, sentOrderingParam)
 {
     this.timeParam        = theTimeParam;
     this.receivedOrdering = receivedOrderingParam;
 }
Beispiel #33
0
 public RemoveObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, byte[] userSuppliedTagParam, OrderType sentOrderingParam)
     : base(federate, time)
 {
     this.theObject = theObjectParam;
     this.userSuppliedTag = userSuppliedTagParam;
     this.sentOrdering = sentOrderingParam;
 }
Beispiel #34
0
 public virtual void RequestAttributeOwnershipRelease(IObjectInstanceHandle theObject, IAttributeHandleSet candidateAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 public override void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
 {
     // TODO ANGEL: LOCK DUDOSO
     //lock (this)
     //{
     if (objectInstanceHandleProxyMap.ContainsKey(theObject))
     {
         object instance = objectInstanceHandleProxyMap[theObject];
         rti.objectManager.UpdateAttributeValuesProxyObject(instance, theAttributes);
     }
     else
     {
         if (log.IsErrorEnabled)
             log.Error("Object " + theObject + " not found. Attributes to reflect: " + theAttributes);
     }
     //}
 }
Beispiel #36
0
 public virtual void AttributeOwnershipUnavailable(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #37
0
        private HLAattributeHandleValuePair[] CreateAttributeHandleValuePairList(string methodName, object newValue, IObjectInstanceHandle instanceHandle)
        {
            ObjectInstanceDescriptor oid = rti.descriptorManager.GetObjectInstanceDescriptor(instanceHandle);
            IObjectClassHandle       och = oid.ClassHandle;
            ObjectClassDescriptor    ocd = rti.descriptorManager.GetObjectClassDescriptor(och);

            HLAattributeHandleValuePair[] attributeHandleValuePairList = new HLAattributeHandleValuePair[1];
            attributeHandleValuePairList[0] = new HLAattributeHandleValuePair();
            attributeHandleValuePairList[0].AttributeHandle = ((XRTIAttributeHandle)ocd.GetAttributeDescriptor(methodName).Handle).Identifier;
            attributeHandleValuePairList[0].AttributeValue  = newValue;

            return(attributeHandleValuePairList);
        }
Beispiel #38
0
 public virtual void AttributeOwnershipAcquisitionNotification(IObjectInstanceHandle theObject, IAttributeHandleSet securedAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #39
0
 public virtual void RemoveObjectInstance(IObjectInstanceHandle theObject, byte[] userSuppliedTag, OrderType sentOrdering, ILogicalTime theTime, OrderType receivedOrdering, IMessageRetractionHandle retractionHandle)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        public override void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
        {
            // TODO ANGEL: LOCK DUDOSO
            lock (this)
            {
                base.ReflectAttributeValuesExt(theObject, theAttributes, userSuppliedTag, sentOrdering, theTransport);

                if (objectInstanceHandleProxyMap.ContainsKey(theObject))
                {
                    object instance = objectInstanceHandleProxyMap[theObject];

                    // TODO ANGEL: ¿Esto debería estar aquí o dentro de la funcionalidad del objectManager?
                    //             El problema es que si lo hace objectManager debe poder acceder al federationsMap del rti
                    foreach (HLAattributeHandleValuePair entry in theAttributes)
                    {

                        string attributeName = GetAttributeName(instance, entry.AttributeHandle);

                        // Checks if the object created is an instance of HLAfederation and its properties are modificated
                        if (instance is HLAfederation)
                        {

                            if (attributeName == "HLAfederationName")
                            {
                                rti.federationsMap.Add((string)entry.AttributeValue, instance as HLAfederation);
                            }
                            else if (attributeName == "HLAFDDID")
                            {
                                rti.interactionManager.RegisterHelperClass((string)entry.AttributeValue);
                            }
                        }

                        // Checks if the object created is an instance of HLAfederate and its properties are modificated
                        if (instance is HLAfederate)
                        {
                            if (attributeName == "HLAfederateHandle")
                            {
                                if (instance is Sxtafederate)
                                {
                                    Sxtafederate federate = instance as Sxtafederate;

                                    // TODO ANGEL: OJO! Implica que la propiedad HLAfederationNameJoined se haya recibido antes que ésta
                                    HLAfederateHandle federateHandle = (HLAfederateHandle)entry.AttributeValue;
                                    rti.federationsMap[federate.HLAfederationNameJoined].HLAfederatesinFederation.Add(federateHandle);
                                }
                            }

                            if (attributeName == "HLAfederationNameJoined")
                            {
                                if (instance is Sxtafederate)
                                {
                                    Sxtafederate federate = instance as Sxtafederate;

                                    HLAfederation federation = rti.federationsMap[federate.HLAfederationNameJoined];
                                    federate.Federation = federation;
                                }
                            }

                            /*
                            if (attributeName == "HLAlogicalTime" || attributeName == "HLApendingTime"
                                || attributeName == "HLAlookahead" || attributeName == "HLAGALT" || attributeName == "HLALITS")
                            {
                                //System.Threading.Monitor.Pulse(rti);
                                //rti.PushFederates();
                            }
                            */
                        }
                    }
                }
            }
        }
Beispiel #41
0
 public virtual void RequestDivestitureConfirmation(IObjectInstanceHandle theObject, IAttributeHandleSet offeredAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #42
0
 public virtual void RequestDivestitureConfirmation(IObjectInstanceHandle theObject, IAttributeHandleSet offeredAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #43
0
 public virtual void AttributeIsOwnedByRTI(IObjectInstanceHandle theObject, IAttributeHandle theAttribute)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #44
0
 public virtual void RemoveObjectInstance(IObjectInstanceHandle theObject, byte[] userSuppliedTag, OrderType sentOrdering, ILogicalTime theTime, OrderType receivedOrdering, IMessageRetractionHandle retractionHandle)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #45
0
 public virtual void AttributeOwnershipUnavailable(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #46
0
 public virtual void TurnUpdatesOffForObjectInstance(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #47
0
 public DiscoverObjectInstanceCallback(IFederateAmbassador federate, IObjectInstanceHandle theObjectParam, IObjectClassHandle theObjectClassParam, string objectNameParam)
     : base(federate)
 {
     this.theObject = theObjectParam;
     this.theObjectClass = theObjectClassParam;
     this.objectName = objectNameParam;
 }
Beispiel #48
0
 public virtual void ConfirmAttributeOwnershipAcquisitionCancellation(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #49
0
 public ReflectAttributeValuesCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, IAttributeHandleValueMap theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate, time)
 {
     this.theObject = theObjectParam;
     this.theAttributes = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #50
0
 public virtual void DiscoverObjectInstance(IObjectInstanceHandle theObject, IObjectClassHandle theObjectClass, string objectName)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #51
0
 public ReflectAttributeValuesExtCallback(IFederateAmbassador federate, ILogicalTime time, long federateHandle, long interactionIndex, IObjectInstanceHandle theObjectParam, HLAattributeHandleValuePair[] theAttributesParam, byte[] userSuppliedTagParam)
     : base(federate, time, federateHandle, interactionIndex)
 {
     this.theObject = theObjectParam;
     this.theAttributes = theAttributesParam;
     this.userSuppliedTag = userSuppliedTagParam;
 }
Beispiel #52
0
 public virtual void InformAttributeOwnership(IObjectInstanceHandle theObject, IAttributeHandle theAttribute, IFederateHandle theOwner)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #53
0
 public TimeStampedRemoveObjectInstanceCallback(IFederateAmbassador federate, ILogicalTime time, IObjectInstanceHandle theObjectParam, byte[] userSuppliedTagParam, OrderType sentOrderingParam, ILogicalTime theTimeParam, OrderType receivedOrderingParam)
     : base(federate, time, theObjectParam, userSuppliedTagParam, sentOrderingParam)
 {
     this.timeParam = theTimeParam;
     this.receivedOrdering = receivedOrderingParam;
 }
Beispiel #54
0
 public virtual void ProvideAttributeValueUpdate(IObjectInstanceHandle theObject, IAttributeHandleSet theAttributes, byte[] userSuppliedTag)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        public void OnReceiveUpdateAttributeValues(IObjectInstanceHandle instanceHandle, IDictionary<string, object> methodNameValueMap, ILogicalTime time)
        {
            HLAattributeHandleValuePair[] attributeHandleValuePair = CreateAttributesHandleValuePairList(methodNameValueMap, instanceHandle);

            // TODO ANGEL: que pasa con userSuppliedTag
            rti.UpdateAttributeValues(instanceHandle, attributeHandleValuePair, new byte[1], time);
        }
Beispiel #56
0
 public virtual void ReflectAttributeValues(IObjectInstanceHandle theObject, IAttributeHandleValueMap theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport, ILogicalTime theTime, OrderType receivedOrdering, IMessageRetractionHandle retractionHandle, IRegionHandleSet sentRegions)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        private HLAattributeHandleValuePair[] CreateAttributeHandleValuePairList(string methodName, object newValue, IObjectInstanceHandle instanceHandle)
        {
            ObjectInstanceDescriptor oid = rti.descriptorManager.GetObjectInstanceDescriptor(instanceHandle);
            IObjectClassHandle och = oid.ClassHandle;
            ObjectClassDescriptor ocd = rti.descriptorManager.GetObjectClassDescriptor(och);

            HLAattributeHandleValuePair[] attributeHandleValuePairList = new HLAattributeHandleValuePair[1];
            attributeHandleValuePairList[0] = new HLAattributeHandleValuePair();
            attributeHandleValuePairList[0].AttributeHandle = ((XRTIAttributeHandle)ocd.GetAttributeDescriptor(methodName).Handle).Identifier;
            attributeHandleValuePairList[0].AttributeValue = newValue;

            return attributeHandleValuePairList;
        }
Beispiel #58
0
 // TODO ANGEL: Se añade un método de actualización específico para las propiedades de los objetos.
 //             Es debido a que usaban un IAttributeHandleValueMap que imponía una serie de problemas: implicaba la conversión de los values de object a byte[]
 public virtual void ReflectAttributeValuesExt(IObjectInstanceHandle theObject, HLAattributeHandleValuePair[] theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #59
0
 public virtual void RemoveObjectInstance(IObjectInstanceHandle theObject, byte[] userSuppliedTag, OrderType sentOrdering)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #60
0
        private HLAattributeHandleValuePair[] CreateAttributesHandleValuePairList(IDictionary <string, object> methodNameValueMap, IObjectInstanceHandle instanceHandle)
        {
            HLAattributeHandleValuePair[] attributeHandleValuePairList = new HLAattributeHandleValuePair[methodNameValueMap.Count];

            ObjectInstanceDescriptor oid = rti.descriptorManager.GetObjectInstanceDescriptor(instanceHandle);
            IObjectClassHandle       och = oid.ClassHandle;
            ObjectClassDescriptor    ocd = rti.descriptorManager.GetObjectClassDescriptor(och);

            int count = 0;

            foreach (KeyValuePair <string, object> entry in methodNameValueMap)
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("The method " + entry.Key + " from object " + instanceHandle + " has been called; new value:" + entry.Value + "; parameter type = " + entry.Value.GetType());
                }

                attributeHandleValuePairList[count] = new HLAattributeHandleValuePair();
                attributeHandleValuePairList[count].AttributeHandle = ((XRTIAttributeHandle)ocd.GetAttributeDescriptor(entry.Key).Handle).Identifier;
                attributeHandleValuePairList[count].AttributeValue  = entry.Value;
                count++;
            }

            return(attributeHandleValuePairList);
        }