Extensions: special calls for document object extensions

This commit is contained in:
Stefan Tröger
2016-06-02 06:29:05 +02:00
committed by wmayer
parent 4c42181e34
commit a8d0accdad
17 changed files with 732 additions and 38 deletions

View File

@@ -177,3 +177,14 @@ Extension* ExtensionContainer::getExtension(const char* name) {
}
return nullptr;
}
std::vector< Extension* > ExtensionContainer::getExtensionsDerivedFrom(Base::Type type) const {
std::vector<Extension*> vec;
//and for types derived from it, as they can be cast to the extension
for(auto entry : _extensions) {
if(entry.first.isDerivedFrom(type))
vec.push_back(entry.second);
}
return vec;
}