Exemple #1
0
        public override bool Equals(object obj)
        {
            Txn peer = (Txn)obj;

            if (peer == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(peer, this))
            {
                return(true);
            }
            bool ret = false;

            ret = (Type == peer.Type);
            if (!ret)
            {
                return(ret);
            }
            ret = Data.Equals(peer.Data);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
Exemple #2
0
 public void Deserialize(IInputArchive a_, String tag)
 {
     a_.StartRecord(tag);
     {
         IIndex vidx1 = a_.StartVector("txns");
         if (vidx1 != null)
         {
             var tmpLst = new System.Collections.Generic.List <Txn>();
             for (; !vidx1.Done(); vidx1.Incr())
             {
                 Txn e1;
                 e1 = new Txn();
                 a_.ReadRecord(e1, "e1");
                 tmpLst.Add(e1);
             }
             Txns = tmpLst;
         }
         a_.EndVector("txns");
     }
     a_.EndRecord(tag);
 }
Exemple #3
0
        public int CompareTo(object obj)
        {
            Txn peer = (Txn)obj;

            if (peer == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int ret = 0;

            ret = (Type == peer.Type)? 0 :((Type < peer.Type)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = Data.CompareTo(peer.Data);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }