示例#1
0
文件: Txn.cs 项目: Bart-Li/Base
        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);
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="a_"></param>
 /// <param name="tag"></param>
 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);
 }
示例#3
0
文件: Txn.cs 项目: Bart-Li/Base
        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);
        }