当前位置: 首页>>代码示例>>C#>>正文


C# Btree.BTree类代码示例

本文整理汇总了C#中Db4objects.Db4o.Internal.Btree.BTree的典型用法代码示例。如果您正苦于以下问题:C# BTree类的具体用法?C# BTree怎么用?C# BTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BTree类属于Db4objects.Db4o.Internal.Btree命名空间,在下文中一共展示了BTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AssertEmpty

		public static void AssertEmpty(Transaction transaction, BTree tree)
		{
			ExpectingVisitor visitor = new ExpectingVisitor(new object[0]);
			tree.TraverseKeys(transaction, visitor);
			visitor.AssertExpectations();
			Assert.AreEqual(0, tree.Size(transaction));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:7,代码来源:BTreeAssert.cs

示例2: CycleIntKeys

 /// <exception cref="System.Exception"></exception>
 private BTree CycleIntKeys(BTree btree)
 {
     AddKeys(btree);
     ExpectKeys(btree, _sortedKeys);
     btree.Commit(Trans());
     ExpectKeys(btree, _sortedKeys);
     RemoveKeys(btree);
     ExpectKeys(btree, _keysOnRemoval);
     btree.Rollback(Trans());
     ExpectKeys(btree, _sortedKeys);
     var id = btree.GetID();
     Reopen();
     btree = BTreeAssert.CreateIntKeyBTree(Container(), id, BtreeNodeSize);
     ExpectKeys(btree, _sortedKeys);
     RemoveKeys(btree);
     ExpectKeys(btree, _keysOnRemoval);
     btree.Commit(Trans());
     ExpectKeys(btree, _keysOnRemoval);
     // remove all but 1
     for (var i = 1; i < _keysOnRemoval.Length; i++)
     {
         btree.Remove(Trans(), _keysOnRemoval[i]);
     }
     ExpectKeys(btree, _one);
     btree.Commit(Trans());
     ExpectKeys(btree, _one);
     btree.Remove(Trans(), 1);
     btree.Rollback(Trans());
     ExpectKeys(btree, _one);
     btree.Remove(Trans(), 1);
     btree.Commit(Trans());
     ExpectKeys(btree, _none);
     return btree;
 }
开发者ID:masroore,项目名称:db4o,代码行数:35,代码来源:BTreeSimpleTestCase.cs

示例3: Commit

		public override object Commit(Transaction trans, BTree btree, BTreeNode node)
		{
			if (_transaction == trans)
			{
				return GetObject();
			}
			return this;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:8,代码来源:BTreeAdd.cs

示例4: Rollback

		public override object Rollback(Transaction trans, BTree btree)
		{
			if (_transaction == trans)
			{
				return RolledBack(btree);
			}
			return this;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:8,代码来源:BTreeAdd.cs

示例5: CreateBTreeIndex

		private void CreateBTreeIndex(ObjectContainerBase stream, int btreeID)
		{
			if (stream.IsClient)
			{
				return;
			}
			_btreeIndex = ((LocalObjectContainer)stream).CreateBTreeClassIndex(btreeID);
			_btreeIndex.SetRemoveListener(new _IVisitor4_61(this));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:BTreeClassIndexStrategy.cs

示例6: CreateBTrees

		private void CreateBTrees(int addressID, int lengthID)
		{
			BTreeConfiguration config = new BTreeConfiguration(_idSystem, SlotChangeFactory.FreeSpace
				, 64, false);
			_slotsByAddress = new BTree(Transaction(), config, addressID, new AddressKeySlotHandler
				());
			_slotsByLength = new BTree(Transaction(), config, lengthID, new LengthKeySlotHandler
				());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:9,代码来源:BTreeFreespaceManager.cs

示例7: BTreeNode

		public BTreeNode(BTree btree, int count, bool isLeaf, int parentID, int previousID
			, int nextID)
		{
			_btree = btree;
			_parentID = parentID;
			_previousID = previousID;
			_nextID = nextID;
			_count = count;
			_isLeaf = isLeaf;
			PrepareArrays();
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:11,代码来源:BTreeNode.cs

示例8: BTreeRangeSingle

		public BTreeRangeSingle(Db4objects.Db4o.Internal.Transaction transaction, BTree btree
			, BTreePointer first, BTreePointer end)
		{
			if (transaction == null || btree == null)
			{
				throw new ArgumentNullException();
			}
			_transaction = transaction;
			_btree = btree;
			_first = first;
			_end = end;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:BTreeRangeSingle.cs

示例9: BTreeNodeSearchResult

		internal BTreeNodeSearchResult(Transaction transaction, BTree btree, BTreePointer
			 pointer, bool foundMatch)
		{
			if (null == transaction || null == btree)
			{
				throw new ArgumentNullException();
			}
			_transaction = transaction;
			_btree = btree;
			_pointer = pointer;
			_foundMatch = foundMatch;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:12,代码来源:BTreeNodeSearchResult.cs

示例10: AssertSingleElement

		public static void AssertSingleElement(Transaction trans, BTree btree, object element
			)
		{
			Assert.AreEqual(1, btree.Size(trans));
			IBTreeRange result = btree.SearchRange(trans, element);
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(new object[] { element }
				);
			BTreeAssert.TraverseKeys(result, expectingVisitor);
			expectingVisitor.AssertExpectations();
			expectingVisitor = new ExpectingVisitor(new object[] { element });
			btree.TraverseKeys(trans, expectingVisitor);
			expectingVisitor.AssertExpectations();
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:13,代码来源:BTreeAssert.cs

示例11: Convert

		public virtual void Convert(LocalObjectContainer container, int classIndexId, BTree
			 bTree)
		{
			Transaction trans = container.SystemTransaction();
			ByteArrayBuffer reader = container.ReadBufferById(trans, classIndexId);
			if (reader == null)
			{
				return;
			}
			int entries = reader.ReadInt();
			for (int i = 0; i < entries; i++)
			{
				bTree.Add(trans, reader.ReadInt());
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:15,代码来源:ClassIndexesToBTrees_5_5.cs

示例12: Initialize

		private void Initialize()
		{
			int idToTimestampIndexId = _container.SystemData().IdToTimestampIndexId();
			int timestampToIdIndexId = _container.SystemData().TimestampToIdIndexId();
			_idToTimestamp = new BTree(_container.SystemTransaction(), idToTimestampIndexId, 
				new CommitTimestampSupport.TimestampEntryById());
			_timestampToId = new BTree(_container.SystemTransaction(), timestampToIdIndexId, 
				new CommitTimestampSupport.IdEntryByTimestamp());
			if (idToTimestampIndexId != _idToTimestamp.GetID())
			{
				StoreBtreesIds();
			}
			EventRegistryFactory.ForObjectContainer(_container).Committing += new System.EventHandler<Db4objects.Db4o.Events.CommitEventArgs>
				(new _IEventListener4_69(this).OnEvent);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:15,代码来源:CommitTimestampSupport.cs

示例13: ExpectKeysSearch

		private void ExpectKeysSearch(Transaction trans, BTree btree, int[] keys)
		{
			int lastValue = int.MinValue;
			for (int i = 0; i < keys.Length; i++)
			{
				if (keys[i] != lastValue)
				{
					ExpectingVisitor expectingVisitor = ExpectingVisitor.CreateExpectingVisitor(keys[
						i], IntArrays4.Occurences(keys, keys[i]));
					IBTreeRange range = btree.SearchRange(trans, keys[i]);
					BTreeAssert.TraverseKeys(range, expectingVisitor);
					expectingVisitor.AssertExpectations();
					lastValue = keys[i];
				}
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:16,代码来源:BTreeSearchTestCase.cs

示例14: ExpectKeysSearch

		private void ExpectKeysSearch(BTree btree, int[] values)
		{
			int lastValue = int.MinValue;
			for (int i = 0; i < values.Length; i++)
			{
				if (values[i] != lastValue)
				{
					ExpectingVisitor expectingVisitor = ExpectingVisitor.CreateExpectingVisitor(values
						[i], IntArrays4.Occurences(values, values[i]));
					IBTreeRange range = FieldIndexKeySearch(Trans(), btree, values[i]);
					BTreeAssert.TraverseKeys(range, new _IVisitor4_62(expectingVisitor));
					expectingVisitor.AssertExpectations();
					lastValue = values[i];
				}
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:16,代码来源:FieldIndexTestCase.cs

示例15: Commit

		public override object Commit(Transaction trans, BTree btree, BTreeNode node)
		{
			Db4objects.Db4o.Internal.Btree.BTreeUpdate patch = (Db4objects.Db4o.Internal.Btree.BTreeUpdate
				)ForTransaction(trans);
			if (patch is BTreeCancelledRemoval)
			{
				object obj = patch.GetCommittedObject();
				ApplyKeyChange(obj);
			}
			else
			{
				if (patch is BTreeRemove)
				{
					RemovedBy(trans, btree, node);
					patch.Committed(btree);
					return No4.Instance;
				}
			}
			return InternalCommit(trans, btree);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:20,代码来源:BTreeUpdate.cs


注:本文中的Db4objects.Db4o.Internal.Btree.BTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。