Exemplo n.º 1
0
        public static void ConfigureLen1(Type[] fieldTypes, ref PackedFieldDescriptor descriptor, out int valuesLength,
                                         out int objectsLength)
        {
            var valueAccessor = ValueFieldAccessorResolver.GetValue(fieldTypes[0]);

            if (valueAccessor != null)
            {
                descriptor.Accessor     = valueAccessor;
                descriptor.DataPosition = Val064BitCount;

                valuesLength  = (valueAccessor.ValueBitCount + ((Val064BitCount * 2) - 1)) >> Val064Rank;
                objectsLength = 0;
                fieldTypes[0] = valueAccessor.FieldType;
                return;
            }

            descriptor.Accessor = ObjectAccessor;
            valuesLength        = 1;
            objectsLength       = 1;
        }
Exemplo n.º 2
0
 public static void ConfigureFieldAccessor(ref PackedFieldDescriptor descriptor, Type fieldType) =>
 descriptor.Accessor = (PackedFieldAccessor)ValueFieldAccessorResolver.GetValue(fieldType) ?? ObjectAccessor;