コード例 #1
0
 internal void FreePrefetchedIDs(IIdSystem idSystem)
 {
     if (_prefetchedIDs == null)
     {
         return;
     }
     idSystem.ReturnUnusedIds(_prefetchedIDs);
     _prefetchedIDs = null;
 }
コード例 #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);
            }
コード例 #3
0
ファイル: IdSystemTestSuite.cs プロジェクト: Galigator/db4o
			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);
			}
コード例 #4
0
 public virtual void ReturnUnusedIds(IVisitable visitable)
 {
     _delegate.ReturnUnusedIds(visitable);
 }
コード例 #5
0
		internal void FreePrefetchedIDs(IIdSystem idSystem)
		{
			if (_prefetchedIDs == null)
			{
				return;
			}
			idSystem.ReturnUnusedIds(_prefetchedIDs);
			_prefetchedIDs = null;
		}