Default implementations of interfaces may rely on extra class
declarations, which aren't currently generated in the external model,
that in turn may rely on functions defined in the main Attribute/Type
class, which wouldn't be available on the external model.
os << " };\n";
}
- // Emit the template for the external model.
os << " template<typename ConcreteModel, typename " << valueTemplate
<< ">\n";
os << " class ExternalModel : public FallbackModel<ConcreteModel> {\n";
+
+ // Emit the template for the external model if there are no extra class
+ // declarations.
+ if (interface.getExtraClassDeclaration()) {
+ os << " };\n";
+ return;
+ }
+
os << " public:\n";
// Emit declarations for methods that have default implementations. Other
}
// Emit default implementations for the external model.
+ if (interface.getExtraClassDeclaration())
+ return;
+
for (auto &method : interface.getMethods()) {
if (!method.getDefaultImplementation())
continue;