summaryrefslogtreecommitdiff
path: root/source/core/slang-lazy-castable-list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-lazy-castable-list.cpp')
-rw-r--r--source/core/slang-lazy-castable-list.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/core/slang-lazy-castable-list.cpp b/source/core/slang-lazy-castable-list.cpp
index d9f0090d5..1832a67f4 100644
--- a/source/core/slang-lazy-castable-list.cpp
+++ b/source/core/slang-lazy-castable-list.cpp
@@ -112,7 +112,19 @@ void* LazyCastableList::find(const Guid& guid)
}
return nullptr;
}
-
+
+ICastable* LazyCastableList::findWithPredicate(ICastableList::FindFunc func, void* data)
+{
+ for (auto castable : getView())
+ {
+ if (func(castable, data))
+ {
+ return castable;
+ }
+ }
+ return nullptr;
+}
+
ConstArrayView<ICastable*> LazyCastableList::getView() const
{
switch (m_state)