public TypeIdentifier(Type type, int id) { if (TypeIdentifier._IsEnum(type)) { Describer = new EnumDescriber(id, type); } else if (TypeIdentifier._IsNumber(type)) { Describer = new NumberDescriber(id, type); } else if (TypeIdentifier._IsByteArray(type)) { Describer = new ByteArrayDescriber(id); } else if (TypeIdentifier._IsBuffer(type)) { Describer = new BufferDescriber(id, type); } else if (TypeIdentifier._IsBittable(type)) { Describer = new BlittableDescriber(id, type); } else if (TypeIdentifier._IsString(type)) { Describer = new StringDescriber(id); } else if (_IsArray(type)) { Describer = new ArrayDescriber(id, type); } else if (TypeIdentifier._IsClass(type)) { Describer = new ClassDescriber(id, type); } else { throw new Exception("Unrecognized type " + type.FullName); } }
public static bool IsAtom(Type type) { return(TypeIdentifier._IsNumber(type) || TypeIdentifier._IsBittable(type) || TypeIdentifier._IsBuffer(type) || TypeIdentifier._IsByteArray(type) || TypeIdentifier._IsEnum(type)); }