///<summary> Reads this HLAcreateFederationExecutionMessage from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the object</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg)
 {
     HLAcreateFederationExecutionMessage decodedValue;
     if (!(msg is HLAcreateFederationExecutionMessage))
     {
         decodedValue = new HLAcreateFederationExecutionMessage();
         BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
         decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
         decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
         decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
     }
     else
     {
         decodedValue = msg as HLAcreateFederationExecutionMessage;
     }
     object tmp = decodedValue;
     decodedValue = base.Deserialize(reader, ref tmp) as HLAcreateFederationExecutionMessage;
     try
     {
         decodedValue.FederationExecutionName = reader.ReadHLAunicodeString();
         decodedValue.FederationDescriptionDocument = reader.ReadHLAopaqueData();
     }
     catch(System.IO.IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
     return decodedValue;
 }
Пример #2
0
 ///<summary>
 /// Reads and returns a HLAfederation.HLAfederatesinFederation from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<param name="dummy"> this parameter is not used</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object dummy)
 {
     byte[][] decodedValue;
     try
     {
         /*
          * decodedValue = new byte[ reader.ReadHLAinteger32BE() ][];
          *
          * for(int i=0;i<decodedValue.Length;i++)
          * {
          *  decodedValue[i] = new byte[ reader.ReadHLAinteger32BE() ];
          *
          *  for(int j=0;j<decodedValue[i].Length;j++)
          *  {
          *      decodedValue[i][j] = reader.ReadHLAoctet();
          *  }
          * }
          *
          * return decodedValue;
          */
         return(new HLAhandleList());
     }
     catch (IOException ioe)
     {
         throw new FederateInternalError(ioe.ToString());
     }
 }
        ///<summary> Reads this HLAupdateAttributeValuesWithTimeMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            HLAupdateAttributeValuesWithTimeMessage decodedValue;
            if (!(msg is HLAupdateAttributeValuesWithTimeMessage))
            {
                decodedValue = new HLAupdateAttributeValuesWithTimeMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.CopyTo(baseMsg);
                //decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                //decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                //decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAupdateAttributeValuesWithTimeMessage;
            }

            object tmp = decodedValue;

            try
            {
                decodedValue = base.Deserialize(reader, ref tmp) as HLAupdateAttributeValuesWithTimeMessage;

                decodedValue.LogicalTime = reader.ReadHLAopaqueData();
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }

            return decodedValue;
        }
        ///<summary>
        /// Reads and returns a HLAfederation.HLAfederatesinFederation from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            byte[][] decodedValue;
            try
            {
                /*
                decodedValue = new byte[ reader.ReadHLAinteger32BE() ][];

                for(int i=0;i<decodedValue.Length;i++)
                {
                    decodedValue[i] = new byte[ reader.ReadHLAinteger32BE() ];

                    for(int j=0;j<decodedValue[i].Length;j++)
                    {
                        decodedValue[i][j] = reader.ReadHLAoctet();
                    }
                }

                return decodedValue;
                */
                return new HLAhandleList();
            }
            catch(IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
Пример #5
0
        ///<summary> Reads this HLAfederateMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            HLAfederateMessage decodedValue;
            if (!(msg is HLAfederateMessage))
            {
                decodedValue = new HLAfederateMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAfederateMessage;
            }
            object tmp = decodedValue;
            decodedValue = base.Deserialize(reader, ref tmp) as HLAfederateMessage;
            try
            {
                /*
                decodedValue.HLAfederate = new byte[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < decodedValue.HLAfederate.Length; i++)
                {
                    decodedValue.HLAfederate[i] = reader.ReadHLAoctet();
                }
                */
                decodedValue.HLAfederate = (HLAfederateHandle)reader.ReadHLAinteger32BE();
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return decodedValue;
        }
        ///<summary>
        /// Reads and returns a Vector3 from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public static Vector3 Deserialize(HlaEncodingReader reader)
        {
            Vector3 decodedValue = new Vector3();

            decodedValue.x = reader.ReadHLAfloat32BE();
            decodedValue.y = reader.ReadHLAfloat32BE();
            decodedValue.z = reader.ReadHLAfloat32BE();
            return decodedValue;
        }
Пример #7
0
 /// <summary>
 /// Reads and returns a HLAparameterHandleValuePair from the specified stream.
 /// </summary>
 /// <param name="reader"> the input stream to read from</param>
 /// <returns> the decoded parameterValue</returns>
 /// <exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg)
 {
     if (reader.ReadHLAinteger32BE() == MAGIC_NUMBER && reader.ReadHLAinteger32BE() == hlaEncodingModelVersion)
     {
         return baseSerializer.Deserialize(reader, ref msg);
     }
     else
         throw new IOException("Wrong message format. Unexpected magic number or version");
 }
Пример #8
0
 /// <summary>
 /// Reads and returns a HLAparameterHandleValuePair from the specified stream.
 /// </summary>
 /// <param name="reader"> the input stream to read from</param>
 /// <returns> the decoded parameterValue</returns>
 /// <exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg)
 {
     if (reader.ReadHLAinteger32BE() == MAGIC_NUMBER && reader.ReadHLAinteger32BE() == hlaEncodingModelVersion)
     {
         return(baseSerializer.Deserialize(reader, ref msg));
     }
     else
     {
         throw new IOException("Wrong message format. Unexpected magic number or version");
     }
 }
 ///<summary>
 /// Reads and returns a HLAfederate.HLAtimeManagerState from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<param name="dummy"> this parameter is not used</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object dummy)
 {
     HLAtimeState decodedValue;
     try
     {
         decodedValue = HLAtimeStateXrtiSerializer.Deserialize(reader);
         return decodedValue;
     }
     catch (IOException ioe)
     {
         throw new FederateInternalError(ioe.ToString());
     }
 }
 ///<summary>
 /// Reads and returns a HLAfederate.HLAfederateType from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<param name="dummy"> this parameter is not used</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object dummy)
 {
     String decodedValue;
     try
     {
         decodedValue = reader.ReadHLAunicodeString();
         return decodedValue;
     }
     catch (IOException ioe)
     {
         throw new FederateInternalError(ioe.ToString());
     }
 }
 ///<summary>
 /// Reads and returns a ILogicalTimeInterval from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<param name="dummy"> this parameter is not used</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object dummy)
 {
     ILogicalTimeInterval decodedValue;
     try
     {
         decodedValue = logicalTimeIntervalFactory.Decode(reader.ReadHLAopaqueData(), 0);
         return decodedValue;
     }
     catch (IOException ioe)
     {
         throw new FederateInternalError(ioe.ToString());
     }
 }
Пример #12
0
        ///<summary>
        /// Reads and returns a HLAattributeHandleValuePair from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            if (msg.Equals(BaseInteractionMessage.NullBaseInteractionMessage))
            {
                msg = new HLAattributeHandleValuePair();
            }
            HLAattributeHandleValuePair decodedValue = msg as HLAattributeHandleValuePair;

            decodedValue.AttributeHandle = reader.ReadHLAinteger64BE();
            object tmp = BaseInteractionMessage.NullBaseInteractionMessage;

            decodedValue.AttributeValue = serializerManager.GetSerializer(decodedValue.AttributeHandle).Deserialize(reader, ref tmp);
            return(decodedValue);
        }
        ///<summary>
        /// Reads and returns a HLAfederation.HLAautoProvide from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            HLAswitch decodedValue;

            try
            {
                decodedValue = HLAswitchXrtiSerializer.Deserialize(reader);
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
        ///<summary>
        /// Reads and returns a HLAfederation.HLAFDDID from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            String decodedValue;

            try
            {
                decodedValue = reader.ReadHLAunicodeString();
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
        ///<summary>
        /// Reads and returns a HLAfederate.HLAlogicalTime from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            ILogicalTime decodedValue;

            try
            {
                decodedValue = logicalTimeFactory.Decode(reader.ReadHLAopaqueData(), 0);
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
 ///<summary>
 /// Reads and returns a Sxtafederate.HLApendingTime from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<param name="dummy"> this parameter is not used</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object dummy)
 {
     ILogicalTime decodedValue;
     try
     {
         IHlaEncodingSerializer serializer = serializerManager.GetSerializer(typeof(ILogicalTime));
         decodedValue = (ILogicalTime)serializer.Deserialize(reader, ref dummy);
         return decodedValue;
     }
     catch (IOException ioe)
     {
         throw new FederateInternalError(ioe.ToString());
     }
 }
Пример #17
0
 ///<summary> Reads this HLAreportHandlesMessage from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the object</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg2)
 {
     HLAreportHandlesMessage msg = new HLAreportHandlesMessage();
     msg.CopyTo((BaseInteractionMessage)msg2);
     try
     {
         msg.BlockStart = reader.ReadHLAinteger64BE();
         msg.BlockSize = reader.ReadHLAinteger64BE();
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
     return msg;
 }
        ///<summary>
        /// Reads and returns a HLAfederate.HLAGALT from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            ILogicalTime decodedValue;

            try
            {
                IHlaEncodingSerializer serializer = serializerManager.GetSerializer(typeof(ILogicalTime));
                decodedValue = (ILogicalTime)serializer.Deserialize(reader, ref dummy);
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
        ///<summary>
        /// Reads and returns a HLAfederate.HLAfederateHandle from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            byte[] decodedValue;
            try
            {
                decodedValue = new byte[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < decodedValue.Length; i++)
                {
                    decodedValue[i] = reader.ReadHLAoctet();
                }
                return (HLAfederateHandle)decodedValue;
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
        ///<summary>
        /// Reads and returns a HLAfederation.HLAnextSaveTime from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<param name="dummy"> this parameter is not used</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object dummy)
        {
            byte[] decodedValue;
            try
            {
                decodedValue = new byte[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < decodedValue.Length; i++)
                {
                    decodedValue[i] = reader.ReadHLAoctet();
                }
                return(decodedValue);
            }
            catch (IOException ioe)
            {
                throw new FederateInternalError(ioe.ToString());
            }
        }
Пример #21
0
 ///<summary> Reads this HLAserviceMessage from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the object</returns>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg)
 {
     HLAserviceMessage decodedValue;
     if (!(msg is HLAserviceMessage))
     {
         decodedValue = new HLAserviceMessage();
         BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
         decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
         decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
         decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
     }
     else
     {
         decodedValue = msg as HLAserviceMessage;
     }
     object tmp = decodedValue;
     decodedValue = base.Deserialize(reader, ref tmp) as HLAserviceMessage;
     return decodedValue;
 }
        ///<summary> Reads this HlaGenericInteractionMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg2)
        {
            HLAGenericInteractionMessage msg = new HLAGenericInteractionMessage();
            msg.CopyTo((BaseInteractionMessage)msg2);
            try
            {
                msg.ParameterList = new HLAparameterHandleValuePair[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < msg.ParameterList.Length; i++)
                {
                    msg.ParameterList[i] = HLAparameterHandleValuePairXrtiSerializer.Deserialize(reader);
                }
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return msg;
        }
        ///<summary> Reads this HLArequestAttributeValueUpdateMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg2)
        {
            HLArequestAttributeValueUpdateMessage msg = new HLArequestAttributeValueUpdateMessage();
            msg.CopyTo((BaseInteractionMessage)msg2);

            try
            {
                msg.ObjectInstanceHandle = reader.ReadHLAinteger64BE();
                msg.AttributeHandleList = new long[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < msg.AttributeHandleList.Length; i++)
                {
                    msg.AttributeHandleList[i] = reader.ReadHLAinteger64BE();
                }
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return msg;
        }
        ///<summary> Reads this HLAupdateAttributeValuesReliableWithTimeMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            HLAupdateAttributeValuesReliableWithTimeMessage decodedValue;
            if (!(msg is HLAupdateAttributeValuesReliableWithTimeMessage))
            {
                decodedValue = new HLAupdateAttributeValuesReliableWithTimeMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.CopyTo(baseMsg);
                //decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                //decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                //decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAupdateAttributeValuesReliableWithTimeMessage;
            }
            object tmp = decodedValue;
            decodedValue = base.Deserialize(reader, ref tmp) as HLAupdateAttributeValuesReliableWithTimeMessage;

            //decodedValue.LogicalTime = reader.ReadHLAopaqueData();

            return decodedValue;
        }
        ///<summary> Reads this HLAsubscribeObjectClassAttributesMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            HLAsubscribeObjectClassAttributesMessage decodedValue;
            if (!(msg is HLAsubscribeObjectClassAttributesMessage))
            {
                decodedValue = new HLAsubscribeObjectClassAttributesMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAsubscribeObjectClassAttributesMessage;
            }
            object tmp = decodedValue;
            decodedValue = base.Deserialize(reader, ref tmp) as HLAsubscribeObjectClassAttributesMessage;
            try
            {
                byte[] objectClassByteArray = reader.ReadHLAopaqueData();
                decodedValue.HLAobjectClass = objectClassFactory.Decode(objectClassByteArray, 0);

                decodedValue.HLAattributeList = attributeHandleSetFactory.Create();

                int count = reader.ReadHLAinteger32BE();

                for (int i = 0; i < count; i++)
                {
                    IAttributeHandle attributeHandle = attributeHandleFactory.Decode(reader.ReadHLAopaqueData(), 0);
                    decodedValue.HLAattributeList.Add(attributeHandle);
                }

                decodedValue.HLAactive = reader.ReadHLAboolean();

                /*
                decodedValue.HLAobjectClass = new byte[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < decodedValue.HLAobjectClass.Length; i++)
                {
                    decodedValue.HLAobjectClass[i] = reader.ReadHLAoctet();
                }
                decodedValue.HLAattributeList = new byte[reader.ReadHLAinteger32BE()][];

                for (int i = 0; i < decodedValue.HLAattributeList.Length; i++)
                {
                    decodedValue.HLAattributeList[i] = new byte[reader.ReadHLAinteger32BE()];

                    for (int j = 0; j < decodedValue.HLAattributeList[i].Length; j++)
                    {
                        decodedValue.HLAattributeList[i][j] = reader.ReadHLAoctet();
                    }
                }
                decodedValue.HLAactive = reader.ReadHLAboolean();
                */
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return decodedValue;
        }
Пример #26
0
        ///<summary> Reads this HLAupdateAttributeValuesMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            HLAupdateAttributeValuesMessage decodedValue;
            if (!(msg is HLAupdateAttributeValuesMessage))
            {
                decodedValue = new HLAupdateAttributeValuesMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.CopyTo(baseMsg);
                //decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                //decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                //decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAupdateAttributeValuesMessage;
            }
            object tmp = decodedValue;

            try
            {
                decodedValue = base.Deserialize(reader, ref tmp) as HLAupdateAttributeValuesMessage;

                decodedValue.ObjectInstanceHandle = reader.ReadHLAinteger64BE();
                decodedValue.AttributeHandleValuePairList = new HLAattributeHandleValuePair[reader.ReadHLAinteger32BE()];

                for (int i = 0; i < decodedValue.AttributeHandleValuePairList.Length; i++)
                {
                    tmp = BaseInteractionMessage.NullBaseInteractionMessage;
                    decodedValue.AttributeHandleValuePairList[i] = (HLAattributeHandleValuePair)hlaAttributeHandleValuePairXrtiSerializer.Deserialize(reader, ref tmp);
                }
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return decodedValue;
        }
Пример #27
0
 ///<summary> Reads this HLAcontinueMessage from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the object</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg2)
 {
     HLAcontinueMessage msg = new HLAcontinueMessage();
     msg.CopyTo((BaseInteractionMessage)msg2);
     return msg;
 }
Пример #28
0
 public abstract object Deserialize(HlaEncodingReader reader, ref object msg);
        ///<summary>
        /// Reads and returns a Vector3FloatStruct from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public static Vector3FloatStruct Deserialize(HlaEncodingReader reader)
        {
            Vector3FloatStruct decodedValue = new Vector3FloatStruct();

            decodedValue.XComponent = reader.ReadHLAfloat32BE();
            decodedValue.YComponent = reader.ReadHLAfloat32BE();
            decodedValue.ZComponent = reader.ReadHLAfloat32BE();
            return decodedValue;
        }
 ///<summary> Reads and returns a HLAtimeState from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns>return the decoded value</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public static HLAtimeState Deserialize(HlaEncodingReader reader)
 {
     return (HLAtimeState)reader.ReadHLAinteger32BE();
 }
 ///<summary> Reads this HLAinteractionFragmentMessage from the specified stream.</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the object</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg2)
 {
     HLAinteractionFragmentMessage msg = new HLAinteractionFragmentMessage();
     msg.CopyTo((BaseInteractionMessage)msg2);
     try
     {
         msg.InteractionNumber = reader.ReadHLAinteger32BE();
         msg.InteractionSize = reader.ReadHLAinteger32BE();
         msg.FragmentOffset = reader.ReadHLAinteger32BE();
         msg.FragmentContents = reader.ReadHLAopaqueData();
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
     return msg;
 }
 public static Actor.MoveDirection Deserialize(HlaEncodingReader reader)
 {
     return (Actor.MoveDirection)reader.ReadHLAinteger32BE();
 }
Пример #33
0
 public abstract object Deserialize(HlaEncodingReader reader, ref object msg);
 ///<summary>
 /// Reads and returns a HLAattributeHandleValuePair from the specified stream.
 ///</summary>
 ///<param name="reader"> the input stream to read from</param>
 ///<returns> the decoded value</returns>
 ///<exception cref="IOException"> if an error occurs</exception>
 public override object Deserialize(HlaEncodingReader reader, ref object msg)
 {
     if (msg.Equals(BaseInteractionMessage.NullBaseInteractionMessage))
     {
         msg = new HLAattributeHandleValuePair();
     }
     HLAattributeHandleValuePair decodedValue = msg as HLAattributeHandleValuePair;
     decodedValue.AttributeHandle = reader.ReadHLAinteger64BE();
     object tmp = BaseInteractionMessage.NullBaseInteractionMessage;
     decodedValue.AttributeValue = serializerManager.GetSerializer(decodedValue.AttributeHandle).Deserialize(reader, ref tmp);
     return decodedValue;
 }
        ///<summary> Reads this HLAregisterObjectInstanceMessage from the specified stream.</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the object</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            /* msg2
            HLAregisterObjectInstanceMessage msg = new HLAregisterObjectInstanceMessage();
            msg.CopyTo((BaseInteractionMessage)msg2);

            try
            {
                msg.ObjectName = reader.ReadHLAunicodeString();
                msg.ObjectInstanceHandle = reader.ReadHLAinteger64BE();
                msg.ObjectClassHandle = reader.ReadHLAinteger64BE();
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return msg;
            */

            HLAregisterObjectInstanceMessage decodedValue;
            if (!(msg is HLAregisterObjectInstanceMessage))
            {
                decodedValue = new HLAregisterObjectInstanceMessage();
                BaseInteractionMessage baseMsg = msg as BaseInteractionMessage;
                decodedValue.CopyTo(baseMsg);
                //decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle;
                //decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle;
                //decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag;
            }
            else
            {
                decodedValue = msg as HLAregisterObjectInstanceMessage;
            }
            object tmp = decodedValue;

            try
            {
                decodedValue = base.Deserialize(reader, ref tmp) as HLAregisterObjectInstanceMessage;

                decodedValue.ObjectName = reader.ReadHLAunicodeString();
                decodedValue.ObjectInstanceHandle = reader.ReadHLAinteger64BE();
                decodedValue.ObjectClassHandle = reader.ReadHLAinteger64BE();
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
            return decodedValue;
        }
Пример #36
0
        ///<summary>
        /// Reads and returns a BaseIteractionMessage from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded parameterValue</returns>
        ///<exception cref="System.IO.IOException"> if an error occurs</exception>
        public override object Deserialize(HlaEncodingReader reader, ref object msg)
        {
            if (msg == null)
            {
                msg = new BaseInteractionMessage();
            }
            BaseInteractionMessage decodedValue = msg as BaseInteractionMessage;
            decodedValue.FederateHandle = reader.ReadHLAinteger64BE();
            decodedValue.InteractionIndex = reader.ReadHLAinteger64BE();
            decodedValue.FederationExecutionHandle = reader.ReadHLAinteger64BE();
            decodedValue.UserSuppliedTag = reader.ReadHLAopaqueData();
            decodedValue.InteractionClassHandle = reader.ReadHLAinteger64BE();

            IHlaEncodingSerializer serializer = serializerManager.GetSerializer(decodedValue.InteractionClassHandle);

            if (serializer != null && !this.Equals(serializer))
            {
                object decodedValueTmp = decodedValue;
                return serializer.Deserialize(reader, ref decodedValueTmp);
            }
            else
                return decodedValue;
        }