diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-21 12:00:51 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2014-12-21 12:00:51 +0100 |
commit | b5e0b3822f08ad64d2cdacce15256222759a59e1 (patch) | |
tree | c395589fd62116215dd00e1d33d38f58446740f4 /src/core/managed | |
parent | 989cc6d8064a95426962588f806bb987a6896e7f (diff) |
made Rtti a source dependency of Managed, not a header dependency
Diffstat (limited to 'src/core/managed')
-rw-r--r-- | src/core/managed/Managed.cpp | 9 | ||||
-rw-r--r-- | src/core/managed/Managed.hpp | 15 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/core/managed/Managed.cpp b/src/core/managed/Managed.cpp index f55cca5..dc3731f 100644 --- a/src/core/managed/Managed.cpp +++ b/src/core/managed/Managed.cpp @@ -19,6 +19,8 @@ #include <cassert> #include <queue> +#include <core/common/Rtti.hpp> + #include "Managed.hpp" #include "ManagedContainer.hpp" @@ -52,4 +54,11 @@ bool Managed::deleteData(const std::string &key) { return mgr.deleteData(this, key); } +const RttiBase &Managed::type() const +{ + return typeOf(*this); +} + +bool Managed::isa(const RttiBase &t) const { return type().isa(t); } + } diff --git a/src/core/managed/Managed.hpp b/src/core/managed/Managed.hpp index 70136d3..6e0242a 100644 --- a/src/core/managed/Managed.hpp +++ b/src/core/managed/Managed.hpp @@ -19,8 +19,6 @@ #ifndef _OUSIA_MANAGED_HPP_ #define _OUSIA_MANAGED_HPP_ -#include <core/common/Rtti.hpp> - #include "Manager.hpp" namespace ousia { @@ -37,6 +35,8 @@ class Owned; template <class T> class DefaultListener; +class RttiBase; + // TODO: Implement clone, getReferenced and getReferencing /** @@ -98,6 +98,8 @@ public: return Owned<T>{t, this}; } + /* Data store methods */ + void storeData(const std::string &key, Handle<Managed> h); bool hasDataKey(const std::string &key); @@ -108,6 +110,8 @@ public: bool deleteData(const std::string &key); + /* RTTI methods */ + /** * Returns the RttiBase instance registered for instances of the type of * this Managed instance. @@ -115,10 +119,7 @@ public: * @return a reference to the registered RttiBase for this particular * Managed class. */ - const RttiBase &type() const - { - return typeOf(*this); - } + const RttiBase &type() const; /** * Returns true if this Managed instance is of the given RttiBase. @@ -127,7 +128,7 @@ public: * class is of the given type or one of the registered parent types is of * the given type. */ - bool isa(const RttiBase &t) const { return type().isa(t); } + bool isa(const RttiBase &t) const; }; /** |