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

C# Internal.LocalObjectContainer类代码示例

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

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



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

示例1: ObjectServerImpl

		private ObjectServerImpl(LocalObjectContainer container, ServerConfigurationImpl 
			serverConfig, int port, bool isEmbeddedServer)
		{
			_isEmbeddedServer = isEmbeddedServer;
			_container = container;
			_serverConfig = serverConfig;
			_socketFactory = serverConfig.Networking.SocketFactory;
			_transactionPool = new ClientTransactionPool(container);
			_port = port;
			_name = "db4o ServerSocket FILE: " + container.ToString() + "  PORT:" + _port;
			_container.SetServer(true);
			ConfigureObjectServer();
			_classInfoHelper = new Db4objects.Db4o.CS.Internal.ClassInfoHelper(Db4oClientServerLegacyConfigurationBridge
				.AsLegacy(serverConfig));
			_container.ClassCollection().CheckAllClassChanges();
			bool ok = false;
			try
			{
				EnsureLoadStaticClass();
				StartCommittedCallbackThread(_committedInfosQueue);
				StartServer();
				if (_serverConfig != null)
				{
					_serverConfig.ApplyConfigurationItems(this);
				}
				ok = true;
			}
			finally
			{
				if (!ok)
				{
					Close();
				}
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:35,代码来源:ObjectServerImpl.cs


示例2: FreespaceManagerIx

		public static Db4objects.Db4o.Internal.Freespace.AbstractFreespaceManager CreateNew
			(LocalObjectContainer file, byte systemType)
		{
			systemType = CheckType(systemType);
			int unblockedDiscardLimit = file.ConfigImpl.DiscardFreeSpace();
			int blockedDiscardLimit = unblockedDiscardLimit == int.MaxValue ? unblockedDiscardLimit
				 : file.BlockConverter().BytesToBlocks(unblockedDiscardLimit);
			int remainderSizeLimit = file.BlockConverter().BytesToBlocks(RemainderSizeLimit);
			IProcedure4 slotFreedCallback = new _IProcedure4_52(file);
			switch (systemType)
			{
				case FmIx:
				{
					return new FreespaceManagerIx(blockedDiscardLimit, remainderSizeLimit);
				}

				case FmBtree:
				{
					return new BTreeFreespaceManager(file, slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
						);
				}

				default:
				{
					return new InMemoryFreespaceManager(slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
						);
					break;
				}
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:30,代码来源:AbstractFreespaceManager.cs


示例3: Open

		private void Open()
		{
			IConfiguration config = ((IConfiguration)_currentConfig.Run());
			Db4oLegacyConfigurationBridge.AsIdSystemConfiguration(config).UsePointerBasedSystem
				();
			_container = (LocalObjectContainer)Db4oFactory.OpenFile(config, TempFile());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:FreespaceManagerTypeChangeSlotCountTestCase.cs


示例4: WriteFixedPart

		public override void WriteFixedPart(LocalObjectContainer file, bool startFileLockingThread
			, bool shuttingDown, StatefulBuffer writer, int blockSize)
		{
			SystemData systemData = file.SystemData();
			writer.Append(Signature);
			writer.WriteByte(Version());
			writer.WriteInt((int)TimeToWrite(_timerFileLock.OpenTime(), shuttingDown));
			writer.WriteLong(TimeToWrite(_timerFileLock.OpenTime(), shuttingDown));
			writer.WriteLong(TimeToWrite(Runtime.CurrentTimeMillis(), shuttingDown));
			writer.WriteInt(blockSize);
			writer.WriteInt(systemData.ClassCollectionID());
			writer.WriteByte(systemData.IdSystemType());
			writer.WriteInt(((FileHeaderVariablePart2)_variablePart).Address());
			writer.WriteInt(((FileHeaderVariablePart2)_variablePart).Length());
			writer.WriteInt(_transactionPointerAddress);
			writer.Write();
			if (shuttingDown)
			{
				WriteVariablePart(file, true);
			}
			else
			{
				file.SyncFiles();
			}
			if (startFileLockingThread)
			{
				file.ThreadPool().Start("db4o lock thread", _timerFileLock);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:29,代码来源:FileHeader2.cs


示例5: AssertSingleEntry

 public virtual void AssertSingleEntry(LocalObjectContainer container, long id)
 {
     var called = new BooleanByRef();
     Index(container).TraverseKeys(container.SystemTransaction(), new _IVisitor4_24(id
         , called));
     Assert.IsTrue(called.value);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:FieldIndexAssert.cs


示例6: BTreeFreespaceManager

		public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback
			, int discardLimit) : base(slotFreedCallback, discardLimit)
		{
			_file = file;
			_delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit);
			_idSystem = file.SystemData().FreespaceIdSystem();
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:BTreeFreespaceManager.cs


示例7: InitNew

		/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
		public sealed override void InitNew(LocalObjectContainer file)
		{
			NewTimerFileLock(file);
			OldEncryptionOff(file);
			_variablePart = CreateVariablePart(file);
			WriteVariablePart(file);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:NewFileHeaderBase.cs


示例8: CollectFor

 public virtual long CollectFor(LocalObjectContainer db, int id, ISlotMap slotMap)
 {
     var bigSet = db.GetByID(id);
     db.Activate(bigSet, 1);
     var btree = (BTree) Reflection4.GetFieldValue(bigSet, "_bTree");
     return FileUsageStatsCollector.BTreeUsage(db, btree, slotMap);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:BigSetMiscCollector.cs


示例9: DefragmentServicesImpl

 /// <exception cref="System.IO.IOException"></exception>
 public DefragmentServicesImpl(DefragmentConfig defragConfig, IDefragmentListener
     listener)
 {
     _listener = listener;
     var originalConfig = (Config4Impl) defragConfig.Db4oConfig();
     var storage = defragConfig.BackupStorage();
     if (defragConfig.ReadOnly())
     {
         storage = new NonFlushingStorage(storage);
     }
     var sourceConfig = PrepareConfig(originalConfig, storage, defragConfig.ReadOnly
         ());
     _sourceDb = (LocalObjectContainer) Db4oFactory.OpenFile(sourceConfig, defragConfig
         .TempPath()).Ext();
     _sourceDb.ShowInternalClasses(true);
     defragConfig.Db4oConfig().BlockSize(_sourceDb.BlockSize());
     if (!originalConfig.GenerateCommitTimestamps().DefiniteNo())
     {
         defragConfig.Db4oConfig().GenerateCommitTimestamps(_sourceDb.Config().GenerateCommitTimestamps
             ().DefiniteYes());
     }
     _targetDb = FreshTargetFile(defragConfig);
     _mapping = defragConfig.Mapping();
     _mapping.Open();
     _defragConfig = defragConfig;
 }
开发者ID:masroore,项目名称:db4o,代码行数:27,代码来源:DefragmentServicesImpl.cs


示例10: LocalTransaction

 public LocalTransaction(ObjectContainerBase container, Transaction parentTransaction
     , ITransactionalIdSystem idSystem, IReferenceSystem referenceSystem) : base(container
         , parentTransaction, referenceSystem)
 {
     _file = (LocalObjectContainer) container;
     _committedCallbackDispatcher = new _ICommittedCallbackDispatcher_39(this);
     _idSystem = idSystem;
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:LocalTransaction.cs


示例11: Store

		private void Store(LocalObjectContainer origDb)
		{
			for (int itemId = 0; itemId < NumItems; itemId++)
			{
				origDb.Store(new MemoryBackupTestCaseBase.Item(itemId));
			}
			origDb.Commit();
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:MemoryBackupTestCaseBase.cs


示例12: NewOnSignatureMatch

		protected override FileHeader NewOnSignatureMatch(LocalObjectContainer file, ByteArrayBuffer
			 reader)
		{
			if (SignatureMatches(reader, Signature, Version()))
			{
				return CreateNew();
			}
			return null;
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:9,代码来源:NewFileHeaderBase.cs


示例13: NewInstance

		public static IIdSystem NewInstance(LocalObjectContainer localContainer)
		{
			SystemData systemData = localContainer.SystemData();
			byte idSystemType = systemData.IdSystemType();
			switch (idSystemType)
			{
				case Legacy:
				{
					return new PointerBasedIdSystem(localContainer);
				}

				case PointerBased:
				{
					return new PointerBasedIdSystem(localContainer);
				}

				case StackedBtree:
				{
					InMemoryIdSystem inMemoryIdSystem = new InMemoryIdSystem(localContainer);
					BTreeIdSystem bTreeIdSystem = new BTreeIdSystem(localContainer, inMemoryIdSystem);
					systemData.FreespaceIdSystem(bTreeIdSystem.FreespaceIdSystem());
					return new BTreeIdSystem(localContainer, bTreeIdSystem);
				}

				case SingleBtree:
				{
					InMemoryIdSystem smallInMemoryIdSystem = new InMemoryIdSystem(localContainer);
					BTreeIdSystem smallBTreeIdSystem = new BTreeIdSystem(localContainer, smallInMemoryIdSystem
						);
					systemData.FreespaceIdSystem(smallBTreeIdSystem.FreespaceIdSystem());
					return smallBTreeIdSystem;
				}

				case InMemory:
				{
					return new InMemoryIdSystem(localContainer);
				}

				case Custom:
				{
					IIdSystemFactory customIdSystemFactory = localContainer.ConfigImpl.CustomIdSystemFactory
						();
					if (customIdSystemFactory == null)
					{
						throw new Db4oFatalException("Custom IdSystem configured but no factory was found. See IdSystemConfiguration#useCustomSystem()"
							);
					}
					return customIdSystemFactory.NewInstance(localContainer);
				}

				default:
				{
					return new PointerBasedIdSystem(localContainer);
					break;
				}
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:57,代码来源:StandardIdSystemFactory.cs


示例14: RebuildIndexForClass

		public virtual bool RebuildIndexForClass(LocalObjectContainer container, ClassMetadata
			 classMetadata)
		{
			long[] ids = classMetadata.GetIDs();
			for (int i = 0; i < ids.Length; i++)
			{
				RebuildIndexForObject(container, (int)ids[i]);
			}
			return ids.Length > 0;
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:10,代码来源:VersionNumberToCommitTimestamp_8_0.cs


示例15: RebuildIndexForObject

		/// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
		protected virtual void RebuildIndexForObject(LocalObjectContainer container, int 
			objectId)
		{
			StatefulBuffer writer = container.ReadStatefulBufferById(container.SystemTransaction
				(), objectId);
			if (writer != null)
			{
				RebuildIndexForWriter(container, writer, objectId);
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:11,代码来源:VersionNumberToCommitTimestamp_8_0.cs


示例16: ClientTransactionPool

		public ClientTransactionPool(LocalObjectContainer mainContainer)
		{
			// Transaction -> ContainerCount
			// String -> ContainerCount
			ClientTransactionPool.ContainerCount mainEntry = new ClientTransactionPool.ContainerCount
				(mainContainer, 1);
			_transaction2Container = new Hashtable4();
			_fileName2Container = new Hashtable4();
			_fileName2Container.Put(mainContainer.FileName(), mainEntry);
			_mainContainer = mainContainer;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:11,代码来源:ClientTransactionPool.cs


示例17: FileUsageStatsCollector

		public FileUsageStatsCollector(IObjectContainer db, bool collectSlots)
		{
			MiscCollectors = new Hashtable();
			RegisterBigSetCollector();
			_db = (LocalObjectContainer)db;
			byte blockSize = _db.BlockSize();
			_blockConverter = blockSize > 1 ? (IBlockConverter)new BlockSizeBlockConverter(blockSize
				) : (IBlockConverter)new DisabledBlockConverter();
			_slots = collectSlots ? (ISlotMap)new SlotMapImpl(_db.FileLength()) : (ISlotMap)new 
				NullSlotMap();
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:11,代码来源:FileUsageStatsCollector.cs


示例18: FileHeaderVariablePart1

		public FileHeaderVariablePart1(LocalObjectContainer container, int id) : base(container
			)
		{
			// The variable part format is:
			// (int) converter version
			// (byte) freespace system used
			// (int)  freespace address
			// (int) identity ID
			// (long) versionGenerator
			// (int) uuid index ID
			_id = id;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:FileHeaderVariablePart1.cs


示例19: WriteVariablePart

		public sealed override void WriteVariablePart(LocalObjectContainer file, bool shuttingDown
			)
		{
			if (!IsInitalized())
			{
				return;
			}
			IRunnable commitHook = Commit(shuttingDown);
			file.SyncFiles();
			commitHook.Run();
			file.SyncFiles();
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:12,代码来源:NewFileHeaderBase.cs


示例20: BuildCommitTimestampIndex

		private void BuildCommitTimestampIndex(LocalObjectContainer container)
		{
			versionFieldMetadata = container.Handlers.Indexes()._version;
			ClassMetadataIterator i = container.ClassCollection().Iterator();
			while (i.MoveNext())
			{
				ClassMetadata clazz = i.CurrentClass();
				if (clazz.HasVersionField() && !clazz.IsStruct())
				{
					RebuildIndexForClass(container, clazz);
				}
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:13,代码来源:VersionNumberToCommitTimestamp_8_0.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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