diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/common/Rtti.cpp | 30 | ||||
-rw-r--r-- | src/core/common/Rtti.hpp | 26 | ||||
-rw-r--r-- | src/core/managed/Managed.cpp | 4 | ||||
-rw-r--r-- | src/core/managed/Managed.hpp | 2 | ||||
-rw-r--r-- | src/core/managed/Manager.cpp | 2 |
5 files changed, 32 insertions, 32 deletions
diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp index edfcda8..feabe05 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -53,7 +53,7 @@ void RttiBase::initialize() const if (!initialized) { initialized = true; - // Insert the parent types of the parent types and the aggregated types + // Insert the parent types of the parent types and the composite types // of the parents { std::unordered_set<const RttiBase *> origParents = parents; @@ -63,23 +63,23 @@ void RttiBase::initialize() const } for (const RttiBase *parent : parents) { parent->initialize(); - aggregatedTypes.insert(parent->aggregatedTypes.begin(), - parent->aggregatedTypes.end()); + compositeTypes.insert(parent->compositeTypes.begin(), + parent->compositeTypes.end()); } parents.insert(this); } - // Insert the aggregated types of the aggregated types and the parents - // of each aggregated type + // Insert the composite types of the composite types and the parents + // of each composite type { - std::unordered_set<const RttiBase *> origAggregatedTypes = - aggregatedTypes; - for (const RttiBase *aggregatedType : origAggregatedTypes) { - aggregatedType->initialize(); - aggregatedTypes.insert(aggregatedType->aggregatedTypes.begin(), - aggregatedType->aggregatedTypes.end()); - aggregatedTypes.insert(aggregatedType->parents.begin(), - aggregatedType->parents.end()); + std::unordered_set<const RttiBase *> origCompositeTypes = + compositeTypes; + for (const RttiBase *compositeType : origCompositeTypes) { + compositeType->initialize(); + compositeTypes.insert(compositeType->compositeTypes.begin(), + compositeType->compositeTypes.end()); + compositeTypes.insert(compositeType->parents.begin(), + compositeType->parents.end()); } } } @@ -91,10 +91,10 @@ bool RttiBase::isa(const RttiBase &other) const return parents.count(&other) > 0; } -bool RttiBase::aggregatedOf(const RttiBase &other) const +bool RttiBase::composedOf(const RttiBase &other) const { initialize(); - return aggregatedTypes.count(&other) > 0; + return compositeTypes.count(&other) > 0; } /* Constant initialization */ diff --git a/src/core/common/Rtti.hpp b/src/core/common/Rtti.hpp index ab937f5..237c60f 100644 --- a/src/core/common/Rtti.hpp +++ b/src/core/common/Rtti.hpp @@ -114,9 +114,9 @@ public: class RttiBase { private: /** - * Set to true if once the parents and the aggregated types list have been + * Set to true if once the parents and the composite types list have been * completed (by including the parents of the original parent elements and - * the aggregated types of the original aggregated types). + * the composite types of the original composite types). */ mutable bool initialized; @@ -126,14 +126,14 @@ private: mutable std::unordered_set<const RttiBase *> parents; /** - * Set containing references to all types this type is aggregated of, - * including all aggregated types of the original aggregated types. + * Set containing references to all types this type is a composition of, + * including all composite types of the original composite types. */ - mutable std::unordered_set<const RttiBase *> aggregatedTypes; + mutable std::unordered_set<const RttiBase *> compositeTypes; /** - * Adds the parent types of the parents and the aggregated types of the - * aggregated types to the internal sets. + * Adds the parent types of the original parents and the composite types of + * the original composite types to the internal sets for faster lookup. */ void initialize() const; @@ -162,11 +162,11 @@ public: RttiBase(std::string name, const std::type_info &native, std::unordered_set<const RttiBase *> parents = std::unordered_set<const RttiBase *>{}, - std::unordered_set<const RttiBase *> aggregatedTypes = + std::unordered_set<const RttiBase *> compositeTypes = std::unordered_set<const RttiBase *>{}) : initialized(false), parents(std::move(parents)), - aggregatedTypes(aggregatedTypes), + compositeTypes(compositeTypes), name(std::move(name)) { RttiStore::store(native, this); @@ -187,9 +187,9 @@ public: * resolving objects of a certain type by name in an object graph. * * @param other is the other type for which should be checked whether this - * type is directly or indirectly aggregated of it. + * type is directly or indirectly composed of it. */ - bool aggregatedOf(const RttiBase &other) const; + bool composedOf(const RttiBase &other) const; }; /** @@ -212,10 +212,10 @@ public: */ Rtti(std::string name, const std::unordered_set<const RttiBase *> &parents = std::unordered_set<const RttiBase *>{}, - std::unordered_set<const RttiBase *> aggregatedTypes = + std::unordered_set<const RttiBase *> compositeTypes = std::unordered_set<const RttiBase *>{}) : RttiBase(name, typeid(T), std::move(parents), - std::move(aggregatedTypes)) + std::move(compositeTypes)) { } }; diff --git a/src/core/managed/Managed.cpp b/src/core/managed/Managed.cpp index cede819..1342fec 100644 --- a/src/core/managed/Managed.cpp +++ b/src/core/managed/Managed.cpp @@ -81,8 +81,8 @@ const RttiBase &Managed::type() const { return typeOf(*this); } bool Managed::isa(const RttiBase &t) const { return type().isa(t); } -bool Managed::aggregatedOf(const RttiBase &t) const +bool Managed::composedOf(const RttiBase &t) const { - return type().aggregatedOf(t); + return type().composedOf(t); } } diff --git a/src/core/managed/Managed.hpp b/src/core/managed/Managed.hpp index fecbfdd..f7eaa48 100644 --- a/src/core/managed/Managed.hpp +++ b/src/core/managed/Managed.hpp @@ -215,7 +215,7 @@ public: * @param true if the RttiBase registered for this particular Managed class * may contain instance of the given type. */ - bool aggregatedOf(const RttiBase &t) const; + bool composedOf(const RttiBase &t) const; }; /** diff --git a/src/core/managed/Manager.cpp b/src/core/managed/Manager.cpp index 4eaa71f..5428ea1 100644 --- a/src/core/managed/Manager.cpp +++ b/src/core/managed/Manager.cpp @@ -674,7 +674,7 @@ void Manager::exportGraphviz(const char *filename) } } } - if (et == EdgeType::NORMAL && type.aggregatedOf(typeTar)) { + if (et == EdgeType::NORMAL && type.composedOf(typeTar)) { et = EdgeType::AGGREGATE; } |