From 603dedfa2b3704730fa4db8e7f84702b26da9ae6 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 3 Jan 2015 16:17:11 +0100 Subject: Improved contains functionality (now includes the parent types of each aggregated type and the aggregated types of each parent) --- src/core/common/Rtti.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/core/common/Rtti.cpp') diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp index 0443a8d..5de2b4c 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -53,13 +53,19 @@ void RttiBase::initialize() const if (!initialized) { initialized = true; - // Insert the parent types of the parent types + // Insert the parent types of the parent types and the aggregated types + // if the parents { std::unordered_set origParents = parents; for (const RttiBase *parent : origParents) { parent->initialize(); parents.insert(parent->parents.begin(), parent->parents.end()); } + for (const RttiBase *parent : parents) { + parent->initialize(); + aggregatedTypes.insert(parent->aggregatedTypes.begin(), + parent->aggregatedTypes.end()); + } parents.insert(this); } @@ -71,6 +77,8 @@ void RttiBase::initialize() const aggregatedType->initialize(); aggregatedTypes.insert(aggregatedType->aggregatedTypes.begin(), aggregatedType->aggregatedTypes.end()); + aggregatedTypes.insert(aggregatedType->parents.begin(), + aggregatedType->parents.end()); } } } -- cgit v1.2.3