summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-12-21 12:00:51 +0100
committerAndreas Stöckel <andreas@somweyr.de>2014-12-21 12:00:51 +0100
commitb5e0b3822f08ad64d2cdacce15256222759a59e1 (patch)
treec395589fd62116215dd00e1d33d38f58446740f4
parent989cc6d8064a95426962588f806bb987a6896e7f (diff)
made Rtti a source dependency of Managed, not a header dependency
-rw-r--r--src/core/managed/Managed.cpp9
-rw-r--r--src/core/managed/Managed.hpp15
-rw-r--r--src/core/model/Document.cpp1
-rw-r--r--src/core/model/Domain.cpp2
-rw-r--r--src/core/model/Typesystem.cpp1
-rw-r--r--test/core/managed/ManagedTest.cpp1
-rw-r--r--test/core/model/DomainTest.cpp1
-rw-r--r--test/core/model/TypesystemTest.cpp1
8 files changed, 24 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;
};
/**
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 <core/common/Exceptions.hpp>
+#include <core/common/Rtti.hpp>
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 <http://www.gnu.org/licenses/>.
*/
+#include <core/common/Rtti.hpp>
+
#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 <core/common/Rtti.hpp>
#include <core/common/Utils.hpp>
namespace ousia {
diff --git a/test/core/managed/ManagedTest.cpp b/test/core/managed/ManagedTest.cpp
index 61b89ef..d6a392a 100644
--- a/test/core/managed/ManagedTest.cpp
+++ b/test/core/managed/ManagedTest.cpp
@@ -18,6 +18,7 @@
#include <gtest/gtest.h>
+#include <core/common/Rtti.hpp>
#include <core/managed/Managed.hpp>
#include "TestManaged.hpp"
diff --git a/test/core/model/DomainTest.cpp b/test/core/model/DomainTest.cpp
index 65954e7..e16da96 100644
--- a/test/core/model/DomainTest.cpp
+++ b/test/core/model/DomainTest.cpp
@@ -20,6 +20,7 @@
#include <iostream>
+#include <core/common/Rtti.hpp>
#include <core/model/Domain.hpp>
#include "TestDomain.hpp"
diff --git a/test/core/model/TypesystemTest.cpp b/test/core/model/TypesystemTest.cpp
index 9939adf..6695b8e 100644
--- a/test/core/model/TypesystemTest.cpp
+++ b/test/core/model/TypesystemTest.cpp
@@ -20,6 +20,7 @@
#include <iostream>
+#include <core/common/Rtti.hpp>
#include <core/model/Typesystem.hpp>
namespace ousia {