public override IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container
                                                                    , ArrayInfo info, int classID)
        {
            if (classID == Const4.IgnoreId)
            {
                // TODO: Here is a low-frequency mistake, extremely unlikely.
                // If classID == 99999 by accident then we will get ignore.
                return(null);
            }
            info.Primitive(false);
            if (UseJavaHandling())
            {
                if (classID < Const4.Primitive)
                {
                    info.Primitive(true);
                    classID -= Const4.Primitive;
                }
            }
            classID = -classID;
            ClassMetadata classMetadata = container.ClassMetadataForID(classID);

            if (classMetadata != null)
            {
                return(ClassReflector(container.Reflector(), classMetadata, info.Primitive()));
            }
            return(null);
        }
Esempio n. 2
0
        public virtual void WriteTypeInfo(IWriteContext context, ArrayInfo info)
        {
            BitMap4 typeInfoBitmap = new BitMap4(2);

            typeInfoBitmap.Set(0, info.Primitive());
            typeInfoBitmap.Set(1, info.Nullable());
            context.WriteByte(typeInfoBitmap.GetByte(0));
        }
Esempio n. 3
0
        public virtual void ReadTypeInfo(Transaction trans, IReadBuffer buffer, ArrayInfo
                                         info, int classID)
        {
            BitMap4 typeInfoBitmap = new BitMap4(buffer.ReadByte());

            info.Primitive(typeInfoBitmap.IsTrue(0));
            info.Nullable(typeInfoBitmap.IsTrue(1));
        }
Esempio n. 4
0
 public virtual bool HasNullBitmap(ArrayInfo info)
 {
     if (info.Nullable())
     {
         return(true);
     }
     return(!info.Primitive());
 }
Esempio n. 5
0
        private void DefragmentWriteMappedClassId(IDefragmentContext context, ArrayInfo info
                                                  , int classIdOffset)
        {
            ByteArrayBuffer targetBuffer  = context.TargetBuffer();
            int             currentOffset = targetBuffer.Offset();

            targetBuffer.Seek(classIdOffset);
            int classID            = ClassIDFromInfo(Container(context), info);
            int mappedID           = context.MappedID(classID);
            int marshalledMappedId = ClassIdToMarshalledClassId(mappedID, info.Primitive());

            targetBuffer.WriteInt(marshalledMappedId);
            targetBuffer.Seek(currentOffset);
        }
Esempio n. 6
0
        public virtual IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container
                                                                   , ArrayInfo info, int classID)
        {
            if (classID == 0)
            {
                return(null);
            }
            ClassMetadata classMetadata = container.ClassMetadataForID(classID);

            if (classMetadata == null)
            {
                return(null);
            }
            return(ClassReflector(container.Reflector(), classMetadata, info.Primitive()));
        }
Esempio n. 7
0
        protected void Analyze(ObjectContainerBase container, object obj, ArrayInfo info)
        {
            // TODO: Move as much analysis as possible to ReflectArray#analyze()
            ArrayReflector(container).Analyze(obj, info);
            var claxx         = ComponentType(container, obj);
            var classMetadata = container.ProduceClassMetadata
                                    (claxx);
            var primitive = IsPrimitive(container.Reflector(), claxx, classMetadata);

            if (primitive)
            {
                claxx = classMetadata.ClassReflector();
            }
            info.Primitive(primitive);
            info.ReflectClass(claxx);
            AnalyzeDimensions(container, obj, info);
        }
 public override bool HasNullBitmap(ArrayInfo info)
 {
     return(!info.Primitive());
 }
Esempio n. 9
0
 private int MarshalledClassID(ObjectContainerBase container, ArrayInfo info)
 {
     return(ClassIdToMarshalledClassId(ClassIDFromInfo(container, info), info.Primitive
                                           ()));
 }