Exemplo n.º 1
0
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedInt((uint)this._fixedDatumIDList.Count);
                    dos.WriteUnsignedInt((uint)this._variableDatumIDList.Count);

                    for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
                    {
                        FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumIDList[idx];
                        aFixedDatum.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._variableDatumIDList[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 2
0
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<DatumSpecification>");
            try
            {
                sb.AppendLine("<fixedDatumIDList type=\"uint\">" + this._fixedDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "</fixedDatumIDList>");
                sb.AppendLine("<variableDatumIDList type=\"uint\">" + this._variableDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatumIDList>");
                for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
                {
                    sb.AppendLine("<fixedDatumIDList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"FixedDatum\">");
                    FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumIDList[idx];
                    aFixedDatum.Reflection(sb);
                    sb.AppendLine("</fixedDatumIDList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
                {
                    sb.AppendLine("<variableDatumIDList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatumIDList[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatumIDList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</DatumSpecification>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 3
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfFixedDatums    = dis.ReadUnsignedInt();
                    this._numberOfVariableDatums = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfFixedDatums; idx++)
                    {
                        FixedDatum anX = new FixedDatum();
                        anX.Unmarshal(dis);
                        this._fixedDatumIDList.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.NumberOfVariableDatums; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._variableDatumIDList.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 4
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += 1;  // this._requiredReliabilityService
            marshalSize += 2;  // this._pad1
            marshalSize += 1;  // this._pad2
            marshalSize += 4;  // this._requestID
            marshalSize += 4;  // this._timeInterval
            marshalSize += 4;  // this._numberOfFixedDatumRecords
            marshalSize += 4;  // this._numberOfVariableDatumRecords
            for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
            {
                FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 5
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._originatingID.GetMarshalledSize(); // this._originatingID
            marshalSize += this._receivingID.GetMarshalledSize();   // this._receivingID
            marshalSize += 4;                                       // this._requestID
            marshalSize += 4;                                       // this._requestStatus
            marshalSize += 4;                                       // this._numberOfFixedDatumRecords
            marshalSize += 4;                                       // this._numberOfVariableDatumRecords
            for (int idx = 0; idx < this._fixedDatums.Count; idx++)
            {
                FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._variableDatums.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 6
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._groupEntityID.Unmarshal(dis);
                    this._groupedEntityCategory   = dis.ReadUnsignedByte();
                    this._numberOfGroupedEntities = dis.ReadUnsignedByte();
                    this._pad2      = dis.ReadUnsignedInt();
                    this._latitude  = dis.ReadDouble();
                    this._longitude = dis.ReadDouble();
                    for (int idx = 0; idx < this.NumberOfGroupedEntities; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._groupedEntityDescriptions.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 7
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<IsGroupOfPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<groupEntityID>");
                this._groupEntityID.Reflection(sb);
                sb.AppendLine("</groupEntityID>");
                sb.AppendLine("<groupedEntityCategory type=\"byte\">" + this._groupedEntityCategory.ToString(CultureInfo.InvariantCulture) + "</groupedEntityCategory>");
                sb.AppendLine("<groupedEntityDescriptions type=\"byte\">" + this._groupedEntityDescriptions.Count.ToString(CultureInfo.InvariantCulture) + "</groupedEntityDescriptions>");
                sb.AppendLine("<pad2 type=\"uint\">" + this._pad2.ToString(CultureInfo.InvariantCulture) + "</pad2>");
                sb.AppendLine("<latitude type=\"double\">" + this._latitude.ToString(CultureInfo.InvariantCulture) + "</latitude>");
                sb.AppendLine("<longitude type=\"double\">" + this._longitude.ToString(CultureInfo.InvariantCulture) + "</longitude>");
                for (int idx = 0; idx < this._groupedEntityDescriptions.Count; idx++)
                {
                    sb.AppendLine("<groupedEntityDescriptions" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._groupedEntityDescriptions[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</groupedEntityDescriptions" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</IsGroupOfPdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 8
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<CommentPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<fixedDatums type=\"uint\">" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "</fixedDatums>");
                sb.AppendLine("<variableDatums type=\"uint\">" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatums>");
                for (int idx = 0; idx < this._fixedDatums.Count; idx++)
                {
                    sb.AppendLine("<fixedDatums" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"FixedDatum\">");
                    FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
                    aFixedDatum.Reflection(sb);
                    sb.AppendLine("</fixedDatums" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._variableDatums.Count; idx++)
                {
                    sb.AppendLine("<variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</CommentPdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 9
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._groupEntityID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._groupedEntityCategory);
                    dos.WriteUnsignedByte((byte)this._groupedEntityDescriptions.Count);
                    dos.WriteUnsignedInt((uint)this._pad2);
                    dos.WriteDouble((double)this._latitude);
                    dos.WriteDouble((double)this._longitude);

                    for (int idx = 0; idx < this._groupedEntityDescriptions.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._groupedEntityDescriptions[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(VariableDatum obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            if (this._variableDatumID != obj._variableDatumID)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumLength != obj._variableDatumLength)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumBits != obj._variableDatumBits)
            {
                ivarsEqual = false;
            }

            if (this._padding != obj._padding)
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
Exemplo n.º 11
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedInt((uint)this._requestID);
                    dos.WriteUnsignedInt((uint)this._requestStatus);
                    dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
                    dos.WriteUnsignedInt((uint)this._variableDatums.Count);

                    for (int idx = 0; idx < this._fixedDatums.Count; idx++)
                    {
                        FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
                        aFixedDatum.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._variableDatums.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 12
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._aggregateID.GetMarshalledSize();      // this._aggregateID
            marshalSize += 1;                                          // this._forceID
            marshalSize += 1;                                          // this._aggregateState
            marshalSize += this._aggregateType.GetMarshalledSize();    // this._aggregateType
            marshalSize += 4;                                          // this._formation
            marshalSize += this._aggregateMarking.GetMarshalledSize(); // this._aggregateMarking
            marshalSize += this._dimensions.GetMarshalledSize();       // this._dimensions
            marshalSize += this._orientation.GetMarshalledSize();      // this._orientation
            marshalSize += this._centerOfMass.GetMarshalledSize();     // this._centerOfMass
            marshalSize += this._velocity.GetMarshalledSize();         // this._velocity
            marshalSize += 2;                                          // this._numberOfDisAggregates
            marshalSize += 2;                                          // this._numberOfDisEntities
            marshalSize += 2;                                          // this._numberOfSilentAggregateTypes
            marshalSize += 2;                                          // this._numberOfSilentEntityTypes
            for (int idx = 0; idx < this._aggregateIDList.Count; idx++)
            {
                AggregateID listElement = (AggregateID)this._aggregateIDList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._entityIDList.Count; idx++)
            {
                EntityID listElement = (EntityID)this._entityIDList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            marshalSize += 1;  // this._pad2
            for (int idx = 0; idx < this._silentAggregateSystemList.Count; idx++)
            {
                EntityType listElement = (EntityType)this._silentAggregateSystemList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._silentEntitySystemList.Count; idx++)
            {
                EntityType listElement = (EntityType)this._silentEntitySystemList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            marshalSize += 4;  // this._numberOfVariableDatumRecords
            for (int idx = 0; idx < this._variableDatumList.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._variableDatumList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 13
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._groupEntityID.GetMarshalledSize(); // this._groupEntityID
            marshalSize += 1;                                       // this._groupedEntityCategory
            marshalSize += 1;                                       // this._numberOfGroupedEntities
            marshalSize += 4;                                       // this._pad2
            marshalSize += 8;                                       // this._latitude
            marshalSize += 8;                                       // this._longitude
            for (int idx = 0; idx < this._groupedEntityDescriptions.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._groupedEntityDescriptions[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 14
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<ActionResponsePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<originatingID>");
                this._originatingID.Reflection(sb);
                sb.AppendLine("</originatingID>");
                sb.AppendLine("<receivingID>");
                this._receivingID.Reflection(sb);
                sb.AppendLine("</receivingID>");
                sb.AppendLine("<requestID type=\"uint\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<requestStatus type=\"uint\">" + this._requestStatus.ToString(CultureInfo.InvariantCulture) + "</requestStatus>");
                sb.AppendLine("<fixedDatums type=\"uint\">" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "</fixedDatums>");
                sb.AppendLine("<variableDatums type=\"uint\">" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatums>");
                for (int idx = 0; idx < this._fixedDatums.Count; idx++)
                {
                    sb.AppendLine("<fixedDatums" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"FixedDatum\">");
                    FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
                    aFixedDatum.Reflection(sb);
                    sb.AppendLine("</fixedDatums" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._variableDatums.Count; idx++)
                {
                    sb.AppendLine("<variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</ActionResponsePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 15
0
        public virtual int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize += 4;  // this._numberOfFixedDatums
            marshalSize += 4;  // this._numberOfVariableDatums
            for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
            {
                FixedDatum listElement = (FixedDatum)this._fixedDatumIDList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._variableDatumIDList[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 16
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._requiredReliabilityService = dis.ReadUnsignedByte();
                    this._pad1         = dis.ReadUnsignedShort();
                    this._pad2         = dis.ReadUnsignedByte();
                    this._requestID    = dis.ReadUnsignedInt();
                    this._timeInterval = dis.ReadUnsignedInt();
                    this._numberOfFixedDatumRecords    = dis.ReadUnsignedInt();
                    this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
                    {
                        FixedDatum anX = new FixedDatum();
                        anX.Unmarshal(dis);
                        this._fixedDatumRecords.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._variableDatumRecords.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 17
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._originatingID.Unmarshal(dis);
                    this._receivingID.Unmarshal(dis);
                    this._requestID                    = dis.ReadUnsignedInt();
                    this._requestStatus                = dis.ReadUnsignedInt();
                    this._numberOfFixedDatumRecords    = dis.ReadUnsignedInt();
                    this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
                    {
                        FixedDatum anX = new FixedDatum();
                        anX.Unmarshal(dis);
                        this._fixedDatums.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._variableDatums.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 18
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<DataQueryReliablePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<requiredReliabilityService type=\"byte\">" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "</requiredReliabilityService>");
                sb.AppendLine("<pad1 type=\"ushort\">" + this._pad1.ToString(CultureInfo.InvariantCulture) + "</pad1>");
                sb.AppendLine("<pad2 type=\"byte\">" + this._pad2.ToString(CultureInfo.InvariantCulture) + "</pad2>");
                sb.AppendLine("<requestID type=\"uint\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<timeInterval type=\"uint\">" + this._timeInterval.ToString(CultureInfo.InvariantCulture) + "</timeInterval>");
                sb.AppendLine("<fixedDatumRecords type=\"uint\">" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "</fixedDatumRecords>");
                sb.AppendLine("<variableDatumRecords type=\"uint\">" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatumRecords>");
                for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
                {
                    sb.AppendLine("<fixedDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"FixedDatum\">");
                    FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
                    aFixedDatum.Reflection(sb);
                    sb.AppendLine("</fixedDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
                {
                    sb.AppendLine("<variableDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</DataQueryReliablePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += 2;  // this._eventType
            marshalSize += 4;  // this._pad1
            marshalSize += 4;  // this._numberOfFixedDatumRecords
            marshalSize += 4;  // this._numberOfVariableDatumRecords
            for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
            {
                FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
            {
                VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<EventReportReliablePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<eventType type=\"ushort\">" + this._eventType.ToString(CultureInfo.InvariantCulture) + "</eventType>");
                sb.AppendLine("<pad1 type=\"uint\">" + this._pad1.ToString(CultureInfo.InvariantCulture) + "</pad1>");
                sb.AppendLine("<fixedDatumRecords type=\"uint\">" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "</fixedDatumRecords>");
                sb.AppendLine("<variableDatumRecords type=\"uint\">" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatumRecords>");
                for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
                {
                    sb.AppendLine("<fixedDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"FixedDatum\">");
                    FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
                    aFixedDatum.Reflection(sb);
                    sb.AppendLine("</fixedDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
                {
                    sb.AppendLine("<variableDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatumRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</EventReportReliablePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 21
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
                    dos.WriteUnsignedShort((ushort)this._pad1);
                    dos.WriteUnsignedByte((byte)this._pad2);
                    dos.WriteUnsignedInt((uint)this._requestID);
                    dos.WriteUnsignedInt((uint)this._timeInterval);
                    dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
                    dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);

                    for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
                    {
                        FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
                        aFixedDatum.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(VariableDatum obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            if (this._variableDatumID != obj._variableDatumID)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumLength != obj._variableDatumLength)
            {
                ivarsEqual = false;
            }

            if (this._variableDatums.Count != obj._variableDatums.Count)
            {
                ivarsEqual = false;
            }

            if (ivarsEqual)
            {
                for (int idx = 0; idx < this._variableDatums.Count; idx++)
                {
                    if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }

            return(ivarsEqual);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        /// 	<c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(VariableDatum obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            if (this._variableDatumID != obj._variableDatumID)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumLength != obj._variableDatumLength)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumBits != obj._variableDatumBits)
            {
                ivarsEqual = false;
            }

            if (this._padding != obj._padding)
            {
                ivarsEqual = false;
            }

            return ivarsEqual;
        }
Exemplo n.º 24
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._aggregateID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._forceID);
                    dos.WriteUnsignedByte((byte)this._aggregateState);
                    this._aggregateType.Marshal(dos);
                    dos.WriteUnsignedInt((uint)this._formation);
                    this._aggregateMarking.Marshal(dos);
                    this._dimensions.Marshal(dos);
                    this._orientation.Marshal(dos);
                    this._centerOfMass.Marshal(dos);
                    this._velocity.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._aggregateIDList.Count);
                    dos.WriteUnsignedShort((ushort)this._entityIDList.Count);
                    dos.WriteUnsignedShort((ushort)this._silentAggregateSystemList.Count);
                    dos.WriteUnsignedShort((ushort)this._silentEntitySystemList.Count);

                    for (int idx = 0; idx < this._aggregateIDList.Count; idx++)
                    {
                        AggregateID aAggregateID = (AggregateID)this._aggregateIDList[idx];
                        aAggregateID.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._entityIDList.Count; idx++)
                    {
                        EntityID aEntityID = (EntityID)this._entityIDList[idx];
                        aEntityID.Marshal(dos);
                    }
                    dos.WriteUnsignedByte((byte)this._pad2);

                    for (int idx = 0; idx < this._silentAggregateSystemList.Count; idx++)
                    {
                        EntityType aEntityType = (EntityType)this._silentAggregateSystemList[idx];
                        aEntityType.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._silentEntitySystemList.Count; idx++)
                    {
                        EntityType aEntityType = (EntityType)this._silentEntitySystemList[idx];
                        aEntityType.Marshal(dos);
                    }
                    dos.WriteUnsignedInt((uint)this._variableDatumList.Count);

                    for (int idx = 0; idx < this._variableDatumList.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._variableDatumList[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 25
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._aggregateID.Unmarshal(dis);
                    this._forceID        = dis.ReadUnsignedByte();
                    this._aggregateState = dis.ReadUnsignedByte();
                    this._aggregateType.Unmarshal(dis);
                    this._formation = dis.ReadUnsignedInt();
                    this._aggregateMarking.Unmarshal(dis);
                    this._dimensions.Unmarshal(dis);
                    this._orientation.Unmarshal(dis);
                    this._centerOfMass.Unmarshal(dis);
                    this._velocity.Unmarshal(dis);
                    this._numberOfDisAggregates        = dis.ReadUnsignedShort();
                    this._numberOfDisEntities          = dis.ReadUnsignedShort();
                    this._numberOfSilentAggregateTypes = dis.ReadUnsignedShort();
                    this._numberOfSilentEntityTypes    = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfDisAggregates; idx++)
                    {
                        AggregateID anX = new AggregateID();
                        anX.Unmarshal(dis);
                        this._aggregateIDList.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.NumberOfDisEntities; idx++)
                    {
                        EntityID anX = new EntityID();
                        anX.Unmarshal(dis);
                        this._entityIDList.Add(anX);
                    }
                    ;

                    this._pad2 = dis.ReadUnsignedByte();
                    for (int idx = 0; idx < this.NumberOfSilentAggregateTypes; idx++)
                    {
                        EntityType anX = new EntityType();
                        anX.Unmarshal(dis);
                        this._silentAggregateSystemList.Add(anX);
                    }
                    ;

                    for (int idx = 0; idx < this.NumberOfSilentEntityTypes; idx++)
                    {
                        EntityType anX = new EntityType();
                        anX.Unmarshal(dis);
                        this._silentEntitySystemList.Add(anX);
                    }
                    ;

                    this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._variableDatumList.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfFixedDatums = dis.ReadUnsignedInt();
                    this._numberOfVariableDatums = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfFixedDatums; idx++)
                    {
                        FixedDatum anX = new FixedDatum();
                        anX.Unmarshal(dis);
                        this._fixedDatumIDList.Add(anX);
                    };

                    for (int idx = 0; idx < this.NumberOfVariableDatums; idx++)
                    {
                        VariableDatum anX = new VariableDatum();
                        anX.Unmarshal(dis);
                        this._variableDatumIDList.Add(anX);
                    };

                }
                catch (Exception e)
                {
            #if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
            #endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        /// 	<c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(VariableDatum obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            if (this._variableDatumID != obj._variableDatumID)
            {
                ivarsEqual = false;
            }

            if (this._variableDatumLength != obj._variableDatumLength)
            {
                ivarsEqual = false;
            }

            if (this._variableDatums.Count != obj._variableDatums.Count)
            {
                ivarsEqual = false;
            }

            if (ivarsEqual)
            {
                for (int idx = 0; idx < this._variableDatums.Count; idx++)
                {
                    if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }

            return ivarsEqual;
        }
Exemplo n.º 28
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<AggregateStatePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<aggregateID>");
                this._aggregateID.Reflection(sb);
                sb.AppendLine("</aggregateID>");
                sb.AppendLine("<forceID type=\"byte\">" + this._forceID.ToString(CultureInfo.InvariantCulture) + "</forceID>");
                sb.AppendLine("<aggregateState type=\"byte\">" + this._aggregateState.ToString(CultureInfo.InvariantCulture) + "</aggregateState>");
                sb.AppendLine("<aggregateType>");
                this._aggregateType.Reflection(sb);
                sb.AppendLine("</aggregateType>");
                sb.AppendLine("<formation type=\"uint\">" + this._formation.ToString(CultureInfo.InvariantCulture) + "</formation>");
                sb.AppendLine("<aggregateMarking>");
                this._aggregateMarking.Reflection(sb);
                sb.AppendLine("</aggregateMarking>");
                sb.AppendLine("<dimensions>");
                this._dimensions.Reflection(sb);
                sb.AppendLine("</dimensions>");
                sb.AppendLine("<orientation>");
                this._orientation.Reflection(sb);
                sb.AppendLine("</orientation>");
                sb.AppendLine("<centerOfMass>");
                this._centerOfMass.Reflection(sb);
                sb.AppendLine("</centerOfMass>");
                sb.AppendLine("<velocity>");
                this._velocity.Reflection(sb);
                sb.AppendLine("</velocity>");
                sb.AppendLine("<aggregateIDList type=\"ushort\">" + this._aggregateIDList.Count.ToString(CultureInfo.InvariantCulture) + "</aggregateIDList>");
                sb.AppendLine("<entityIDList type=\"ushort\">" + this._entityIDList.Count.ToString(CultureInfo.InvariantCulture) + "</entityIDList>");
                sb.AppendLine("<silentAggregateSystemList type=\"ushort\">" + this._silentAggregateSystemList.Count.ToString(CultureInfo.InvariantCulture) + "</silentAggregateSystemList>");
                sb.AppendLine("<silentEntitySystemList type=\"ushort\">" + this._silentEntitySystemList.Count.ToString(CultureInfo.InvariantCulture) + "</silentEntitySystemList>");
                for (int idx = 0; idx < this._aggregateIDList.Count; idx++)
                {
                    sb.AppendLine("<aggregateIDList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"AggregateID\">");
                    AggregateID aAggregateID = (AggregateID)this._aggregateIDList[idx];
                    aAggregateID.Reflection(sb);
                    sb.AppendLine("</aggregateIDList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._entityIDList.Count; idx++)
                {
                    sb.AppendLine("<entityIDList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"EntityID\">");
                    EntityID aEntityID = (EntityID)this._entityIDList[idx];
                    aEntityID.Reflection(sb);
                    sb.AppendLine("</entityIDList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("<pad2 type=\"byte\">" + this._pad2.ToString(CultureInfo.InvariantCulture) + "</pad2>");
                for (int idx = 0; idx < this._silentAggregateSystemList.Count; idx++)
                {
                    sb.AppendLine("<silentAggregateSystemList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"EntityType\">");
                    EntityType aEntityType = (EntityType)this._silentAggregateSystemList[idx];
                    aEntityType.Reflection(sb);
                    sb.AppendLine("</silentAggregateSystemList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                for (int idx = 0; idx < this._silentEntitySystemList.Count; idx++)
                {
                    sb.AppendLine("<silentEntitySystemList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"EntityType\">");
                    EntityType aEntityType = (EntityType)this._silentEntitySystemList[idx];
                    aEntityType.Reflection(sb);
                    sb.AppendLine("</silentEntitySystemList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("<variableDatumList type=\"uint\">" + this._variableDatumList.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatumList>");
                for (int idx = 0; idx < this._variableDatumList.Count; idx++)
                {
                    sb.AppendLine("<variableDatumList" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableDatum\">");
                    VariableDatum aVariableDatum = (VariableDatum)this._variableDatumList[idx];
                    aVariableDatum.Reflection(sb);
                    sb.AppendLine("</variableDatumList" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</AggregateStatePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }