예제 #1
0
 ///<summary> Writes this HLAreportHandlesMessage 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.WriteHLAinteger64BE(((HLAreportHandlesMessage)obj).BlockStart);
         writer.WriteHLAinteger64BE(((HLAreportHandlesMessage)obj).BlockSize);
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
 }
예제 #2
0
        ///<summary> Writes this HLAregisterObjectInstanceMessage 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
            {
                base.Serialize(writer, obj);

                writer.WriteHLAunicodeString(((HLAregisterObjectInstanceMessage)obj).ObjectName);
                writer.WriteHLAinteger64BE(((HLAregisterObjectInstanceMessage)obj).ObjectInstanceHandle);
                writer.WriteHLAinteger64BE(((HLAregisterObjectInstanceMessage)obj).ObjectClassHandle);
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }
예제 #3
0
        ///<summary>
        /// Writes this HLAparameterHandleValuePair 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)
        {
            BaseInteractionMessage msg = obj as BaseInteractionMessage;

            writer.WriteHLAinteger64BE(msg.FederateHandle);
            writer.WriteHLAinteger64BE(msg.InteractionIndex);
            writer.WriteHLAinteger64BE(msg.FederationExecutionHandle);
            writer.WriteHLAopaqueData(msg.UserSuppliedTag);
            writer.WriteHLAinteger64BE(msg.InteractionClassHandle);
            IHlaEncodingSerializer serializer = serializerManager.GetSerializer(msg.InteractionClassHandle);

            if (serializer != null && !this.Equals(serializer))
            {
                serializer.Serialize(writer, obj);
            }
        }
예제 #4
0
        ///<summary> Writes this HLArequestAttributeValueUpdateMessage 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.WriteHLAinteger64BE(((HLArequestAttributeValueUpdateMessage)obj).ObjectInstanceHandle);
                writer.WriteHLAinteger32BE(((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList.Length);

                for (int i = 0; i < ((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList.Length; i++)
                {
                    writer.WriteHLAinteger64BE(((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList[i]);
                }
            }
            catch (IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }
예제 #5
0
 ///<summary> Writes this HLAjoinFederationExecutionMessage 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
     {
         base.Serialize(writer, obj);
         writer.WriteHLAunicodeString(((HLAjoinFederationExecutionMessage)obj).FederationExecutionName);
         writer.WriteHLAunicodeString(((HLAjoinFederationExecutionMessage)obj).FederateType);
         writer.WriteHLAinteger64BE(((HLAjoinFederationExecutionMessage)obj).FederateHandle);
     }
     catch (System.IO.IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
 }
        ///<summary> Writes this HLAupdateAttributeValuesMessage 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="System.IO.IOException"> if an error occurs</exception>
        public override void Serialize(HlaEncodingWriter writer, object obj)
        {
            try
            {
                base.Serialize(writer, obj);

                writer.WriteHLAinteger64BE(((HLAupdateAttributeValuesMessage)obj).ObjectInstanceHandle);
                writer.WriteHLAinteger32BE((((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList).Length);

                for (int i = 0; i < (((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList).Length; i++)
                {
                    hlaAttributeHandleValuePairXrtiSerializer.Serialize(writer, ((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList[i]);
                }
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }