예제 #1
0
        public void setOutputOperator()
        {
            // For every Operator type requesting, select the right instance
            List <SourceOPs> tempList = new List <SourceOPs>(information.outputs);

            while (tempList.Count > 0)
            {
                SourceOPs        s          = tempList[0];
                List <SourceOPs> candidates = tempList.FindAll(x => x.name == s.name);

                switch (information.routing)
                {
                case RoutingOption.PRIMARY:
                    outputOperators.Add(getPrimary(candidates));
                    break;

                case RoutingOption.HASHING:
                    outputOperators.Add(getHashing(candidates));
                    break;

                case RoutingOption.RANDOM:
                    outputOperators.Add(getRandom(candidates));
                    break;
                }
                tempList.RemoveAll(x => x.name.Equals(s.name));
            }
        }
예제 #2
0
 public override bool Equals(object obj)
 {
     if (obj.GetType() == typeof(SourceOPs))
     {
         SourceOPs that = (SourceOPs)obj;
         return(this.name.Equals(that.name) && this.portnumber == that.portnumber);
     }
     return(false);
 }