diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-16 02:34:36 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-16 02:34:36 +0100 |
commit | c6aa669aac80466ea287e9a27348c1068cc1f17e (patch) | |
tree | d72a74f50bf8a56ee267585635a4d7df73b9b277 /src/core | |
parent | 71346efac9d56a8753ee9032f7f96aa90fba9959 (diff) |
changed paths to new location of the Managed class, adapted NodeVector and NodeMap to the slightly changed conditions in the Node class
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/CSS.hpp | 2 | ||||
-rw-r--r-- | src/core/Node.hpp | 41 | ||||
-rw-r--r-- | src/core/model/Domain.hpp | 2 | ||||
-rw-r--r-- | src/core/model/Typesystem.hpp | 3 |
4 files changed, 22 insertions, 26 deletions
diff --git a/src/core/CSS.hpp b/src/core/CSS.hpp index a54d956..06ddfc8 100644 --- a/src/core/CSS.hpp +++ b/src/core/CSS.hpp @@ -24,8 +24,8 @@ #include <tuple> #include <core/common/Variant.hpp> +#include <core/managed/Managed.hpp> -#include "Managed.hpp" #include "Node.hpp" namespace ousia { diff --git a/src/core/Node.hpp b/src/core/Node.hpp index b7d050d..4bc95be 100644 --- a/src/core/Node.hpp +++ b/src/core/Node.hpp @@ -25,8 +25,8 @@ #include <vector> #include <unordered_set> -#include "Managed.hpp" -#include "ManagedContainers.hpp" +#include <core/managed/Managed.hpp> +#include <core/managed/ManagedContainer.hpp> namespace ousia { @@ -512,33 +512,30 @@ public: bool triggerEvent(Event &event, bool fromChild = false); }; -template <class T, class Collection> -class NodeGenericList : public ManagedGenericList<T, Collection> { -protected: - // TODO: Override addElement, deleteElement once this is necessary -public: - using ManagedGenericList<T, Collection>::ManagedGenericList; -}; +// TODO: Use a different listener here for updating name maps -template <class K, class T, class Collection> -class NodeGenericMap : public ManagedGenericMap<K, T, Collection> { -protected: - // TODO: Override addElement, deleteElement once this is necessary +template <class T, class Listener = DefaultListener<Handle<T>>> +class NodeVector + : public ManagedGenericList<T, std::vector<Handle<T>>, + ListAccessor<Handle<T>>, Listener> { public: - using ManagedGenericMap<K, T, std::vector<Owned<T>>>::ManagedGenericMap; + using Base = ManagedGenericList<T, std::vector<Handle<T>>, + ListAccessor<Handle<T>>, Listener>; + using Base::ManagedGenericList; }; -template <class T> -class NodeVector : public NodeGenericList<T, std::vector<Owned<T>>> { +template <class K, class T, + class Listener = DefaultListener<std::pair<K, Handle<T>>>> +class NodeMap + : public ManagedGenericMap<K, T, std::map<K, Handle<T>>, + MapAccessor<std::pair<K, Handle<T>>>, Listener> { public: - using NodeGenericList<T, std::vector<Owned<T>>>::NodeGenericList; + using Base = + ManagedGenericMap<K, T, std::map<K, Handle<T>>, + MapAccessor<std::pair<K, Handle<T>>>, Listener>; + using Base::ManagedGenericMap; }; -template <class K, class T> -class NodeMap : public NodeGenericMap<K, T, std::map<K, Owned<T>>> { -public: - using NodeGenericMap<K, T, std::map<K, Owned<T>>>::NodeGenericMap; -}; } diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 565313f..40b48c6 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -27,7 +27,7 @@ #ifndef _OUSIA_MODEL_DOMAIN_HPP_ #define _OUSIA_MODEL_DOMAIN_HPP_ -#include <core/ManagedContainers.hpp> +#include <core/managed/ManagedContainer.hpp> #include <core/Node.hpp> namespace ousia { diff --git a/src/core/model/Typesystem.hpp b/src/core/model/Typesystem.hpp index 77a862b..347adb8 100644 --- a/src/core/model/Typesystem.hpp +++ b/src/core/model/Typesystem.hpp @@ -30,7 +30,6 @@ #include <map> #include <vector> -#include <core/ManagedContainers.hpp> #include <core/Node.hpp> #include <core/common/Exceptions.hpp> #include <core/common/Logger.hpp> @@ -361,7 +360,7 @@ public: class Typesystem : public Node { private: - ManagedVector<Type> types; + NodeVector<Type> types; public: Typesystem(Manager &mgr, std::string name, Handle<Node> parent = nullptr) |