From 7df5f30494b7da283164717dea9098c8d9dca77a Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 11 Jan 2015 13:23:26 +0100 Subject: Renamed RttiBase to RttiType --- src/core/common/Rtti.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/core/common/Rtti.cpp') diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp index feabe05..7ee3c45 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -22,18 +22,18 @@ namespace ousia { /* Class RttiStore */ -std::unordered_map &RttiStore::table() +std::unordered_map &RttiStore::table() { - static std::unordered_map table; + static std::unordered_map table; return table; } -void RttiStore::store(const std::type_info &native, const RttiBase *rtti) +void RttiStore::store(const std::type_info &native, const RttiType *rtti) { table().emplace(std::type_index{native}, rtti); } -const RttiBase &RttiStore::lookup(const std::type_info &native) +const RttiType &RttiStore::lookup(const std::type_info &native) { const auto &tbl = table(); auto it = tbl.find(std::type_index{native}); @@ -44,9 +44,9 @@ const RttiBase &RttiStore::lookup(const std::type_info &native) } } -/* Class RttiBase */ +/* Class RttiType */ -void RttiBase::initialize() const +void RttiType::initialize() const { // Only run this function exactly once -- directly set the initialized flag // to prevent unwanted recursion @@ -56,12 +56,12 @@ void RttiBase::initialize() const // Insert the parent types of the parent types and the composite types // of the parents { - std::unordered_set origParents = parents; - for (const RttiBase *parent : origParents) { + std::unordered_set origParents = parents; + for (const RttiType *parent : origParents) { parent->initialize(); parents.insert(parent->parents.begin(), parent->parents.end()); } - for (const RttiBase *parent : parents) { + for (const RttiType *parent : parents) { parent->initialize(); compositeTypes.insert(parent->compositeTypes.begin(), parent->compositeTypes.end()); @@ -72,9 +72,9 @@ void RttiBase::initialize() const // Insert the composite types of the composite types and the parents // of each composite type { - std::unordered_set origCompositeTypes = + std::unordered_set origCompositeTypes = compositeTypes; - for (const RttiBase *compositeType : origCompositeTypes) { + for (const RttiType *compositeType : origCompositeTypes) { compositeType->initialize(); compositeTypes.insert(compositeType->compositeTypes.begin(), compositeType->compositeTypes.end()); @@ -85,13 +85,13 @@ void RttiBase::initialize() const } } -bool RttiBase::isa(const RttiBase &other) const +bool RttiType::isa(const RttiType &other) const { initialize(); return parents.count(&other) > 0; } -bool RttiBase::composedOf(const RttiBase &other) const +bool RttiType::composedOf(const RttiType &other) const { initialize(); return compositeTypes.count(&other) > 0; @@ -99,6 +99,6 @@ bool RttiBase::composedOf(const RttiBase &other) const /* Constant initialization */ -const RttiBase RttiTypes::None; +const RttiType RttiTypes::None; } -- cgit v1.2.3