Lines Matching refs:method
94 string GenerateArgList(const AidlTypenames& typenames, const AidlMethod& method, in GenerateArgList() argument
97 for (const unique_ptr<AidlArgument>& a : method.GetArguments()) { in GenerateArgList()
141 if (method.GetType().GetName() != "void") { in GenerateArgList()
144 literal = CppNameOf(method.GetType(), typenames) + "*"; in GenerateArgList()
159 void GenerateMethodDecl(CodeWriter& out, const AidlTypenames& types, const AidlMethod& method, in GenerateMethodDecl() argument
162 out << "::android::binder::Status " << clazz_prefix << method.GetName() << "(" in GenerateMethodDecl()
163 << GenerateArgList(types, method, /*for_declartion=*/true, /*type_name_only=*/false) << ")"; in GenerateMethodDecl()
167 const AidlInterface& interface, const AidlMethod& method, in GenerateClientTransaction() argument
173 GenerateMethodDecl(out, typenames, method, bp_name); in GenerateClientTransaction()
194 kTraceVarName, interface.GetName().c_str(), method.GetName().c_str()); in GenerateClientTransaction()
198 out << GenLogBeforeExecute(bp_name, method, false /* isServer */, false /* isNdk */); in GenerateClientTransaction()
206 for (const auto& a : method.GetArguments()) { in GenerateClientTransaction()
229 if (method.IsOneway()) flags.push_back("::android::IBinder::FLAG_ONEWAY"); in GenerateClientTransaction()
233 GetTransactionIdFor(bn_name, method).c_str(), kDataVarName, kReplyVarName, in GenerateClientTransaction()
239 for (const auto& a : method.GetArguments()) { in GenerateClientTransaction()
246 if (method.GetType().GetName() != "void") { in GenerateClientTransaction()
251 out.Write(" return %s::getDefaultImpl()->%s(%s);\n", i_name.c_str(), method.GetName().c_str(), in GenerateClientTransaction()
256 if (!method.IsOneway()) { in GenerateClientTransaction()
273 if (method.GetType().GetName() != "void") { in GenerateClientTransaction()
275 ParcelReadMethodOf(method.GetType(), typenames).c_str(), in GenerateClientTransaction()
276 ParcelReadCastOf(method.GetType(), typenames, kReturnVarName).c_str()); in GenerateClientTransaction()
280 for (const AidlArgument* a : method.GetOutArguments()) { in GenerateClientTransaction()
299 out << GenLogAfterExecute(bp_name, interface, method, kStatusVarName, kReturnVarName, in GenerateClientTransaction()
309 const AidlMethod& method, const Options& options) { in GenerateClientMetaTransaction() argument
310 AIDL_FATAL_IF(method.IsUserDefined(), method); in GenerateClientMetaTransaction()
313 if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) { in GenerateClientMetaTransaction()
324 << GetTransactionIdFor(bn_name, method) << ", data, &reply);\n" in GenerateClientMetaTransaction()
337 if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateClientMetaTransaction()
345 << GetTransactionIdFor(bn_name, method) << ", data, &reply);\n" in GenerateClientMetaTransaction()
397 for (const auto& method : interface.GetMethods()) { in GenerateClientSource() local
398 if (method->IsUserDefined()) { in GenerateClientSource()
399 GenerateClientTransaction(out, typenames, interface, *method, options); in GenerateClientSource()
401 GenerateClientMetaTransaction(out, interface, *method, options); in GenerateClientSource()
446 const AidlMethod& method, const AidlTypenames& typenames, in GenerateServerTransaction() argument
452 for (const unique_ptr<AidlArgument>& a : method.GetArguments()) { in GenerateServerTransaction()
457 if (method.GetType().GetName() != "void") { in GenerateServerTransaction()
458 out.Write("%s %s;\n", CppNameOf(method.GetType(), typenames).c_str(), kReturnVarName); in GenerateServerTransaction()
469 kTraceVarName, interface.GetName().c_str(), method.GetName().c_str()); in GenerateServerTransaction()
472 if (interface.EnforceExpression() || method.GetType().EnforceExpression()) { in GenerateServerTransaction()
477 for (const auto& a: method.GetArguments()) { in GenerateServerTransaction()
498 out << GenLogBeforeExecute(bn_name, method, true /* isServer */, false /* isNdk */); in GenerateServerTransaction()
501 if (!method.GetArguments().empty() && options.GetMinSdkVersion() >= SDK_VERSION_Tiramisu) { in GenerateServerTransaction()
509 out.Write("%s %s(%s(%s));\n", kBinderStatusLiteral, kStatusVarName, method.GetName().c_str(), in GenerateServerTransaction()
510 GenerateArgList(typenames, method, /*for_declaration=*/false, /*type_name_only=*/false) in GenerateServerTransaction()
514 out << GenLogAfterExecute(bn_name, interface, method, kStatusVarName, kReturnVarName, in GenerateServerTransaction()
519 if (!method.IsOneway()) { in GenerateServerTransaction()
528 if (method.GetType().GetName() != "void") { in GenerateServerTransaction()
530 ParcelWriteMethodOf(method.GetType(), typenames).c_str(), in GenerateServerTransaction()
531 ParcelWriteCastOf(method.GetType(), typenames, kReturnVarName).c_str()); in GenerateServerTransaction()
535 for (const AidlArgument* a : method.GetOutArguments()) { in GenerateServerTransaction()
547 const AidlMethod& method, const Options& options) { in GenerateServerMetaTransaction() argument
548 AIDL_FATAL_IF(method.IsUserDefined(), method); in GenerateServerMetaTransaction()
551 if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) { in GenerateServerMetaTransaction()
556 if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateServerMetaTransaction()
590 for (const auto& method : interface.GetMethods()) { in GenerateServerOnTransact() local
591 out.Write("case %s:\n", GetTransactionIdFor(bn_name, *method).c_str()); in GenerateServerOnTransact()
594 if (method->IsUserDefined()) { in GenerateServerOnTransact()
595 GenerateServerTransaction(out, interface, *method, typenames, options); in GenerateServerOnTransact()
597 GenerateServerMetaTransaction(out, interface, *method, options); in GenerateServerOnTransact()
725 for (const auto& method : interface.GetMethods()) { in GenerateClientClassDecl() local
726 if (method->IsUserDefined()) { in GenerateClientClassDecl()
727 GenerateMethodDecl(out, typenames, *method, /*clazz=*/""); in GenerateClientClassDecl()
729 GenerateDeprecated(out, *method); in GenerateClientClassDecl()
731 } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) { in GenerateClientClassDecl()
732 out << "int32_t " << method->GetName() << "() override;\n"; in GenerateClientClassDecl()
733 } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateClientClassDecl()
734 out << "std::string " << method->GetName() << "() override;\n"; in GenerateClientClassDecl()
788 for (const auto& method : interface.GetMethods()) { in GenerateServerClassDecl() local
789 out << "static constexpr uint32_t TRANSACTION_" << method->GetName() << " = " in GenerateServerClassDecl()
790 << "::android::IBinder::FIRST_CALL_TRANSACTION + " << std::to_string(method->GetId()) in GenerateServerClassDecl()
819 for (const auto& method : interface.GetMethods()) { in GenerateServerClassDecl() local
820 if (method->IsUserDefined()) { in GenerateServerClassDecl()
821 GenerateMethodDecl(out, typenames, *method, /*clazz=*/""); in GenerateServerClassDecl()
823 GenerateDeprecated(out, *method); in GenerateServerClassDecl()
826 for (const auto& arg : method->GetArguments()) { in GenerateServerClassDecl()
833 if (method->GetType().GetName() != "void") { in GenerateServerClassDecl()
837 << " return " << kDelegateImplVarName << "->" << method->GetName() << "(" in GenerateServerClassDecl()
840 } else if (method->GetName() == kGetInterfaceVersion && options.Version()) { in GenerateServerClassDecl()
850 } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateServerClassDecl()
907 for (const auto& method : interface.GetMethods()) { in GenerateInterfaceClassDecl() local
908 if (method->IsUserDefined()) { in GenerateInterfaceClassDecl()
910 GenerateMethodDecl(out, typenames, *method, /*clazz=*/""); in GenerateInterfaceClassDecl()
911 GenerateDeprecated(out, *method); in GenerateInterfaceClassDecl()
913 } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) { in GenerateInterfaceClassDecl()
914 out << "virtual int32_t " << method->GetName() << "() = 0;\n"; in GenerateInterfaceClassDecl()
915 } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateInterfaceClassDecl()
916 out << "virtual std::string " << method->GetName() << "() = 0;\n"; in GenerateInterfaceClassDecl()
941 for (const auto& method : interface.GetMethods()) { in GenerateInterfaceClassDecl() local
942 if (method->IsUserDefined()) { in GenerateInterfaceClassDecl()
943 out << "::android::binder::Status " << method->GetName() << "(" in GenerateInterfaceClassDecl()
944 << GenerateArgList(typenames, *method, /*for_declaration=*/true, /*type_name_only=*/true) in GenerateInterfaceClassDecl()
946 GenerateDeprecated(out, *method); in GenerateInterfaceClassDecl()
950 } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) { in GenerateInterfaceClassDecl()
954 } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) { in GenerateInterfaceClassDecl()
985 string method = ParcelReadMethodOf(variable->GetType(), typenames); in GenerateReadFromParcel() local
991 out << "_aidl_ret_status = _aidl_parcel->" << method << "(" << arg << ");\n"; in GenerateReadFromParcel()
1006 string method = ParcelWriteMethodOf(variable->GetType(), typenames); in GenerateWriteToParcel() local
1008 out << "_aidl_ret_status = " << kParcelVarName << "->" << method << "(" << arg << ");\n"; in GenerateWriteToParcel()