aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/mapper/MapperRegistry.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/mapper/MapperRegistry.hpp')
-rw-r--r--include/cru/ui/mapper/MapperRegistry.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/cru/ui/mapper/MapperRegistry.hpp b/include/cru/ui/mapper/MapperRegistry.hpp
index c3e5b4c4..1c02be49 100644
--- a/include/cru/ui/mapper/MapperRegistry.hpp
+++ b/include/cru/ui/mapper/MapperRegistry.hpp
@@ -39,6 +39,16 @@ class CRU_UI_API MapperRegistry {
return GetMapper<ClonablePtr<T>>();
}
+ template <typename T>
+ std::vector<T*> GetMappersByInterface() const {
+ std::vector<T*> result;
+ for (auto mapper : mapper_list_) {
+ auto m = dynamic_cast<T*>(mapper);
+ if (m) result.push_back(m);
+ }
+ return result;
+ }
+
void RegisterMapper(MapperBase* mapper);
void UnregisterMapper(MapperBase* mapper);