Exemplo n.º 1
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._minefieldID.Unmarshal(dis);
                    this._requestingEntityID.Unmarshal(dis);
                    this._requestID           = dis.ReadUnsignedByte();
                    this._numberOfMissingPdus = dis.ReadUnsignedByte();
                    for (int idx = 0; idx < this.NumberOfMissingPdus; idx++)
                    {
                        EightByteChunk anX = new EightByteChunk();
                        anX.Unmarshal(dis);
                        this._missingPduSequenceNumbers.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 2
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<MinefieldResponseNackPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<minefieldID>");
                this._minefieldID.Reflection(sb);
                sb.AppendLine("</minefieldID>");
                sb.AppendLine("<requestingEntityID>");
                this._requestingEntityID.Reflection(sb);
                sb.AppendLine("</requestingEntityID>");
                sb.AppendLine("<requestID type=\"byte\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<missingPduSequenceNumbers type=\"byte\">" + this._missingPduSequenceNumbers.Count.ToString(CultureInfo.InvariantCulture) + "</missingPduSequenceNumbers>");
                for (int idx = 0; idx < this._missingPduSequenceNumbers.Count; idx++)
                {
                    sb.AppendLine("<missingPduSequenceNumbers" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"EightByteChunk\">");
                    EightByteChunk aEightByteChunk = (EightByteChunk)this._missingPduSequenceNumbers[idx];
                    aEightByteChunk.Reflection(sb);
                    sb.AppendLine("</missingPduSequenceNumbers" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</MinefieldResponseNackPdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 3
0
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<VariableDatum>");
            try
            {
                sb.AppendLine("<variableDatumID type=\"uint\">" + this._variableDatumID.ToString(CultureInfo.InvariantCulture) + "</variableDatumID>");
                sb.AppendLine("<variableDatums type=\"uint\">" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "</variableDatums>");
                for (int idx = 0; idx < this._variableDatums.Count; idx++)
                {
                    sb.AppendLine("<variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"EightByteChunk\">");
                    EightByteChunk aEightByteChunk = (EightByteChunk)this._variableDatums[idx];
                    aEightByteChunk.Reflection(sb);
                    sb.AppendLine("</variableDatums" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</VariableDatum>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Exemplo n.º 4
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._minefieldID.Marshal(dos);
                    this._requestingEntityID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._requestID);
                    dos.WriteUnsignedByte((byte)this._missingPduSequenceNumbers.Count);

                    for (int idx = 0; idx < this._missingPduSequenceNumbers.Count; idx++)
                    {
                        EightByteChunk aEightByteChunk = (EightByteChunk)this._missingPduSequenceNumbers[idx];
                        aEightByteChunk.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 5
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(EightByteChunk obj)
        {
            bool ivarsEqual = true;

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

            if (obj._otherParameters.Length != 8)
            {
                ivarsEqual = false;
            }

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

            return(ivarsEqual);
        }
Exemplo n.º 6
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._variableDatumID     = dis.ReadUnsignedInt();
                    this._variableDatumLength = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.VariableDatumLength; idx++)
                    {
                        EightByteChunk anX = new EightByteChunk();
                        anX.Unmarshal(dis);
                        this._variableDatums.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 7
0
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedInt((uint)this._variableDatumID);
                    dos.WriteUnsignedInt((uint)this._variableDatums.Count);

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

            marshalSize += 4;  // this._variableDatumID
            marshalSize += 4;  // this._variableDatumLength
            for (int idx = 0; idx < this._variableDatums.Count; idx++)
            {
                EightByteChunk listElement = (EightByteChunk)this._variableDatums[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

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

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._minefieldID.GetMarshalledSize();        // this._minefieldID
            marshalSize += this._requestingEntityID.GetMarshalledSize(); // this._requestingEntityID
            marshalSize += 1;                                            // this._requestID
            marshalSize += 1;                                            // this._numberOfMissingPdus
            for (int idx = 0; idx < this._missingPduSequenceNumbers.Count; idx++)
            {
                EightByteChunk listElement = (EightByteChunk)this._missingPduSequenceNumbers[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 10
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._variableDatumID = dis.ReadUnsignedInt();
                    this._variableDatumLength = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.VariableDatumLength; idx++)
                    {
                        EightByteChunk anX = new EightByteChunk();
                        anX.Unmarshal(dis);
                        this._variableDatums.Add(anX);
                    };

                }
                catch (Exception e)
                {
            #if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
            #endif
                    this.OnException(e);
                }
            }
        }
Exemplo n.º 11
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(EightByteChunk obj)
        {
            bool ivarsEqual = true;

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

            if (obj._otherParameters.Length != 8)
            {
                ivarsEqual = false;
            }

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

            return ivarsEqual;
        }