public static object ReadBoxedClass(Type type, PropertiesBinaryReader reader)
        {
            var forwarder = new ReadBoxedClassForwarder {
                reader = reader, Container = null
            };
            var propertyBag = PropertyBagResolver.Resolve(type);

            propertyBag.Cast(ref forwarder);

            return(forwarder.Container);
        }
Esempio n. 2
0
        public static unsafe void GenerateAOTFunctions <TProperty, TContainer, TValue>()
            where TProperty : IProperty <TContainer, TValue>
        {
            TProperty     property      = default(TProperty);
            TContainer    container     = default(TContainer);
            ChangeTracker changeTracker = default(ChangeTracker);

            UnsafeAppendBuffer.Reader *reader = null;
            var propertyReader = new PropertiesBinaryReader(reader, null);

            propertyReader.VisitProperty <TProperty, TContainer, TValue>(property, ref container, ref changeTracker);
            propertyReader.IsExcluded <TProperty, TContainer, TValue>(property, ref container);
            Properties.AOTFunctionGenerator.GenerateAOTContainerFunctions <DictionaryContainer <object, object> >();
            Properties.AOTFunctionGenerator.GenerateAOTContainerFunctions <PolymorphicTypeName>();
            Properties.AOTFunctionGenerator.GenerateAOTContainerFunctions <PolymorphicTypeContainer <TContainer> >();
            Properties.AOTFunctionGenerator.GenerateAOTContainerFunctions <PolymorphicTypeContainer <TValue> >();
        }