private IDictionary <BaseRow, CachedRow> GetOverlappingCachedRows( [NotNull] ITable table, [NotNull] IBox currentTileBox, double searchTolerance) { IDictionary <BaseRow, CachedRow> result = LargeDictionaryFactory.CreateDictionary <BaseRow, CachedRow>( equalityComparer: _comparer); IDictionary <BaseRow, TestedRow> allRows; if (!_overlappingRows.TryGetValue(table, out allRows)) { return(result); } IBox searchBox = GetSearchBox(currentTileBox, searchTolerance); foreach (KeyValuePair <BaseRow, TestedRow> pair in allRows) { var cachedRow = (CachedRow)pair.Value.BaseRow; if (cachedRow.Extent.Intersects(searchBox)) { result.Add(cachedRow, cachedRow); } } return(result); }
private static void Register( [NotNull] ITable table, [NotNull] IDictionary <ITable, IDictionary <BaseRow, TestedRow> > overlapping, [NotNull] BaseRow cachedRow, [CanBeNull] IList <ContainerTest> reducedTests) { IDictionary <BaseRow, TestedRow> testedRows; if (!overlapping.TryGetValue(table, out testedRows)) { //testedRows = new Dictionary<BaseRow, TestedRow>(_comparer); testedRows = LargeDictionaryFactory.CreateDictionary <BaseRow, TestedRow>( equalityComparer: _comparer); overlapping.Add(table, testedRows); } TestedRow testedRow; if (testedRows.TryGetValue(cachedRow, out testedRow)) { testedRow.RegisterTested(reducedTests); } else { testedRows.Add(cachedRow, new TestedRow(cachedRow, reducedTests)); } }
public UniqueIdProvider([NotNull] IDictionary <int, ITable> baseTablePerOidFieldIndex) { Assert.ArgumentNotNull(baseTablePerOidFieldIndex, nameof(baseTablePerOidFieldIndex)); _baseTablePerOidFieldIndex = baseTablePerOidFieldIndex; //_keysToId = new Dictionary<IList<int?>, int>(new ListComparer()); //_idToKeys = new Dictionary<int, IList<int?>>(); _keysToId = LargeDictionaryFactory.CreateDictionary <IList <int?>, int>( equalityComparer: new ListComparer()); _idToKeys = LargeDictionaryFactory.CreateDictionary <int, IList <int?> >(); }