• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Btree.BTree类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Initialize

 private void Initialize()
 {
     var idToTimestampIndexId = _container.SystemData().IdToTimestampIndexId();
     var timestampToIdIndexId = _container.SystemData().TimestampToIdIndexId();
     if (_container.Config().IsReadOnly())
     {
         if (idToTimestampIndexId == 0)
         {
             return;
         }
     }
     _idToTimestamp = new BTree(_container.SystemTransaction(), idToTimestampIndexId,
         new TimestampEntryById());
     _timestampToId = new BTree(_container.SystemTransaction(), timestampToIdIndexId,
         new IdEntryByTimestamp());
     if (idToTimestampIndexId != _idToTimestamp.GetID())
     {
         StoreBtreesIds();
     }
     EventRegistryFactory.ForObjectContainer(_container).Committing += new _IEventListener4_65(this).OnEvent;
 }
开发者ID:masroore,项目名称:db4o,代码行数:21,代码来源:CommitTimestampSupport.cs


示例17: CycleIntKeys

		/// <exception cref="System.Exception"></exception>
		private BTree CycleIntKeys(BTree btree, int[] values)
		{
			for (int i = 0; i < values.Length; i++)
			{
				btree.Add(Trans(), values[i]);
			}
			ExpectKeysSearch(Trans(), btree, values);
			btree.Commit(Trans());
			int id = btree.GetID();
			Container().Commit(Trans());
			Reopen();
			btree = BTreeAssert.CreateIntKeyBTree(Container(), id, BtreeNodeSize);
			ExpectKeysSearch(Trans(), btree, values);
			for (int i = 0; i < values.Length; i++)
			{
				btree.Remove(Trans(), values[i]);
			}
			BTreeAssert.AssertEmpty(Trans(), btree);
			btree.Commit(Trans());
			BTreeAssert.AssertEmpty(Trans(), btree);
			return btree;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:23,代码来源:BTreeSearchTestCase.cs


示例18: EnsureIsManaged

		internal virtual void EnsureIsManaged(BTree tree)
		{
			RegisterBTreeInTransaction(tree);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:4,代码来源:BigSetBTreeManager.cs


示例19: RegisterBTreeInTransaction

		private void RegisterBTreeInTransaction(BTree tree)
		{
			AssertValidBTreeId(tree.GetID());
			BTreesIn(_transaction)[tree.GetID()] = tree;
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:5,代码来源:BigSetBTreeManager.cs


示例20: NewBTreeNodeSizedArray

		public static int[] NewBTreeNodeSizedArray(BTree btree, int value)
		{
			return IntArrays4.Fill(new int[FillSize(btree)], value);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:4,代码来源:BTreeAssert.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Btree.BTreeNode类代码示例发布时间:2022-05-24
下一篇:
C# Internal.Transaction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap