From 5c8c0cc70b49c5fb2d85778c31c3d3f9a670d315 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 3 Jan 2015 16:44:15 +0100 Subject: Renamed "contains" to aggregatedOf, added corresponding convenience function to Rtti class --- src/core/common/Rtti.cpp | 7 ++++--- src/core/common/Rtti.hpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/common') diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp index 5de2b4c..edfcda8 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -54,7 +54,7 @@ void RttiBase::initialize() const initialized = true; // Insert the parent types of the parent types and the aggregated types - // if the parents + // of the parents { std::unordered_set origParents = parents; for (const RttiBase *parent : origParents) { @@ -69,7 +69,8 @@ void RttiBase::initialize() const parents.insert(this); } - // Insert the aggregated types of the aggregated types + // Insert the aggregated types of the aggregated types and the parents + // of each aggregated type { std::unordered_set origAggregatedTypes = aggregatedTypes; @@ -90,7 +91,7 @@ bool RttiBase::isa(const RttiBase &other) const return parents.count(&other) > 0; } -bool RttiBase::contains(const RttiBase &other) const +bool RttiBase::aggregatedOf(const RttiBase &other) const { initialize(); return aggregatedTypes.count(&other) > 0; diff --git a/src/core/common/Rtti.hpp b/src/core/common/Rtti.hpp index 090b65b..deaf128 100644 --- a/src/core/common/Rtti.hpp +++ b/src/core/common/Rtti.hpp @@ -189,7 +189,7 @@ public: * @param other is the other type for which should be checked whether this * type is directly or indirectly aggregated of it. */ - bool contains(const RttiBase &other) const; + bool aggregatedOf(const RttiBase &other) const; }; /** -- cgit v1.2.3