///<summary> Writes this HLAinteractionFragmentMessage 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(((HLAinteractionFragmentMessage)obj).InteractionNumber);
         writer.WriteHLAinteger32BE(((HLAinteractionFragmentMessage)obj).InteractionSize);
         writer.WriteHLAinteger32BE(((HLAinteractionFragmentMessage)obj).FragmentOffset);
         writer.WriteHLAopaqueData(((HLAinteractionFragmentMessage)obj).FragmentContents);
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
 }
 ///<summary>
 /// Writes this Home.BoxesCount to the specified stream.
 ///</summary>
 ///<param name="writer"> the output stream to write to</param>
 ///<param name="BoxesCount"> the property to serialize</param>
 ///<exception cref="System.IO.IOException"> if an error occurs</exception>
 public override void Serialize(HlaEncodingWriter writer, object BoxesCount)
 {
     try
     {
         writer.WriteHLAinteger32BE((int)BoxesCount);
     }
     catch (IOException ioe)
     {
         throw new RTIinternalError(ioe.ToString());
     }
 }
예제 #3
0
        ///<summary> Writes this HLAsubscribeObjectClassAttributesMessage 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);

                IObjectClassHandle objectClass          = ((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass;
                byte[]             objectClassByteArray = new byte[objectClass.EncodedLength()];
                objectClass.Encode(objectClassByteArray, 0);

                writer.WriteHLAopaqueData(objectClassByteArray);

                IAttributeHandleSet attributeHandleSet = ((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList;
                writer.WriteHLAinteger32BE(attributeHandleSet.Count);

                foreach (IAttributeHandle attributeHandle in attributeHandleSet)
                {
                    byte[] attributeHandleByteArray = new byte[attributeHandle.EncodedLength()];
                    attributeHandle.Encode(attributeHandleByteArray, 0);

                    writer.WriteHLAopaqueData(attributeHandleByteArray);
                }

                writer.WriteHLAboolean(((HLAsubscribeObjectClassAttributesMessage)obj).HLAactive);

                /*
                 * writer.WriteHLAinteger32BE((((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass).Length);
                 *
                 * for (int i = 0; i < (((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass).Length; i++)
                 * {
                 *  writer.WriteHLAoctet((((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass)[i]);
                 * }
                 * writer.WriteHLAinteger32BE((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList).Length);
                 *
                 * for (int i = 0; i < (((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList).Length; i++)
                 * {
                 *  writer.WriteHLAinteger32BE(((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i]).Length);
                 *
                 *  for (int j = 0; j < ((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i]).Length; j++)
                 *  {
                 *      writer.WriteHLAoctet(((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i])[j]);
                 *  }
                 * }
                 * writer.WriteHLAboolean(((HLAsubscribeObjectClassAttributesMessage)obj).HLAactive);
                 */
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }
예제 #4
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());
            }
        }
예제 #5
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());
            }
        }
        ///<summary> Writes this PeerAdvertisementInteractionMessage 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
            {
                writer.WriteHLAunicodeString(((PeerAdvertisementInteractionMessage)obj).PeerName);
                writer.WriteHLAunicodeString(((PeerAdvertisementInteractionMessage)obj).PeerDescription);
                writer.WriteHLAinteger32BE((((PeerAdvertisementInteractionMessage)obj).PeerChannels).Count);

                for (int i = 0; i < (((PeerAdvertisementInteractionMessage)obj).PeerChannels).Count; i++)
                {
                    writer.WriteHLAunicodeString((((PeerAdvertisementInteractionMessage)obj).PeerChannels)[i]);
                }
            }
            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());
            }
        }
예제 #8
0
        ///<summary> Writes this HLAfederateMessage 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);
                int val = (((HLAfederateMessage)obj).HLAfederate).data;
                writer.WriteHLAinteger32BE(val);

                /*
                 * writer.WriteHLAinteger32BE((((HLAfederateMessage)obj).HLAfederate).Length);
                 *
                 * for (int i = 0; i < (((HLAfederateMessage)obj).HLAfederate).Length; i++)
                 * {
                 *  writer.WriteHLAoctet((((HLAfederateMessage)obj).HLAfederate)[i]);
                 * }
                 */
            }
            catch (System.IO.IOException ioe)
            {
                throw new RTIinternalError(ioe.ToString());
            }
        }
 public static void Serialize(HlaEncodingWriter writer, Actor.MoveDirection val)
 {
     writer.WriteHLAinteger32BE((int)val);
 }
예제 #10
0
 ///<summary>Writes this HLAtimeState to the specified stream.</summary>
 ///<param name="writer"> the stream to write to</param>
 ///<exception cref="IOException"> if an error occurs</exception>
 public static void Serialize(HlaEncodingWriter writer, HLAtimeState val)
 {
     writer.WriteHLAinteger32BE((int)val);
 }