From 37fadceb4b2e060844bd1c68f22eb71ce362249d Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 21 Nov 2014 20:55:18 +0100 Subject: renamed add and deleteManaged functions, improved NodeVector and NodeMap classes --- src/core/Node.hpp | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'src/core/Node.hpp') diff --git a/src/core/Node.hpp b/src/core/Node.hpp index f32beb7..b7d050d 100644 --- a/src/core/Node.hpp +++ b/src/core/Node.hpp @@ -25,7 +25,8 @@ #include #include -#include +#include "Managed.hpp" +#include "ManagedContainers.hpp" namespace ousia { @@ -226,12 +227,12 @@ public: * filter tests whether the given node meets the requirements for inclusion * in the result list. * - * @param node is the node which should be tested. + * @param managed is the managed which should be tested. * @param data is user-defined data passed to the filter. * @return true if the node should be included in the result set, false * otherwise. */ - using Filter = bool (*)(Handle node, void *data); + using Filter = bool (*)(Handle managed, void *data); /** * Hash functional used to convert pairs of nodes and int to hashes which @@ -510,6 +511,35 @@ public: */ bool triggerEvent(Event &event, bool fromChild = false); }; + +template +class NodeGenericList : public ManagedGenericList { +protected: + // TODO: Override addElement, deleteElement once this is necessary +public: + using ManagedGenericList::ManagedGenericList; +}; + +template +class NodeGenericMap : public ManagedGenericMap { +protected: + // TODO: Override addElement, deleteElement once this is necessary +public: + using ManagedGenericMap>>::ManagedGenericMap; +}; + +template +class NodeVector : public NodeGenericList>> { +public: + using NodeGenericList>>::NodeGenericList; +}; + +template +class NodeMap : public NodeGenericMap>> { +public: + using NodeGenericMap>>::NodeGenericMap; +}; + } #endif /* _OUSIA_NODE_HPP_ */ -- cgit v1.2.3