From b5e0b3822f08ad64d2cdacce15256222759a59e1 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 21 Dec 2014 12:00:51 +0100 Subject: made Rtti a source dependency of Managed, not a header dependency --- src/core/managed/Managed.cpp | 9 +++++++++ src/core/managed/Managed.hpp | 15 ++++++++------- src/core/model/Document.cpp | 1 + src/core/model/Domain.cpp | 2 ++ src/core/model/Typesystem.cpp | 1 + 5 files changed, 21 insertions(+), 7 deletions(-) (limited to 'src') 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 #include +#include + #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 - #include "Manager.hpp" namespace ousia { @@ -37,6 +35,8 @@ class Owned; template class DefaultListener; +class RttiBase; + // TODO: Implement clone, getReferenced and getReferencing /** @@ -98,6 +98,8 @@ public: return Owned{t, this}; } + /* Data store methods */ + void storeData(const std::string &key, Handle 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; }; /** diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp index f6ed5de..fce9d23 100644 --- a/src/core/model/Document.cpp +++ b/src/core/model/Document.cpp @@ -19,6 +19,7 @@ #include "Document.hpp" #include +#include namespace ousia { namespace model { diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index 4901692..77708e6 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -16,6 +16,8 @@ along with this program. If not, see . */ +#include + #include "Domain.hpp" namespace ousia { diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp index 1da45ae..bd3b742 100644 --- a/src/core/model/Typesystem.cpp +++ b/src/core/model/Typesystem.cpp @@ -18,6 +18,7 @@ #include "Typesystem.hpp" +#include #include namespace ousia { -- cgit v1.2.3