コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: ReferencedSlot.cs プロジェクト: masroore/db4o
 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;
 }
コード例 #3
0
        public override void Read(LocalObjectContainer container, Slot slot)
        {
            if (Slot.IsNull(slot))
            {
                return;
            }
            ByteArrayBuffer buffer = container.ReadBufferBySlot(slot);

            if (buffer == null)
            {
                return;
            }
            Read(buffer);
            container.Free(slot);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public override void Write(LocalObjectContainer container)
 {
     var 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());
     }
     var buffer = new ByteArrayBuffer(slot.Length());
     TreeInt.Write(buffer, (TreeInt) _freeBySize);
     container.WriteEncrypt(buffer, slot.Address(), 0);
     container.SystemData().InMemoryFreespaceSlot(slot);
 }
コード例 #6
0
 public override void Read(LocalObjectContainer container, Slot slot)
 {
     if (Slot.IsNull(slot))
     {
         return;
     }
     var buffer = container.ReadBufferBySlot(slot);
     if (buffer == null)
     {
         return;
     }
     Read(buffer);
     container.Free(slot);
 }