Exemplo n.º 1
0
 public static int StrideOf <T>(T[,,] type)
 {
     if (!BlittableValueType.Check <T>(type))
     {
         throw new ArgumentException("type");
     }
     else
     {
         return(BlittableValueType <T> .Stride);
     }
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        public static bool Check(Type type)
        {
            BlittableValueType <T> .CheckStructLayoutAttribute(type);

            return(BlittableValueType <T> .CheckType(type));
        }
Exemplo n.º 4
0
 public static bool Check()
 {
     return(BlittableValueType <T> .Check(BlittableValueType <T> .Type));
 }
Exemplo n.º 5
0
 public static bool Check <T>(T[][] type)
 {
     return(BlittableValueType <T> .Check());
 }