private protected ObjCObjectType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _baseType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ObjCObjectBaseType)); _interface = new Lazy <ObjCInterfaceDecl>(() => TranslationUnit.GetOrCreate <ObjCInterfaceDecl>(Handle.Declaration)); _protocols = new Lazy <IReadOnlyList <ObjCProtocolDecl> >(() => { var numProtocols = unchecked ((int)Handle.NumObjCProtocolRefs); var protocols = new List <ObjCProtocolDecl>(numProtocols); for (var i = 0; i < numProtocols; i++) { var protocol = TranslationUnit.GetOrCreate <ObjCProtocolDecl>(Handle.GetObjCProtocolDecl(unchecked ((uint)i))); protocols.Add(protocol); } return(protocols); }); _superClassType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.UnderlyingType)); _typeArgs = new Lazy <IReadOnlyList <Type> >(() => { var numTypeArgs = unchecked ((int)Handle.NumObjCTypeArgs); var typeArgs = new List <Type>(numTypeArgs); for (var i = 0; i < numTypeArgs; i++) { var typeArg = TranslationUnit.GetOrCreate <Type>(Handle.GetObjCTypeArg(unchecked ((uint)i))); typeArgs.Add(typeArg); } return(typeArgs); }); }
protected Type(CXType handle, CXTypeKind expectedKind, CX_TypeClass expectedTypeClass) { if (handle.kind != expectedKind) { throw new ArgumentException(nameof(handle)); } if ((handle.TypeClass == CX_TypeClass.CX_TypeClass_Invalid) || (handle.TypeClass != expectedTypeClass)) { throw new ArgumentException(nameof(handle)); } Handle = handle; _canonicalType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.CanonicalType)); _translationUnit = new Lazy <TranslationUnit>(() => TranslationUnit.GetOrCreate((CXTranslationUnit)Handle.data[1])); }
protected Type(CXType handle, CXTypeKind expectedKind, CX_TypeClass expectedTypeClass) { if (handle.kind != expectedKind) { throw new ArgumentOutOfRangeException(nameof(handle)); } if ((handle.TypeClass == CX_TypeClass.CX_TypeClass_Invalid) || (handle.TypeClass != expectedTypeClass)) { throw new ArgumentOutOfRangeException(nameof(handle)); } Handle = handle; _asString = new Lazy <string>(() => Handle.Spelling.ToString()); _canonicalType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.CanonicalType)); _desugar = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.Desugar)); _kindSpelling = new Lazy <string>(() => Handle.KindSpelling.ToString()); _pointeeType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.PointeeType)); _translationUnit = new Lazy <TranslationUnit>(() => TranslationUnit.GetOrCreate((CXTranslationUnit)Handle.data[1])); }
private protected FunctionType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _returnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ResultType)); }
private protected UnaryTransformType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _baseType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.BaseType)); _underlyingType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.UnderlyingType)); }
private protected VectorType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _desugaredType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.Desugar())); _elementType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ElementType)); }
private protected TagType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _decl = new Lazy <TagDecl>(() => TranslationUnit.GetOrCreate <TagDecl>(Handle.Declaration)); }
private protected ObjCObjectType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { }
private protected ReferenceType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { }
private protected ReferenceType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _pointeeType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.PointeeType)); }
private protected DeducedType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { }
private protected AdjustedType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _adjustedType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.AdjustedType)); _originalType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.OriginalType)); }
private protected MatrixType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _elementType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(handle.ElementType)); }
private protected DeducedType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { _deducedType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.DeducedType)); }
private protected UnaryTransformType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { }
private protected TypeWithKeyword(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass) { }