コード例 #1
0
 protected IReflectClass NewInstanceReflectClass(IReflector reflector, ArrayInfo info
                                                 )
 {
     if (_usePrimitiveClassReflector)
     {
         return(PrimitiveClassReflector(reflector));
     }
     return(info.ReflectClass());
 }
コード例 #2
0
ファイル: ArrayVersionHelper.cs プロジェクト: danfma/db4o-net
        public virtual int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info)
        {
            ClassMetadata classMetadata = container.ProduceClassMetadata(info.ReflectClass());

            if (classMetadata == null)
            {
                return(0);
            }
            return(classMetadata.GetID());
        }
コード例 #3
0
        protected virtual bool HandleAsByteArray(IBufferContext context)
        {
            int       offset = context.Offset();
            ArrayInfo info   = NewArrayInfo();

            ReadInfo(context.Transaction(), context, info);
            bool isByteArray = context.Transaction().Reflector().ForClass(typeof(byte)).Equals
                                   (info.ReflectClass());

            context.Seek(offset);
            return(isByteArray);
        }
コード例 #4
0
        public override int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info
                                            )
        {
            ClassMetadata classMetadata = container.ProduceClassMetadata(info.ReflectClass());

            if (classMetadata == null)
            {
                // TODO: This one is a terrible low-frequency blunder !!!
                // If YapClass-ID == 99999 then we will get IGNORE back.
                // Discovered on adding the primitives
                return(Const4.IgnoreId);
            }
            return(classMetadata.GetID());
        }
コード例 #5
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);
        }
コード例 #6
0
 private void ReflectClassFromElementsEntry(ObjectContainerBase container, ArrayInfo
                                            info, int classID)
 {
     info.ReflectClass(_versionHelper.ReflectClassFromElementsEntry(container, info, classID
                                                                    ));
 }