Esempio n. 1
0
        public static Db4objects.Db4o.Internal.Marshall.ObjectHeader Defrag(DefragmentContextImpl
                                                                            context)
        {
            ByteArrayBuffer source = context.SourceBuffer();
            ByteArrayBuffer target = context.TargetBuffer();

            Db4objects.Db4o.Internal.Marshall.ObjectHeader header = new Db4objects.Db4o.Internal.Marshall.ObjectHeader
                                                                        (context.Services().SystemTrans().Container(), null, source);
            int newID = context.Mapping().StrictMappedID(header.ClassMetadata().GetID());

            Db4objects.Db4o.Internal.Marshall.SlotFormat slotFormat = header.SlotFormat();
            slotFormat.WriteObjectClassID(target, newID);
            slotFormat.SkipMarshallerInfo(target);
            slotFormat.ReadHeaderAttributes(target);
            return(header);
        }
Esempio n. 2
0
 public static Db4objects.Db4o.Internal.Marshall.SlotFormat ForHandlerVersion(int
                                                                              handlerVersion)
 {
     if (handlerVersion == HandlerRegistry.HandlerVersion)
     {
         return(CurrentSlotFormat);
     }
     if (handlerVersion < 0 || handlerVersion > CurrentSlotFormat.HandlerVersion())
     {
         throw new ArgumentException();
     }
     Db4objects.Db4o.Internal.Marshall.SlotFormat slotFormat = (Db4objects.Db4o.Internal.Marshall.SlotFormat
                                                                )_versions.Get(handlerVersion);
     if (slotFormat != null)
     {
         return(slotFormat);
     }
     return(ForHandlerVersion(handlerVersion + 1));
 }
 private bool IsIndirectedWithinSlot(ITypeHandler4 handler)
 {
     return(SlotFormat.Current().IsIndirectedWithinSlot(handler));
 }