コード例 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (timestamp_ != null)
            {
                hash ^= Timestamp.GetHashCode();
            }
            if (Side != 0)
            {
                hash ^= Side.GetHashCode();
            }
            if (Size != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Size);
            }
            if (Price != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Price);
            }
            if (TickDirection != 0)
            {
                hash ^= TickDirection.GetHashCode();
            }
            if (TradeMatchId.Length != 0)
            {
                hash ^= TradeMatchId.GetHashCode();
            }
            if (GrossValue != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(GrossValue);
            }
            if (HomeNotional != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(HomeNotional);
            }
            if (ForeignNotional != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ForeignNotional);
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Direction.GetHashCode();

                hashCode = hashCode * 59 + TickDirection.GetHashCode();
                if (Timestamp != null)
                {
                    hashCode = hashCode * 59 + Timestamp.GetHashCode();
                }
                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }
                if (TradeSeq != null)
                {
                    hashCode = hashCode * 59 + TradeSeq.GetHashCode();
                }
                if (TradeId != null)
                {
                    hashCode = hashCode * 59 + TradeId.GetHashCode();
                }
                if (Iv != null)
                {
                    hashCode = hashCode * 59 + Iv.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }
                return(hashCode);
            }
        }
コード例 #3
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Direction.GetHashCode();

                hashCode = hashCode * 59 + FeeCurrency.GetHashCode();
                if (OrderId != null)
                {
                    hashCode = hashCode * 59 + OrderId.GetHashCode();
                }
                if (Timestamp != null)
                {
                    hashCode = hashCode * 59 + Timestamp.GetHashCode();
                }
                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }
                if (Iv != null)
                {
                    hashCode = hashCode * 59 + Iv.GetHashCode();
                }
                if (TradeId != null)
                {
                    hashCode = hashCode * 59 + TradeId.GetHashCode();
                }
                if (Fee != null)
                {
                    hashCode = hashCode * 59 + Fee.GetHashCode();
                }

                hashCode = hashCode * 59 + OrderType.GetHashCode();
                if (TradeSeq != null)
                {
                    hashCode = hashCode * 59 + TradeSeq.GetHashCode();
                }
                if (SelfTrade != null)
                {
                    hashCode = hashCode * 59 + SelfTrade.GetHashCode();
                }

                hashCode = hashCode * 59 + State.GetHashCode();
                if (Label != null)
                {
                    hashCode = hashCode * 59 + Label.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }

                hashCode = hashCode * 59 + TickDirection.GetHashCode();
                if (MatchingId != null)
                {
                    hashCode = hashCode * 59 + MatchingId.GetHashCode();
                }

                hashCode = hashCode * 59 + Liquidity.GetHashCode();
                return(hashCode);
            }
        }