From e8863235b93ff79cd68faf93e92140114bfa4ceb Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 18:48:12 +0100 Subject: Added "setIntersection" method to Rtti class. --- src/core/common/Rtti.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/common/Rtti.cpp') 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(); -- cgit v1.2.3