From ef59091033b3f69dd01df009f21927b8ad81f5a9 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 23 Jan 2015 00:30:44 +0100 Subject: Improved documentation and added "isOneOf" function 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 1213669..668e418 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -125,6 +125,17 @@ bool Rtti::isa(const Rtti &other) const return parents.count(&other) > 0; } +bool Rtii::isOneOf(const RttiSet &others) const +{ + initialize(); + for (const Rtti *other: others) { + if (parents.count(other) > 0) { + return true; + } + } + return false; +} + bool Rtti::composedOf(const Rtti &other) const { initialize(); -- cgit v1.2.3