コード例 #1
0
        ///<summary> Writes this HlaGenericInteractionMessage to the specified stream.</summary>
        ///<param name="writer"> the output stream to write to</param>
        ///<param name="obj"> the object to serialize</param>
        ///<exception cref="IOException"> if an error occurs</exception>
        public override void Serialize(HlaEncodingWriter writer, object obj)
        {
            try
            {
                writer.WriteHLAinteger32BE(((HLAGenericInteractionMessage)obj).ParameterList.Length);

                for (int i = 0; i < ((HLAGenericInteractionMessage)obj).ParameterList.Length; i++)
                {
                    HLAparameterHandleValuePairXrtiSerializer.Serialize(writer, ((HLAGenericInteractionMessage)obj).ParameterList[i]);
                }
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }
コード例 #2
0
        ///<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);
        }