public override void DefragReference(ClassMetadata classMetadata, DefragmentContextImpl
                                             context, int classIndexID)
        {
            int newID = -classIndexID;

            context.WriteInt(newID);
        }
Example #2
0
        public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
                                    sio, DefragmentContextImpl context)
        {
            base.Defrag(classMetadata, aspect, sio, context);
            if (!(aspect is FieldMetadata))
            {
                return;
            }
            var field = (FieldMetadata)aspect;

            if (field.IsVirtual())
            {
                return;
            }
            if (field.HasIndex())
            {
                var index         = field.GetIndex(context.SystemTrans());
                var targetIndexID = context.CopyID();
                if (targetIndexID != 0)
                {
                    index.DefragBTree(context.Services());
                }
            }
            else
            {
                context.WriteInt(0);
            }
        }
Example #3
0
        public virtual void Defrag(ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl
                                   context, int classIndexID)
        {
            ReadName(sio, context.SourceBuffer());
            ReadName(sio, context.TargetBuffer());
            int metaClassID = 0;

            context.WriteInt(metaClassID);
            // ancestor ID
            context.CopyID();
            context.WriteInt((classMetadata.HasClassIndex() ? IndexIDForWriting(classIndexID)
                                 : 0));
            int aspectCount = context.ReadInt();

            if (aspectCount > classMetadata.DeclaredAspectCount())
            {
                throw new InvalidOperationException();
            }
            IntByRef processedAspectCount = new IntByRef(0);

            classMetadata.TraverseDeclaredAspects(new _IProcedure4_136(this, processedAspectCount
                                                                       , aspectCount, classMetadata, sio, context));
        }
Example #4
0
 public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
     sio, DefragmentContextImpl context)
 {
     base.Defrag(classMetadata, aspect, sio, context);
     if (!(aspect is FieldMetadata))
     {
         return;
     }
     var field = (FieldMetadata) aspect;
     if (field.IsVirtual())
     {
         return;
     }
     if (field.HasIndex())
     {
         var index = field.GetIndex(context.SystemTrans());
         var targetIndexID = context.CopyID();
         if (targetIndexID != 0)
         {
             index.DefragBTree(context.Services());
         }
     }
     else
     {
         context.WriteInt(0);
     }
 }
Example #5
0
 public override void DefragReference(ClassMetadata classMetadata, DefragmentContextImpl
     context, int classIndexID)
 {
     var newID = -classIndexID;
     context.WriteInt(newID);
 }
Example #6
0
 public virtual void Defrag(ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl
     context, int classIndexID)
 {
     ReadName(sio, context.SourceBuffer());
     ReadName(sio, context.TargetBuffer());
     var metaClassID = 0;
     context.WriteInt(metaClassID);
     // ancestor ID
     context.CopyID();
     context.WriteInt((classMetadata.HasClassIndex()
         ? IndexIDForWriting(classIndexID)
         : 0));
     var aspectCount = context.ReadInt();
     if (aspectCount > classMetadata.DeclaredAspectCount())
     {
         throw new InvalidOperationException();
     }
     var processedAspectCount = new IntByRef(0);
     classMetadata.TraverseDeclaredAspects(new _IProcedure4_136(this, processedAspectCount
         , aspectCount, classMetadata, sio, context));
 }