Esempio n. 1
0
 protected IReflectClass NewInstanceReflectClass(IReflector reflector, ArrayInfo info
                                                 )
 {
     if (_usePrimitiveClassReflector)
     {
         return(PrimitiveClassReflector(reflector));
     }
     return(info.ReflectClass());
 }
Esempio n. 2
0
        public virtual int ClassIDFromInfo(ObjectContainerBase container, ArrayInfo info)
        {
            ClassMetadata classMetadata = container.ProduceClassMetadata(info.ReflectClass());

            if (classMetadata == null)
            {
                return(0);
            }
            return(classMetadata.GetID());
        }
Esempio n. 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);
        }
        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());
        }
Esempio n. 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);
        }
Esempio n. 6
0
 private void ReflectClassFromElementsEntry(ObjectContainerBase container, ArrayInfo
                                            info, int classID)
 {
     info.ReflectClass(_versionHelper.ReflectClassFromElementsEntry(container, info, classID
                                                                    ));
 }