예제 #1
0
        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);
            });
        }
예제 #2
0
        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]));
        }
예제 #3
0
        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]));
        }
예제 #4
0
 private protected FunctionType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
     _returnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ResultType));
 }
예제 #5
0
 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));
 }
예제 #6
0
 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));
 }
예제 #7
0
 private protected TagType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
     _decl = new Lazy <TagDecl>(() => TranslationUnit.GetOrCreate <TagDecl>(Handle.Declaration));
 }
예제 #8
0
 private protected ObjCObjectType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
 }
예제 #9
0
 private protected ReferenceType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
 }
예제 #10
0
 private protected ReferenceType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
     _pointeeType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.PointeeType));
 }
예제 #11
0
 private protected DeducedType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
 }
예제 #12
0
 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));
 }
예제 #13
0
 private protected MatrixType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
     _elementType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(handle.ElementType));
 }
예제 #14
0
 private protected DeducedType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
     _deducedType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.DeducedType));
 }
예제 #15
0
 private protected UnaryTransformType(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
 }
예제 #16
0
 private protected TypeWithKeyword(CXType handle, CXTypeKind expectedTypeKind, CX_TypeClass expectedTypeClass) : base(handle, expectedTypeKind, expectedTypeClass)
 {
 }