///<summary> Reads this HLApublishObjectClassAttributesMessage 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) { HLApublishObjectClassAttributesMessage decodedValue; if (!(msg is HLApublishObjectClassAttributesMessage)) { decodedValue = new HLApublishObjectClassAttributesMessage(); BaseInteractionMessage baseMsg = msg as BaseInteractionMessage; decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle; decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle; decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag; } else { decodedValue = msg as HLApublishObjectClassAttributesMessage; } object tmp = decodedValue; decodedValue = base.Deserialize(reader, ref tmp) as HLApublishObjectClassAttributesMessage; 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.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(); * } * } */ } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } return(decodedValue); }
///<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); }
///<summary> /// Reads and returns a Home.PosX 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) { int decodedValue; try { decodedValue = reader.ReadHLAinteger32BE(); return(decodedValue); } catch (IOException ioe) { throw new FederateInternalError(ioe.ToString()); } }
///<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 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 this PeerAdvertisementInteractionMessage 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) { PeerAdvertisementInteractionMessage decodedValue; if (!(msg is PeerAdvertisementInteractionMessage)) { decodedValue = new PeerAdvertisementInteractionMessage(); BaseInteractionMessage baseMsg = msg as BaseInteractionMessage; decodedValue.InteractionClassHandle = baseMsg.InteractionClassHandle; decodedValue.FederationExecutionHandle = baseMsg.FederationExecutionHandle; decodedValue.UserSuppliedTag = baseMsg.UserSuppliedTag; } else { decodedValue = msg as PeerAdvertisementInteractionMessage; } //object tmp = decodedValue; //decodedValue = base.Deserialize(reader, ref tmp) as PeerAdvertisementInteractionMessage; try { decodedValue.PeerName = reader.ReadHLAunicodeString(); decodedValue.PeerDescription = reader.ReadHLAunicodeString(); decodedValue.PeerChannels = new ConnectionList(); int PeerChannelsLength = reader.ReadHLAinteger32BE(); for (int i = 0; i < PeerChannelsLength; i++) { decodedValue.PeerChannels.Add(reader.ReadHLAunicodeString()); } } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } return(decodedValue); }
public static Actor.MoveDirection Deserialize(HlaEncodingReader reader) { return((Actor.MoveDirection)reader.ReadHLAinteger32BE()); }
///<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 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); }