Exemple #1
0
 public static int StrideOf <T>(T[,,] type)
 {
     if (!BlittableValueType.Check <T>(type))
     {
         throw new ArgumentException("type");
     }
     else
     {
         return(BlittableValueType <T> .Stride);
     }
 }
 private static bool CheckType(Type type)
 {
     if (type.IsPrimitive)
     {
         return(true);
     }
     if (!type.IsValueType)
     {
         return(false);
     }
     foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
     {
         if (!BlittableValueType <T> .CheckType(fieldInfo.FieldType))
         {
             return(false);
         }
     }
     return(BlittableValueType <T> .Stride != 0);
 }
        public static bool Check(Type type)
        {
            BlittableValueType <T> .CheckStructLayoutAttribute(type);

            return(BlittableValueType <T> .CheckType(type));
        }
 public static bool Check()
 {
     return(BlittableValueType <T> .Check(BlittableValueType <T> .Type));
 }
Exemple #5
0
 public static bool Check <T>(T[][] type)
 {
     return(BlittableValueType <T> .Check());
 }