public override int GetHashCode(DbgObjectId objectId) { if (objectId == null) { throw new ArgumentNullException(nameof(objectId)); } return(GetRuntimeObjectIdService(objectId.Runtime).GetHashCode(objectId)); }
public override bool Equals(DbgObjectId objectId, DbgValue value) { if (objectId == null) { throw new ArgumentNullException(nameof(objectId)); } if (value == null) { throw new ArgumentNullException(nameof(value)); } return(GetRuntimeObjectIdService(objectId.Runtime).Equals(objectId, value)); }
public override DbgObjectId[] CreateObjectIds(DbgValue[] values) { if (values == null) { throw new ArgumentNullException(nameof(values)); } if (values.Length == 0) { return(Array.Empty <DbgObjectId>()); } // Common case if (values.Length == 1) { var value = values[0] ?? throw new ArgumentException(); return(GetRuntimeObjectIdService(value.Runtime).CreateObjectIds(values)); } var dict = new Dictionary <DbgRuntime, List <(DbgValue value, int index)> >(); for (int i = 0; i < values.Length; i++) { var value = values[i]; if (value == null) { throw new ArgumentException(); } if (!dict.TryGetValue(value.Runtime, out var list)) { dict.Add(value.Runtime, list = new List <(DbgValue, int)>()); } list.Add((value, i)); } var res = new DbgObjectId[values.Length]; foreach (var kv in dict) { var objectIds = GetRuntimeObjectIdService(kv.Key).CreateObjectIds(kv.Value.Select(a => a.value).ToArray()); if (objectIds.Length != kv.Value.Count) { throw new InvalidOperationException(); } for (int i = 0; i < objectIds.Length; i++) { res[kv.Value[i].index] = objectIds[i]; } } return(res); }
string GetObjectIdNodeId(DbgObjectId objectId) => objectIdNodeIdBase + objectId.Id.ToString();
public abstract int GetHashCode(DbgObjectId objectId);
public abstract bool Equals(DbgObjectId objectId, DbgValue value);