summaryrefslogtreecommitdiff
path: root/src/core/common/Rtti.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-25 18:48:12 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-25 18:48:12 +0100
commite8863235b93ff79cd68faf93e92140114bfa4ceb (patch)
tree2730a9c44dbeef24ebca5278d9aba4523fa710f8 /src/core/common/Rtti.cpp
parentc36f476f434c16a52ada15bdfcc5f92bcad1b8db (diff)
Added "setIntersection" method to Rtti class.
Diffstat (limited to 'src/core/common/Rtti.cpp')
-rw-r--r--src/core/common/Rtti.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp
index 6849a0e..acc98a7 100644
--- a/src/core/common/Rtti.cpp
+++ b/src/core/common/Rtti.cpp
@@ -147,6 +147,17 @@ bool Rtti::setIsOneOf(const RttiSet &s1, const RttiSet &s2)
return false;
}
+RttiSet Rtti::setIntersection(const RttiSet &s1, const RttiSet &s2)
+{
+ RttiSet res;
+ for (const Rtti *t1 : s1) {
+ if (t1->isOneOf(s2)) {
+ res.insert(t1);
+ }
+ }
+ return res;
+}
+
bool Rtti::composedOf(const Rtti &other) const
{
initialize();