summaryrefslogtreecommitdiff
path: root/src/core/common/Rtti.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-07 02:31:51 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-07 02:31:51 +0100
commitf6531b10353dacdcbab211a31926c165211cf3b3 (patch)
treeb0c6508bb58b5a34e4b4f8007af5af44fd38aca1 /src/core/common/Rtti.cpp
parent6b3b2f5965e5dfb2000bb9c23f11a83e175741de (diff)
Unified handling of references to Rtti instances: Now using pointers everywhere
Diffstat (limited to 'src/core/common/Rtti.cpp')
-rw-r--r--src/core/common/Rtti.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp
index acc98a7..7c353d5 100644
--- a/src/core/common/Rtti.cpp
+++ b/src/core/common/Rtti.cpp
@@ -34,14 +34,14 @@ void RttiStore::store(const std::type_info &native, const Rtti *rtti)
table().emplace(std::type_index{native}, rtti);
}
-const Rtti &RttiStore::lookup(const std::type_info &native)
+const Rtti *RttiStore::lookup(const std::type_info &native)
{
const auto &tbl = table();
auto it = tbl.find(std::type_index{native});
if (it == tbl.end()) {
- return RttiTypes::None;
+ return &RttiTypes::None;
} else {
- return *(it->second);
+ return it->second;
}
}
@@ -120,10 +120,10 @@ void Rtti::initialize() const
}
}
-bool Rtti::isa(const Rtti &other) const
+bool Rtti::isa(const Rtti *other) const
{
initialize();
- return parents.count(&other) > 0;
+ return parents.count(other) > 0;
}
bool Rtti::isOneOf(const RttiSet &others) const
@@ -158,10 +158,10 @@ RttiSet Rtti::setIntersection(const RttiSet &s1, const RttiSet &s2)
return res;
}
-bool Rtti::composedOf(const Rtti &other) const
+bool Rtti::composedOf(const Rtti *other) const
{
initialize();
- return compositeTypes.count(&other) > 0;
+ return compositeTypes.count(other) > 0;
}
const RttiMethodMap &Rtti::getMethods() const