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

C# Slots.Slot类代码示例

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

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



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

示例1: Read

 // _key, _slot._address, _slot._length 
 public override object Read(ByteArrayBuffer buffer)
 {
     var id = buffer.ReadInt();
     var slot = new Slot
         (buffer.ReadInt(), buffer.ReadInt());
     return new IdSlotTree(id, slot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:IdSlotTree.cs


示例2: DatabaseIdentityIDAndUUID

 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 private DatabaseIdentityIDAndUUID ReadDatabaseIdentityIDAndUUID
     (ObjectContainerBase container, ClassMetadata classMetadata, Slot oldSlot, bool
         checkClass)
 {
     if (DTrace.enabled)
     {
         DTrace.RereadOldUuid.LogLength(oldSlot.Address(), oldSlot.Length());
     }
     var reader = container.DecryptedBufferByAddress(oldSlot.Address(), oldSlot
         .Length());
     if (checkClass)
     {
         var realClass = ClassMetadata.ReadClass(container, reader);
         if (realClass != classMetadata)
         {
             return null;
         }
     }
     if (classMetadata.SeekToField(container.Transaction, reader, this) == HandlerVersion
         .Invalid)
     {
         return null;
     }
     return new DatabaseIdentityIDAndUUID(reader.ReadInt(), reader.ReadLong
         ());
 }
开发者ID:masroore,项目名称:db4o,代码行数:27,代码来源:UUIDFieldMetadata.cs


示例3: ApplySlotChanges

 public override void ApplySlotChanges(IVisitable slotChangeTree, int slotChangeCount
     , Slot reservedSlot)
 {
     if (slotChangeCount > 0)
     {
         var transactionLogSlot = SlotLongEnoughForLog(slotChangeCount, reservedSlot)
             ? reservedSlot
             : AllocateSlot(true, slotChangeCount);
         var buffer = new StatefulBuffer(_container.SystemTransaction(), transactionLogSlot
             );
         buffer.WriteInt(transactionLogSlot.Length());
         buffer.WriteInt(slotChangeCount);
         AppendSlotChanges(buffer, slotChangeTree);
         buffer.Write();
         var commitHook = _container.CommitHook();
         FlushDatabaseFile();
         _container.WriteTransactionPointer(transactionLogSlot.Address());
         FlushDatabaseFile();
         if (WriteSlots(slotChangeTree))
         {
             FlushDatabaseFile();
         }
         _container.WriteTransactionPointer(0);
         commitHook.Run();
         FlushDatabaseFile();
         if (transactionLogSlot != reservedSlot)
         {
             FreeSlot(transactionLogSlot);
         }
     }
     FreeSlot(reservedSlot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:32,代码来源:EmbeddedTransactionLogHandler.cs


示例4: SlotFreed

 public virtual void SlotFreed(Slot slot)
 {
     if (_slotFreedCallback == null)
     {
         return;
     }
     _slotFreedCallback.Apply(slot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:AbstractFreespaceManager.cs


示例5: GetByteLoad

 public override ByteArrayBuffer GetByteLoad()
 {
     var address = _payLoad.ReadInt();
     var length = _payLoad.Length() - (Const4.IntLength);
     var slot = new Slot(address, length);
     _payLoad.RemoveFirstBytes(Const4.IntLength);
     _payLoad.UseSlot(slot);
     return _payLoad;
 }
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:MReadSlot.cs


示例6: GetByteLoad

		public sealed override ByteArrayBuffer GetByteLoad()
		{
			int address = _payLoad.ReadInt();
			int length = _payLoad.Length() - (Const4.IntLength);
			Slot slot = new Slot(address, length);
			_payLoad.RemoveFirstBytes(Const4.IntLength);
			_payLoad.UseSlot(slot);
			return this._payLoad;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:9,代码来源:MReadSlot.cs


示例7: HandledAsReAdd

		private bool HandledAsReAdd(Slot slot)
		{
			if (!Slot.IsNull(slot))
			{
				return false;
			}
			_clazz.AddToIndex(_transaction, _id);
			return true;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:9,代码来源:WriteUpdateProcessor.cs


示例8: TestAllocateSlot

		public virtual void TestAllocateSlot()
		{
			Slot slot = new Slot(1, 15);
			_nonBlocked.Free(slot);
			Slot allocatedSlot = _nonBlocked.AllocateSlot(8);
			int expectedAllocatedSlotLength = _blockConverter.BlockAlignedBytes(8);
			Slot expectedSlot = new Slot(1, expectedAllocatedSlotLength);
			Assert.AreEqual(expectedSlot, allocatedSlot);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:BlockAwareFreespaceManagerTestCase.cs


示例9: Free

		// do nothing
		public override void Free(Slot slot)
		{
			int address = slot.Address();
			if (address <= 0)
			{
				throw new ArgumentException();
			}
			int length = slot.Length();
			if (DTrace.enabled)
			{
				DTrace.FreespacemanagerRamFree.LogLength(address, length);
			}
			_finder._key = address;
			FreeSlotNode sizeNode;
			FreeSlotNode addressnode = (FreeSlotNode)Tree.FindSmaller(_freeByAddress, _finder
				);
			if ((addressnode != null) && ((addressnode._key + addressnode._peer._key) == address
				))
			{
				sizeNode = addressnode._peer;
				RemoveFromFreeBySize(sizeNode);
				sizeNode._key += length;
				FreeSlotNode secondAddressNode = (FreeSlotNode)Tree.FindGreaterOrEqual(_freeByAddress
					, _finder);
				if ((secondAddressNode != null) && (address + length == secondAddressNode._key))
				{
					sizeNode._key += secondAddressNode._peer._key;
					RemoveFromBothTrees(secondAddressNode._peer);
				}
				sizeNode.RemoveChildren();
				AddToFreeBySize(sizeNode);
			}
			else
			{
				addressnode = (FreeSlotNode)Tree.FindGreaterOrEqual(_freeByAddress, _finder);
				if ((addressnode != null) && (address + length == addressnode._key))
				{
					sizeNode = addressnode._peer;
					RemoveFromBothTrees(sizeNode);
					sizeNode._key += length;
					addressnode._key = address;
					addressnode.RemoveChildren();
					sizeNode.RemoveChildren();
					_freeByAddress = Tree.Add(_freeByAddress, addressnode);
					AddToFreeBySize(sizeNode);
				}
				else
				{
					if (CanDiscard(length))
					{
						return;
					}
					AddFreeSlotNodes(address, length);
				}
			}
			SlotFreed(slot);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:58,代码来源:InMemoryFreespaceManager.cs


示例10: TestIndexMarshalling

		public virtual void TestIndexMarshalling()
		{
			ByteArrayBuffer reader = new ByteArrayBuffer(2 * Const4.IntLength);
			Slot original = new Slot(unchecked((int)(0xdb)), unchecked((int)(0x40)));
			StringHandler().WriteIndexEntry(Context(), reader, original);
			reader._offset = 0;
			Slot retrieved = (Slot)StringHandler().ReadIndexEntry(Context(), reader);
			Assert.AreEqual(original.Address(), retrieved.Address());
			Assert.AreEqual(original.Length(), retrieved.Length());
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:10,代码来源:StringHandlerTestCase.cs


示例11: DelayedFree

 public virtual void DelayedFree(Slot slot, bool freeToSystemFreeSpaceSystem)
 {
     if (freeToSystemFreeSpaceSystem)
     {
         _freeToSystemFreespaceSystem.Add(slot);
     }
     else
     {
         _freeToUserFreespaceSystem.Add(slot);
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:FreespaceCommitter.cs


示例12: AssertAllocateSlot

		private void AssertAllocateSlot(int freeSlotSize, int requiredSlotSize, int expectedSlotSize
			)
		{
			Slot slot = new Slot(1, freeSlotSize);
			_nonBlocked.Free(slot);
			Slot allocatedSlot = _nonBlocked.AllocateSlot(requiredSlotSize);
			int expectedAllocatedSlotLength = _blockConverter.BlockAlignedBytes(expectedSlotSize
				);
			Slot expectedSlot = new Slot(1, expectedAllocatedSlotLength);
			Assert.AreEqual(expectedSlot, allocatedSlot);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:11,代码来源:FreespaceRemainderLimitTestCase.cs


示例13: TestToNonBlockedLength

 public virtual void TestToNonBlockedLength()
 {
     int[] blocks = {0, 1, 8, 9};
     int[] bytes = {0, 8, 64, 72};
     for (var i = 0; i < blocks.Length; i++)
     {
         var blockedSlot = new Slot(0, blocks[i]);
         var byteSlot = new Slot(0, bytes[i]);
         Assert.AreEqual(byteSlot, blockConverter.ToNonBlockedLength(blockedSlot));
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:BlockConverterTestCase.cs


示例14: TestToBlockedLength

 public virtual void TestToBlockedLength()
 {
     int[] bytes = {0, 1, 2, 7, 8, 9, 16, 17, 799, 800, 801};
     int[] blocks = {0, 1, 1, 1, 1, 2, 2, 3, 100, 100, 101};
     for (var i = 0; i < bytes.Length; i++)
     {
         var byteSlot = new Slot(0, bytes[i]);
         var blockedSlot = new Slot(0, blocks[i]);
         Assert.AreEqual(blockedSlot, blockConverter.ToBlockedLength(byteSlot));
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:BlockConverterTestCase.cs


示例15: FreeSlot

 private void FreeSlot(Slot slot)
 {
     if (slot == null)
     {
         return;
     }
     if (_container.FreespaceManager() == null)
     {
         return;
     }
     _container.FreespaceManager().FreeSafeSlot(slot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:EmbeddedTransactionLogHandler.cs


示例16: Free

		protected override void Free(IFreespaceManager freespaceManager, Slot slot)
		{
			if (slot.IsNull())
			{
				return;
			}
			if (_freed == null)
			{
				_freed = new Collection4();
			}
			_freed.Add(slot);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:12,代码来源:IdSystemSlotChange.cs


示例17: ReadThis

		private void ReadThis()
		{
			SystemData systemData = _container.SystemData();
			_slot = systemData.IdSystemSlot();
			if (!Slot.IsNull(_slot))
			{
				ByteArrayBuffer buffer = _container.ReadBufferBySlot(_slot);
				_childId = buffer.ReadInt();
				_idGenerator.Read(buffer);
				_ids = (IdSlotTree)new TreeReader(buffer, new IdSlotTree(0, null)).Read();
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:12,代码来源:InMemoryIdSystem.cs


示例18: Free

 public virtual Tree Free(LocalObjectContainer file, Tree treeRoot, Slot
     slot)
 {
     file.Free(_slot.Address(), _slot.Length());
     if (RemoveReferenceIsLast())
     {
         if (treeRoot != null)
         {
             return treeRoot.RemoveNode(this);
         }
     }
     PointTo(slot);
     return treeRoot;
 }
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:ReferencedSlot.cs


示例19: SlotDetail

		public SlotDetail(Slot slot)
		{
			this._slot = slot;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:4,代码来源:SlotDetail.cs


示例20: NotifyDeleted

		public virtual void NotifyDeleted(IFreespaceManager freespaceManager)
		{
			if (DTrace.enabled)
			{
				DTrace.NotifySlotDeleted.Log(_key);
			}
			Operation(SlotChange.SlotChangeOperation.delete);
			FreePreviouslyModifiedSlot(freespaceManager);
			_newSlot = Slot.Zero;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:10,代码来源:SlotChange.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Reflect.ArrayInfo类代码示例发布时间:2022-05-24
下一篇:
C# Processor.QCon类代码示例发布时间: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