Beispiel #1
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (EVSEId != null
                            ? EVSEId.GetHashCode() * 9
                            : 0) ^

                       (PartnerProductId != null
                            ? PartnerProductId.GetHashCode() * 7
                            : 0) ^

                       (SessionId != null
                            ? SessionId.GetHashCode() * 5
                            : 0) ^

                       (CPOPartnerSessionId != null
                            ? CPOPartnerSessionId.GetHashCode() * 3
                            : 0) ^

                       (EMPPartnerSessionId != null
                            ? EMPPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (OperatorId != null ? OperatorId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ReplicaId;
         hashCode = (hashCode * 397) ^ SeqNumber.GetHashCode();
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = MarkedTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (OperatorId != null ? OperatorId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ SubTaskIndex;
         return(hashCode);
     }
 }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 13 ^
                       SessionId.GetHashCode() * 11 ^
                       Identification.GetHashCode() * 7 ^

                       (EVSEId?.GetHashCode() ?? 0) * 5 ^
                       (CPOPartnerSessionId?.GetHashCode() ?? 0) * 3 ^
                       (EMPPartnerSessionId?.GetHashCode() ?? 0));
            }
        }
Beispiel #5
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 7
                            : 0) ^

                       PartnerId.GetHashCode() * 5 ^
                       OperatorId.GetHashCode() * 3 ^
                       ChargeDetailRecord.GetHashCode());
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(EVSEStatusRecords.GetHashCode() * 17 ^
                       OperatorId.GetHashCode() * 11 ^

                       (OperatorName != null
                            ? OperatorName.GetHashCode() * 5
                            : 0) ^

                       Action.GetHashCode());
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 5 ^

                       (OperatorName.IsNotNullOrEmpty()
                            ? OperatorName.GetHashCode()
                            : 0) * 3 ^

                       (EVSEStatusRecords.Any()
                            ? EVSEStatusRecords.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 31
                            : 0) ^

                       PartnerId.GetHashCode() * 29 ^
                       OperatorId.GetHashCode() * 23 ^
                       EVSEId.GetHashCode() * 21 ^


                       (AvailabilityStatusEventDate.HasValue
                            ? AvailabilityStatusEventDate.GetHashCode() * 19
                            : 0) ^

                       (AvailabilityStatus.HasValue
                            ? AvailabilityStatus.GetHashCode() * 17
                            : 0) ^

                       (AvailabilityStatusUntil.HasValue
                            ? AvailabilityStatusUntil.GetHashCode() * 13
                            : 0) ^

                       (AvailabilityStatusComment.IsNeitherNullNorEmpty()
                            ? AvailabilityStatusComment.GetHashCode() * 11
                            : 0) ^


                       (BusyStatusEventDate.HasValue
                            ? BusyStatusEventDate.GetHashCode() * 7
                            : 0) ^

                       (BusyStatus.HasValue
                            ? BusyStatus.GetHashCode() * 3
                            : 0) ^

                       (BusyStatusUntil.HasValue
                            ? BusyStatusUntil.GetHashCode() * 3
                            : 0) ^

                       (BusyStatusComment.IsNeitherNullNorEmpty()
                            ? BusyStatusComment.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 13
                            : 0) ^

                       PartnerId.GetHashCode() * 11 ^
                       OperatorId.GetHashCode() * 7 ^
                       ServiceSessionId.GetHashCode() * 5 ^
                       SessionEvent.GetHashCode() * 3 ^

                       (ExecPartnerSessionId.HasValue
                            ? ExecPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
Beispiel #10
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 19
                            : 0) ^

                       PartnerId.GetHashCode() * 17 ^
                       OperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 3);

                //(PartnerServiceSessionId.HasValue
                //     ? PartnerServiceSessionId.GetHashCode()
                //     : 0);
            }
        }
Beispiel #11
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(TransactionId.GetHashCode() * 21 ^
                       PartnerId.GetHashCode() * 19 ^
                       OperatorId.GetHashCode() * 17 ^
                       TargetOperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 5 ^

                       (ServiceSessionId.HasValue
                            ? ServiceSessionId.GetHashCode() * 3
                            : 0) ^

                       (BookingId.HasValue
                            ? BookingId.GetHashCode()
                            : 0));
            }
        }
