Exemple #1
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Op != null)
                {
                    hash = hash * 59 + Op.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (SegmentationEnabled != null)
                {
                    hash = hash * 59 + SegmentationEnabled.GetHashCode();
                }

                if (Clk != null)
                {
                    hash = hash * 59 + Clk.GetHashCode();
                }

                if (HeartbeatMs != null)
                {
                    hash = hash * 59 + HeartbeatMs.GetHashCode();
                }

                if (InitialClk != null)
                {
                    hash = hash * 59 + InitialClk.GetHashCode();
                }

                if (MarketFilter != null)
                {
                    hash = hash * 59 + MarketFilter.GetHashCode();
                }

                if (ConflateMs != null)
                {
                    hash = hash * 59 + ConflateMs.GetHashCode();
                }

                if (MarketDataFilter != null)
                {
                    hash = hash * 59 + MarketDataFilter.GetHashCode();
                }

                return(hash);
            }
        }
Exemple #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MarketSubscriptionMessage" /> class.
 ///     Initializes a new instance of the <see cref="MarketSubscriptionMessage" />class.
 /// </summary>
 /// <param name="Op">The operation type.</param>
 /// <param name="Id">Client generated unique id to link request with response (like json rpc).</param>
 /// <param name="SegmentationEnabled">Segmentation Enabled - allow the server to send large sets of data in segments, instead of a single block.</param>
 /// <param name="Clk">Token value delta (received in MarketChangeMessage) that should be passed to resume a subscription.</param>
 /// <param name="HeartbeatMs">Heartbeat Milliseconds - the heartbeat rate (looped back on initial image after validation: bounds are 500 to 30000).</param>
 /// <param name="InitialClk">Token value (received in initial MarketChangeMessage) that should be passed to resume a subscription.</param>
 /// <param name="MarketFilter">MarketFilter.</param>
 /// <param name="ConflateMs">Conflate Milliseconds - the conflation rate (looped back on initial image after validation: bounds are 0 to 120000).</param>
 /// <param name="MarketDataFilter">MarketDataFilter.</param>
 public MarketSubscriptionMessage(
     string Op = null,
     int?Id    = null,
     bool?SegmentationEnabled = null,
     string Clk                        = null,
     long?HeartbeatMs                  = null,
     string InitialClk                 = null,
     MarketFilter MarketFilter         = null,
     long?ConflateMs                   = null,
     MarketDataFilter MarketDataFilter = null)
 {
     this.Op = Op;
     this.Id = Id;
     this.SegmentationEnabled = SegmentationEnabled;
     this.Clk              = Clk;
     this.HeartbeatMs      = HeartbeatMs;
     this.InitialClk       = InitialClk;
     this.MarketFilter     = MarketFilter;
     this.ConflateMs       = ConflateMs;
     this.MarketDataFilter = MarketDataFilter;
 }
Exemple #3
0
        /// <summary>
        ///     Returns true if MarketSubscriptionMessage instances are equal
        /// </summary>
        /// <param name="other">Instance of MarketSubscriptionMessage to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MarketSubscriptionMessage other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Op == other.Op || Op != null && Op.Equals(other.Op)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (SegmentationEnabled == other.SegmentationEnabled || SegmentationEnabled != null && SegmentationEnabled.Equals(other.SegmentationEnabled)) &&
                   (Clk == other.Clk || Clk != null && Clk.Equals(other.Clk)) &&
                   (HeartbeatMs == other.HeartbeatMs || HeartbeatMs != null && HeartbeatMs.Equals(other.HeartbeatMs)) &&
                   (InitialClk == other.InitialClk || InitialClk != null && InitialClk.Equals(other.InitialClk)) &&
                   (MarketFilter == other.MarketFilter || MarketFilter != null && MarketFilter.Equals(other.MarketFilter)) &&
                   (ConflateMs == other.ConflateMs || ConflateMs != null && ConflateMs.Equals(other.ConflateMs)) &&
                   (MarketDataFilter == other.MarketDataFilter || MarketDataFilter != null && MarketDataFilter.Equals(other.MarketDataFilter)));
        }