Doc: Improve App::ExtensionContainer documentation

This commit is contained in:
Pieter Hijma
2025-05-07 20:57:23 +02:00
committed by Chris Hennes
parent 8414d6d1d9
commit 3ddcc10f12
2 changed files with 277 additions and 82 deletions

View File

@@ -74,15 +74,15 @@ void ExtensionContainer::registerExtension(Base::Type extension, Extension* ext)
_extensions[extension] = ext;
}
bool ExtensionContainer::hasExtension(Base::Type t, bool derived) const
bool ExtensionContainer::hasExtension(Base::Type type, bool derived) const
{
// check for the exact type
bool found = _extensions.find(t) != _extensions.end();
bool found = _extensions.find(type) != _extensions.end();
if (!found && derived) {
// and for types derived from it, as they can be cast to the extension
for (const auto& entry : _extensions) {
if (entry.first.isDerivedFrom(t)) {
if (entry.first.isDerivedFrom(type)) {
return true;
}
}