Move interface reserved cpp impl to source file. am: d4b068ab09
am: d7faeb8422
Change-Id: I53b964aed474fb87ca229316fe09c2e94a6f459c
diff --git a/generateCpp.cpp b/generateCpp.cpp
index c66dbbb..5164c73 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -395,14 +395,10 @@
if (!isIBase()) {
out << " override";
}
- out << " {\n";
- out.indent();
- method->cppImpl(IMPL_HEADER, out);
- out.unindent();
- out << "\n}\n";
} else {
- out << " = 0;\n";
+ out << " = 0";
}
+ out << ";\n";
}
out << "// cast static functions\n";
@@ -1843,6 +1839,27 @@
// generate castFrom functions
std::string childTypeResult = iface->getCppResultType();
+ status_t err = generateMethods(out, [&](const Method *method, const Interface *) {
+ bool reserved = method->isHidlReserved();
+
+ if (!reserved) {
+ out << "// no default implementation for: ";
+ }
+ method->generateCppSignature(out, iface->localName());
+ if (reserved) {
+ out.block([&]() {
+ method->cppImpl(IMPL_HEADER, out);
+ }).endl();
+ }
+
+ out << "\n";
+
+ return OK;
+ });
+ if (err != OK) {
+ return err;
+ }
+
for (const Interface *superType : iface->typeChain()) {
out << "// static \n"
<< childTypeResult