本文整理汇总了C#中Db4objects.Db4o.Internal.LocalObjectContainer.SystemData方法的典型用法代码示例。如果您正苦于以下问题:C# LocalObjectContainer.SystemData方法的具体用法?C# LocalObjectContainer.SystemData怎么用?C# LocalObjectContainer.SystemData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.LocalObjectContainer
的用法示例。
在下文中一共展示了LocalObjectContainer.SystemData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: BTreeFreespaceManager
public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback
, int discardLimit) : base(slotFreedCallback, discardLimit)
{
_file = file;
_delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit);
_idSystem = file.SystemData().FreespaceIdSystem();
}
示例3: Read
protected override void Read(LocalObjectContainer file, ByteArrayBuffer reader)
{
NewTimerFileLock(file);
OldEncryptionOff(file);
CheckThreadFileLock(file, reader);
reader.Seek(TransactionPointerOffset);
file.SystemData().TransactionPointer1(reader.ReadInt());
file.SystemData().TransactionPointer2(reader.ReadInt());
reader.Seek(BlocksizeOffset);
file.BlockSizeReadFromFile(reader.ReadInt());
SystemData systemData = file.SystemData();
systemData.ClassCollectionID(reader.ReadInt());
reader.ReadInt();
// was freespace ID, can no longer be read
_variablePart = CreateVariablePart(file);
int variablePartId = reader.ReadInt();
_variablePart.Read(variablePartId, 0);
}
示例4: 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;
}
}
}
示例5: Read
protected override void Read(LocalObjectContainer container, ByteArrayBuffer reader
)
{
NewTimerFileLock(container);
OldEncryptionOff(container);
CheckThreadFileLock(container, reader);
reader.Seek(BlocksizeOffset);
container.BlockSizeReadFromFile(reader.ReadInt());
SystemData systemData = container.SystemData();
systemData.ClassCollectionID(reader.ReadInt());
container.SystemData().IdSystemType(reader.ReadByte());
_variablePart = CreateVariablePart(container);
int variablePartAddress = reader.ReadInt();
int variablePartLength = reader.ReadInt();
_variablePart.Read(variablePartAddress, variablePartLength);
_transactionPointerAddress = reader.ReadInt();
if (_transactionPointerAddress != 0)
{
ByteArrayBuffer buffer = new ByteArrayBuffer(TransactionPointerLength);
buffer.Read(container, _transactionPointerAddress, 0);
systemData.TransactionPointer1(buffer.ReadInt());
systemData.TransactionPointer2(buffer.ReadInt());
}
}
示例6: CompleteInterruptedTransaction
public override void CompleteInterruptedTransaction(LocalObjectContainer container
)
{
SystemData systemData = container.SystemData();
container.IdSystem().CompleteInterruptedTransaction(systemData.TransactionPointer1
(), systemData.TransactionPointer2());
}
示例7: Write
public override void Write(LocalObjectContainer container)
{
Slot slot = container.AllocateSlot(MarshalledLength());
while (slot.Length() < MarshalledLength())
{
// This can happen if DatabaseGrowthSize is configured.
// Allocating a slot may produce an additional entry
// in this FreespaceManager.
container.Free(slot);
slot = container.AllocateSlot(MarshalledLength());
}
ByteArrayBuffer buffer = new ByteArrayBuffer(slot.Length());
TreeInt.Write(buffer, (TreeInt)_freeBySize);
container.WriteEncrypt(buffer, slot.Address(), 0);
container.SystemData().InMemoryFreespaceSlot(slot);
}
示例8: CreateNew
public static Db4objects.Db4o.Internal.Freespace.AbstractFreespaceManager CreateNew
(LocalObjectContainer file)
{
return CreateNew(file, file.SystemData().FreespaceSystem());
}
示例9: Write
public override void Write(LocalObjectContainer container)
{
try
{
BeginDelegation();
_delegate.Write(container);
container.SystemData().BTreeFreespaceId(_idArray.GetID());
}
finally
{
EndDelegation();
}
}