Beispiel #12
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (OperatorId.Length != 0)
            {
                hash ^= OperatorId.GetHashCode();
            }
            if (Ip.Length != 0)
            {
                hash ^= Ip.GetHashCode();
            }
            if (Content.Length != 0)
            {
                hash ^= Content.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 23
                            : 0) ^

                       PartnerId.GetHashCode() * 21 ^
                       OperatorId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 13 ^
                       StatusEventDate.GetHashCode() * 11 ^
                       BusyStatus.GetHashCode() * 7 ^

                       (BusyStatusUntil.HasValue
                            ? BusyStatusUntil.GetHashCode() * 5
                            : 0) ^

                       (BusyStatusComment.IsNeitherNullNorEmpty()
                            ? BusyStatusComment.GetHashCode() * 3
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 19
                            : 0) ^

                       PartnerId.GetHashCode() * 17 ^
                       OperatorId.GetHashCode() * 13 ^
                       ChargingStationId.GetHashCode() * 11 ^
                       StatusEventDate.GetHashCode() * 7 ^
                       AvailabilityStatus.GetHashCode() * 5 ^

                       (AvailabilityStatusUntil.HasValue
                            ? AvailabilityStatusUntil.GetHashCode() * 3
                            : 0) ^

                       (AvailabilityStatusComment.IsNeitherNullNorEmpty()
                            ? AvailabilityStatusComment.GetHashCode()
                            : 0));
            }
        }
Beispiel #15
0
        public Replica(ReplicaCreationInfo rep)
        {
            // Console.WriteLine("\a");
            var info = rep.Operator;

            this.OperatorId      = info.ID;
            this.MasterURL       = info.MasterURL;
            this.ProcessFunction = Operations.GetOperation(info.OperatorFunction, info.OperatorFunctionArgs);


            this.shouldNotify = info.ShouldNotify;
            this.inputFiles   = info.InputFiles;
            // primary is the first one in the array
            this.SelfURL      = rep.Address;
            this.MasterURL    = info.MasterURL;
            this.ID           = rep.Id;
            this.destinations = new Dictionary <string, Destination>();

            if (info.OutputOperators == null || info.OutputOperators.Count == 0)
            {
                // it is an output operator
                //this.destinations.Add("output_file", new OutputFile(this, info.Semantic));
            }
            else
            {
                foreach (var dstInfo in info.OutputOperators)
                {
                    destinations.Add(dstInfo.ID, new NeighbourOperator(this, dstInfo, info.Semantic));
                }
            }

            var allOrigins = new List <OriginOperator>();

            this.originOperators = new Dictionary <string, List <OriginOperator> >();
            foreach (var op in info.InputReplicas.Keys)
            {
                this.originOperators[op] = new List <OriginOperator>();
                for (int i = 0; i < info.InputReplicas[op].Count; i++)
                {
                    this.originOperators[op].Add(new OriginOperator(op, i));
                    allOrigins.Add(originOperators[op][i]);
                }
            }
            if (inputFiles != null && inputFiles.Count > 0)
            {
                this.originOperators[this.OperatorId] = new List <OriginOperator>();
                this.originOperators[this.OperatorId].Add(new OriginOperator(this.OperatorId, 0));
                allOrigins.Add(originOperators[this.OperatorId][0]);
            }
            this.inBuffer = new MergedInBuffer(allOrigins);



            if (info.RtStrategy == SharedTypes.RoutingStrategy.Primary)
            {
                this.routingStrategy = new PrimaryStrategy(info.Addresses.Count);
            }
            else if (info.RtStrategy == SharedTypes.RoutingStrategy.Hashing)
            {
                this.routingStrategy = new HashingStrategy(info.Addresses.Count, info.HashingArg);
            }
            else
            {
                this.routingStrategy = new RandomStrategy(info.Addresses.Count, OperatorId.GetHashCode());
            }

            // Start reading from file(s)

            Task.Run(() => mainLoop());

            if (shouldNotify)
            {
                //destinations.Add(new LoggerDestination(this, info.Semantic, $"{OperatorId}({ID})", MasterURL));
                destinations.Add("puppet_master_logger", new LoggerDestination(this, info.Semantic, SelfURL, MasterURL));
            }

            // Configure windows position

            string a = this.OperatorId;

            if (a.Equals("OP1"))
            {
                SetWindowPosition(600, 0, 400, 200);
            }
            if (a.Equals("OP2"))
            {
                SetWindowPosition(950, 0, 400, 200);
            }
            if (a.Equals("OP3"))
            {
                SetWindowPosition(600, 200, 400, 200);
            }
            if (a.Equals("OP4"))
            {
                SetWindowPosition(950, 200, 400, 200);
            }
            if (a.Equals("OP5"))
            {
                SetWindowPosition(600, 400, 400, 200);
            }
            if (a.Equals("OP6"))
            {
                SetWindowPosition(950, 400, 400, 200);
            }
            if (a.Equals("OP7"))
            {
                SetWindowPosition(600, 600, 400, 200);
            }
            if (a.Equals("OP8"))
            {
                SetWindowPosition(950, 600, 400, 200);
            }
            if (a.Equals("OP9"))
            {
                SetWindowPosition(600, 800, 400, 200);
            }
        }
Beispiel #16
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()

        => OperatorId.GetHashCode() ^
        Suffix.GetHashCode();
Beispiel #17
0
 /// <summary>
 /// Return the HashCode of this object.
 /// </summary>
 /// <returns>The HashCode of this object.</returns>
 public override Int32 GetHashCode()
 => CountryCode.Alpha2Code.GetHashCode() ^ OperatorId.GetHashCode();