internal void FreePrefetchedIDs(IIdSystem idSystem) { if (_prefetchedIDs == null) { return; } idSystem.ReturnUnusedIds(_prefetchedIDs); _prefetchedIDs = null; }
private void AssertFreeAndReallocate(IIdSystem idSystem, IList ids) { // Boundary condition: Last ID. Produced a bug when implementing. if (!ids.Contains(MaxValidId)) { ids.Add(MaxValidId); } Assert.IsGreater(0, ids.Count); idSystem.ReturnUnusedIds(new _IVisitable_184(ids)); int freedCount = ids.Count; for (int i = 0; i < freedCount; i++) { int newId = idSystem.NewId(); Assert.IsTrue(ids.Contains(newId)); ids.Remove((object)newId); } Assert.IsTrue(ids.Count == 0); AssertNoMoreIdAvailable(idSystem); }
public virtual void ReturnUnusedIds(IVisitable visitable) { _delegate.ReturnUnusedIds(visitable); }