public RCounterPayload CloneValues() { // TODO: optimize RCounterPayload copy = new RCounterPayload(uid, this.PVector.Count, this.replicaid); copy.PVector = new List <int>(this.PVector); copy.NVector = new List <int>(this.NVector); return(copy); }
public static RCounterPayload StrToPayload(string str) { RCounterPayload pl = new RCounterPayload("", (int)Config.numReplicas, (int)Config.replicaId); string pvecstr = str.Split("||")[0]; string nvecstr = str.Split("||")[1]; var plisttemp = new List <string>(pvecstr.Split(",")); pl.PVector = plisttemp.Select(int.Parse).ToList(); var nlisttemp = new List <string>(nvecstr.Split(",")); pl.NVector = nlisttemp.Select(int.Parse).ToList(); return(pl); }