private void HandleQSignal(DeclarationContext @class, Method method) { AccessSpecifierDecl access = method.AccessDecl; IEnumerable <MacroExpansion> expansions = access.PreprocessedEntities.OfType <MacroExpansion>(); if (expansions.All(e => e.Text != "Q_SIGNALS")) { return; } if (method.Parameters.Any()) { Class decl; if (method.Parameters.Last().Type.TryGetClass(out decl) && decl.Name == "QPrivateSignal") { method.Parameters.RemoveAt(method.Parameters.Count - 1); } } FunctionType functionType = method.GetFunctionType(); Event @event = new Event { OriginalDeclaration = method, Name = method.Name, OriginalName = method.OriginalName, Namespace = method.Namespace, QualifiedType = new QualifiedType(functionType), Parameters = method.Parameters }; method.GenerationKind = GenerationKind.None; @class.Events.Add(@event); this.events.Add(@event); }
public override AST.Declaration VisitAccessSpecifier(AccessSpecifierDecl decl) { var _access = new AST.AccessSpecifierDecl(); VisitDeclaration(decl, _access); return(_access); }
protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool isInternalImpl = false) : base((CppSharp.Parser.AST.Declaration.Internal*) native) { }
private AccessSpecifierDecl(AccessSpecifierDecl.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) { var ret = Marshal.AllocHGlobal(168); CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); return (AccessSpecifierDecl.Internal*) ret; }
public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native) { return new AccessSpecifierDecl(native); }
protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); }
private AccessSpecifierDecl(AccessSpecifierDecl.Internal native, bool skipVTables = false) : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native, bool skipVTables = false) { return new AccessSpecifierDecl(native, skipVTables); }
private static void* __CopyValue(AccessSpecifierDecl.__Internal native) { var ret = Marshal.AllocHGlobal(128); global::CppSharp.Parser.AST.AccessSpecifierDecl.__Internal.cctor_1(ret, new global::System.IntPtr(&native)); return ret.ToPointer(); }
public virtual TRet Visit(Parser.AST.Declaration decl) { switch (decl.Kind) { case DeclarationKind.TranslationUnit: { var _decl = new TranslationUnit(decl.__Instance); return(VisitTranslationUnit(_decl)); } case DeclarationKind.Namespace: { var _decl = new Namespace(decl.__Instance); return(VisitNamespace(_decl)); } case DeclarationKind.Typedef: { var _decl = new TypedefDecl(decl.__Instance); return(VisitTypedef(_decl)); } case DeclarationKind.Parameter: { var _decl = new Parameter(decl.__Instance); return(VisitParameter(_decl)); } case DeclarationKind.Function: { var _decl = new Function(decl.__Instance); return(VisitFunction(_decl)); } case DeclarationKind.Method: { var _decl = new Method(decl.__Instance); return(VisitMethod(_decl)); } case DeclarationKind.Enumeration: { var _decl = new Enumeration(decl.__Instance); return(VisitEnumeration(_decl)); } case DeclarationKind.EnumerationItem: { var _decl = new Enumeration.Item(decl.__Instance); return(VisitEnumerationItem(_decl)); } case DeclarationKind.Variable: { var _decl = new Variable(decl.__Instance); return(VisitVariable(_decl)); } case DeclarationKind.Field: { var _decl = new Field(decl.__Instance); return(VisitField(_decl)); } case DeclarationKind.AccessSpecifier: { var _decl = new AccessSpecifierDecl(decl.__Instance); return(VisitAccessSpecifier(_decl)); } case DeclarationKind.Class: { var _decl = new Class(decl.__Instance); return(VisitClass(_decl)); } case DeclarationKind.ClassTemplate: { var _decl = new ClassTemplate(decl.__Instance); return(VisitClassTemplate(_decl)); } case DeclarationKind.ClassTemplateSpecialization: { var _decl = new ClassTemplateSpecialization(decl.__Instance); return(VisitClassTemplateSpecialization(_decl)); } case DeclarationKind.ClassTemplatePartialSpecialization: { var _decl = new ClassTemplatePartialSpecialization(decl.__Instance); return(VisitClassTemplatePartialSpecialization(_decl)); } case DeclarationKind.FunctionTemplate: { var _decl = new FunctionTemplate(decl.__Instance); return(VisitFunctionTemplate(_decl)); } case DeclarationKind.MacroDefinition: { var _decl = new MacroDefinition(decl.__Instance); return(VisitMacroDefinition(_decl)); } case DeclarationKind.MacroExpansion: { var _decl = new MacroExpansion(decl.__Instance); return(VisitMacroExpansion(_decl)); } } throw new ArgumentOutOfRangeException(); }
public abstract TRet VisitAccessSpecifier(AccessSpecifierDecl decl);
internal AccessSpecifierDecl(AccessSpecifierDecl.Internal native) : this(&native) { }
internal AccessSpecifierDecl(AccessSpecifierDecl.Internal* native) : this(new global::System.IntPtr(native)) { }
private AccessSpecifierDecl(AccessSpecifierDecl.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; }
internal AccessSpecifierDecl(AccessSpecifierDecl.Internal native) : this(__CopyValue(native)) { }