/**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(TransferControlRequestPdu rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_orginatingEntityID.Equals(rhs._orginatingEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_recevingEntityID.Equals(rhs._recevingEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_requestID == rhs._requestID))
            {
                ivarsEqual = false;
            }
            if (!(_requiredReliabilityService == rhs._requiredReliabilityService))
            {
                ivarsEqual = false;
            }
            if (!(_tranferType == rhs._tranferType))
            {
                ivarsEqual = false;
            }
            if (!(_transferEntityID.Equals(rhs._transferEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfRecordSets == rhs._numberOfRecordSets))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _recordSets.Count; idx++)
            {
                RecordSet x = (RecordSet)_recordSets[idx];
                if (!(_recordSets[idx].Equals(rhs._recordSets[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
示例#2
0
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + 4; // _requestID
            marshalSize = marshalSize + 1; // _requiredReliabilityService
            marshalSize = marshalSize + 2; // _pad1
            marshalSize = marshalSize + 1; // _pad2
            marshalSize = marshalSize + 4; // _numberOfRecordSets
            for (int idx = 0; idx < _recordSets.Count; idx++)
            {
                RecordSet listElement = (RecordSet)_recordSets[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
示例#3
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(SetRecordReliablePdu rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_requestID == rhs._requestID))
            {
                ivarsEqual = false;
            }
            if (!(_requiredReliabilityService == rhs._requiredReliabilityService))
            {
                ivarsEqual = false;
            }
            if (!(_pad1 == rhs._pad1))
            {
                ivarsEqual = false;
            }
            if (!(_pad2 == rhs._pad2))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfRecordSets == rhs._numberOfRecordSets))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _recordSets.Count; idx++)
            {
                RecordSet x = (RecordSet)_recordSets[idx];
                if (!(_recordSets[idx].Equals(rhs._recordSets[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _orginatingEntityID.getMarshalledSize(); // _orginatingEntityID
            marshalSize = marshalSize + _recevingEntityID.getMarshalledSize();   // _recevingEntityID
            marshalSize = marshalSize + 4;                                       // _requestID
            marshalSize = marshalSize + 1;                                       // _requiredReliabilityService
            marshalSize = marshalSize + 1;                                       // _tranferType
            marshalSize = marshalSize + _transferEntityID.getMarshalledSize();   // _transferEntityID
            marshalSize = marshalSize + 1;                                       // _numberOfRecordSets
            for (int idx = 0; idx < _recordSets.Count; idx++)
            {
                RecordSet listElement = (RecordSet)_recordSets[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
示例#5
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                dos.writeUint((uint)_requestID);
                dos.writeByte((byte)_requiredReliabilityService);
                dos.writeUshort((ushort)_pad1);
                dos.writeByte((byte)_pad2);
                dos.writeUint((uint)_recordSets.Count);

                for (int idx = 0; idx < _recordSets.Count; idx++)
                {
                    RecordSet aRecordSet = (RecordSet)_recordSets[idx];
                    aRecordSet.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#6
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(RecordSet rhs)
        {
            bool ivarsEqual = true;

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


            if (!(_recordID == rhs._recordID))
            {
                ivarsEqual = false;
            }
            if (!(_recordSetSerialNumber == rhs._recordSetSerialNumber))
            {
                ivarsEqual = false;
            }
            if (!(_recordLength == rhs._recordLength))
            {
                ivarsEqual = false;
            }
            if (!(_recordCount == rhs._recordCount))
            {
                ivarsEqual = false;
            }
            if (!(_recordValues == rhs._recordValues))
            {
                ivarsEqual = false;
            }
            if (!(_pad4 == rhs._pad4))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<TransferControlRequestPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<orginatingEntityID>" + System.Environment.NewLine);
                _orginatingEntityID.reflection(sb);
                sb.Append("</orginatingEntityID>" + System.Environment.NewLine);
                sb.Append("<recevingEntityID>" + System.Environment.NewLine);
                _recevingEntityID.reflection(sb);
                sb.Append("</recevingEntityID>" + System.Environment.NewLine);
                sb.Append("<requestID type=\"uint\">" + _requestID.ToString() + "</requestID> " + System.Environment.NewLine);
                sb.Append("<requiredReliabilityService type=\"byte\">" + _requiredReliabilityService.ToString() + "</requiredReliabilityService> " + System.Environment.NewLine);
                sb.Append("<tranferType type=\"byte\">" + _tranferType.ToString() + "</tranferType> " + System.Environment.NewLine);
                sb.Append("<transferEntityID>" + System.Environment.NewLine);
                _transferEntityID.reflection(sb);
                sb.Append("</transferEntityID>" + System.Environment.NewLine);
                sb.Append("<recordSets type=\"byte\">" + _recordSets.Count.ToString() + "</recordSets> " + System.Environment.NewLine);

                for (int idx = 0; idx < _recordSets.Count; idx++)
                {
                    sb.Append("<recordSets" + idx.ToString() + " type=\"RecordSet\">" + System.Environment.NewLine);
                    RecordSet aRecordSet = (RecordSet)_recordSets[idx];
                    aRecordSet.reflection(sb);
                    sb.Append("</recordSets" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</TransferControlRequestPdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
                _orginatingEntityID.unmarshal(dis);
                _recevingEntityID.unmarshal(dis);
                _requestID = dis.readUint();
                _requiredReliabilityService = dis.readByte();
                _tranferType = dis.readByte();
                _transferEntityID.unmarshal(dis);
                _numberOfRecordSets = dis.readByte();
                for(int idx = 0; idx < _numberOfRecordSets; idx++)
                {
                    RecordSet anX = new RecordSet();
                    anX.unmarshal(dis);
                    _recordSets.Add(anX);
                };

            } // end try
            catch(Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        }
示例#9
0
        /**
          * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
          */
        public bool equals(RecordSet rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
            return false;

             if( ! (_recordID == rhs._recordID)) ivarsEqual = false;
             if( ! (_recordSetSerialNumber == rhs._recordSetSerialNumber)) ivarsEqual = false;
             if( ! (_recordLength == rhs._recordLength)) ivarsEqual = false;
             if( ! (_recordCount == rhs._recordCount)) ivarsEqual = false;
             if( ! (_recordValues == rhs._recordValues)) ivarsEqual = false;
             if( ! (_pad4 == rhs._pad4)) ivarsEqual = false;

            return ivarsEqual;
        }