public Function(Type type, Identifier name, TypeRef returnType) { setType(type); setName(name); setValueType(returnType); } public Function(Type type, Identifier name, TypeRef returnType, Arg... args) {
public Function(Type type, Identifier name, TypeRef returnType, List<Arg> args) { setType(type); setName(name); setValueType(returnType); setArgs(args); }
for (Declaration d : struct.getDeclarations()) { if (d instanceof Function) ((Function)d).setType(forcedType);
Function createCastMethod(Identifier name, Identifier classId, boolean isStatic) { Function m = new Function(); m.setType(Function.Type.JavaMethod); m.addModifiers(ModifierType.Public); m.setName(ident("as" + (isStatic ? "Static_" : "_") + name)); m.setValueType(typeRef(classId.clone())); m.setBody(block( new Statement.Return( methodCall( expr(typeRef(Rococoa.class)), MemberRefStyle.Dot, "cast", varRef("this"), result.typeConverter.typeLiteral(typeRef(classId.clone())))))); return m; }
Function createCastMethod(Identifier name, Identifier classId, boolean isStatic) { Function m = new Function(); m.setType(Function.Type.JavaMethod); m.addModifiers(ModifierType.Public); m.setName(ident("as" + (isStatic ? "Static_" : "_") + name)); m.setValueType(typeRef(classId.clone())); m.setBody(block( new Statement.Return( methodCall( expr(typeRef(Rococoa.class)), MemberRefStyle.Dot, "cast", varRef("this"), result.typeConverter.typeLiteral(typeRef(classId.clone())))))); return m; }
function.setType(Function.Type.ObjCMethod);
natFunc.setType(Function.Type.JavaMethod); if (result.config.synchronizedMethods && !isCallback && result.config.useJNADirectCalls) { natFunc.addModifiers(ModifierType.Synchronized);
natFunc.setType(Function.Type.JavaMethod); if (result.config.synchronizedMethods && !isCallback && result.config.useJNADirectCalls) { natFunc.addModifiers(ModifierType.Synchronized);
retval.signature.getFunction().setType(Function.Type.CFunction);
Function f = new Function(); f.setName(getCurrentClassName()); f.setType(Function.Type.CppMethod); f.setArgs((s!=null?s.args:null)); f.addModifiers((s!=null?s.postModifiers:null));
function.setType(Function.Type.JavaMethod); function.setName(ident((name!=null?name.getText():null))); function.setValueType(ret);