diff --git a/src/App/ExtensionContainer.h b/src/App/ExtensionContainer.h index 68517fda3d..9a3b0e6fc0 100644 --- a/src/App/ExtensionContainer.h +++ b/src/App/ExtensionContainer.h @@ -125,6 +125,11 @@ public: bool hasExtensions() const; App::Extension* getExtension(Base::Type, bool derived = true, bool no_except=false) const; App::Extension* getExtension(const std::string& name) const; //this version does not check derived classes + // this version checks for derived types and doesn't throw + template + ExtensionT* getExtension() const { + return static_cast(getExtension(ExtensionT::getExtensionClassTypeId(), true, true)); + } //returns first of type (or derived from) and throws otherwise template