| 73 | } |
| 74 | |
| 75 | bool ExtensionContainer::hasExtension(Base::Type type, bool derived) const |
| 76 | { |
| 77 | |
| 78 | // check for the exact type |
| 79 | bool found = _extensions.find(type) != _extensions.end(); |
| 80 | if (!found && derived) { |
| 81 | // and for types derived from it, as they can be cast to the extension |
| 82 | for (const auto& entry : _extensions) { |
| 83 | if (entry.first.isDerivedFrom(type)) { |
| 84 | return true; |
| 85 | } |
| 86 | } |
| 87 | return false; |
| 88 | } |
| 89 | return found; |
| 90 | } |
| 91 | |
| 92 | bool ExtensionContainer::hasExtension(const std::string& name) const |
| 93 | { |
no test coverage detected