internal void FreePrefetchedIDs(IIdSystem idSystem)
 {
     if (_prefetchedIDs == null)
     {
         return;
     }
     idSystem.ReturnUnusedIds(_prefetchedIDs);
     _prefetchedIDs = null;
 }
Example #2
0
            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);
            }
Example #3
0
			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);
			}
Example #4
0
 public virtual void ReturnUnusedIds(IVisitable visitable)
 {
     _delegate.ReturnUnusedIds(visitable);
 }
Example #5
0
		internal void FreePrefetchedIDs(IIdSystem idSystem)
		{
			if (_prefetchedIDs == null)
			{
				return;
			}
			idSystem.ReturnUnusedIds(_prefetchedIDs);
			_prefetchedIDs = null;
		}