From c6aa669aac80466ea287e9a27348c1068cc1f17e Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 16 Dec 2014 02:34:36 +0100 Subject: changed paths to new location of the Managed class, adapted NodeVector and NodeMap to the slightly changed conditions in the Node class --- CMakeLists.txt | 152 +++++++++++++++++++++--------------------- src/core/CSS.hpp | 2 +- src/core/Node.hpp | 41 ++++++------ src/core/model/Domain.hpp | 2 +- src/core/model/Typesystem.hpp | 3 +- test/core/NodeTest.cpp | 2 +- 6 files changed, 99 insertions(+), 103 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af5928a..efef6d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,57 +99,57 @@ ADD_DEFINITIONS( ) ADD_LIBRARY(ousia_core -# src/core/CodeTokenizer -# src/core/CSS -# src/core/Node -# src/core/Registry -# src/core/ResourceLocator -# src/core/Tokenizer -# src/core/common/CharReader -# src/core/common/Exceptions -# src/core/common/Logger -# src/core/common/Utils -# src/core/common/Variant -# src/core/common/VariantReader + src/core/CodeTokenizer + src/core/CSS + src/core/Node + src/core/Registry + src/core/ResourceLocator + src/core/Tokenizer + src/core/common/CharReader + src/core/common/Exceptions + src/core/common/Logger + src/core/common/Utils + src/core/common/Variant + src/core/common/VariantReader src/core/managed/Managed src/core/managed/ManagedType src/core/managed/Manager # src/core/model/Domain -# src/core/model/Typesystem -# src/core/parser/Parser -# src/core/parser/ParserStack -# src/core/parser/Scope + src/core/model/Typesystem + src/core/parser/Parser + src/core/parser/ParserStack + src/core/parser/Scope # src/core/script/Function # src/core/script/Object # src/core/script/ScriptEngine # src/core/script/Variant ) -#ADD_LIBRARY(ousia_boost -# src/plugins/boost/FileLocator -#) +ADD_LIBRARY(ousia_boost + src/plugins/boost/FileLocator +) -#TARGET_LINK_LIBRARIES(ousia_boost -# ousia_core -# ${Boost_LIBRARIES} -#) +TARGET_LINK_LIBRARIES(ousia_boost + ousia_core + ${Boost_LIBRARIES} +) -#ADD_LIBRARY(ousia_css -# src/plugins/css/CSSParser -#) +ADD_LIBRARY(ousia_css + src/plugins/css/CSSParser +) -#TARGET_LINK_LIBRARIES(ousia_css -# ousia_core -#) +TARGET_LINK_LIBRARIES(ousia_css + ousia_core +) -#ADD_LIBRARY(ousia_xml -# src/plugins/xml/XmlParser -#) +ADD_LIBRARY(ousia_xml + src/plugins/xml/XmlParser +) -#TARGET_LINK_LIBRARIES(ousia_xml -# ousia_core -# ${EXPAT_LIBRARIES} -#) +TARGET_LINK_LIBRARIES(ousia_xml + ousia_core + ${EXPAT_LIBRARIES} +) #ADD_LIBRARY(ousia_mozjs # src/plugins/mozjs/MozJsScriptEngine @@ -168,22 +168,22 @@ IF(TEST) ) ADD_EXECUTABLE(ousia_test_core -# test/core/CodeTokenizerTest -# test/core/CSSTest -# test/core/NodeTest -# test/core/RangeSetTest -# test/core/RegistryTest -# test/core/ResourceLocatorTest -# test/core/TokenizerTest -# test/core/common/CharReaderTest -# test/core/common/LoggerTest -# test/core/common/VariantReaderTest -# test/core/common/VariantTest -# test/core/common/UtilsTest + test/core/CodeTokenizerTest + test/core/CSSTest + test/core/NodeTest + test/core/RangeSetTest + test/core/RegistryTest + test/core/ResourceLocatorTest + test/core/TokenizerTest + test/core/common/CharReaderTest + test/core/common/LoggerTest + test/core/common/VariantReaderTest + test/core/common/VariantTest + test/core/common/UtilsTest test/core/managed/ManagedContainerTest test/core/managed/ManagedTest test/core/managed/ManagerTest -# test/core/parser/ParserStackTest + test/core/parser/ParserStackTest # test/core/script/FunctionTest # test/core/script/ObjectTest # test/core/script/VariantTest @@ -194,35 +194,35 @@ IF(TEST) ousia_core ) -# ADD_EXECUTABLE(ousia_test_boost -# test/plugins/boost/FileLocatorTest -# ) + ADD_EXECUTABLE(ousia_test_boost + test/plugins/boost/FileLocatorTest + ) -# TARGET_LINK_LIBRARIES(ousia_test_boost -# ${GTEST_LIBRARIES} -# ousia_core -# ousia_boost -# ) + TARGET_LINK_LIBRARIES(ousia_test_boost + ${GTEST_LIBRARIES} + ousia_core + ousia_boost + ) -# ADD_EXECUTABLE(ousia_test_css -# test/plugins/css/CSSParserTest -# ) + ADD_EXECUTABLE(ousia_test_css + test/plugins/css/CSSParserTest + ) -# TARGET_LINK_LIBRARIES(ousia_test_css -# ${GTEST_LIBRARIES} -# ousia_core -# ousia_css -# ) + TARGET_LINK_LIBRARIES(ousia_test_css + ${GTEST_LIBRARIES} + ousia_core + ousia_css + ) -# ADD_EXECUTABLE(ousia_test_xml -# test/plugins/xml/XmlParserTest -# ) + ADD_EXECUTABLE(ousia_test_xml + test/plugins/xml/XmlParserTest + ) -# TARGET_LINK_LIBRARIES(ousia_test_xml -# ${GTEST_LIBRARIES} -# ousia_core -# ousia_xml -# ) + TARGET_LINK_LIBRARIES(ousia_test_xml + ${GTEST_LIBRARIES} + ousia_core + ousia_xml + ) # ADD_EXECUTABLE(ousia_test_mozjs # test/plugins/mozjs/MozJsScriptEngineTest @@ -236,9 +236,9 @@ IF(TEST) # Register the unit tests ADD_TEST(ousia_test_core ousia_test_core) -# ADD_TEST(ousia_test_boost ousia_test_boost) -# ADD_TEST(ousia_test_xml ousia_test_xml) -# ADD_TEST(ousia_test_css ousia_test_css) + ADD_TEST(ousia_test_boost ousia_test_boost) + ADD_TEST(ousia_test_xml ousia_test_xml) + ADD_TEST(ousia_test_css ousia_test_css) # ADD_TEST(ousia_test_mozjs ousia_test_mozjs) ENDIF() 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 #include +#include -#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 #include -#include "Managed.hpp" -#include "ManagedContainers.hpp" +#include +#include namespace ousia { @@ -512,33 +512,30 @@ 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; -}; +// TODO: Use a different listener here for updating name maps -template -class NodeGenericMap : public ManagedGenericMap { -protected: - // TODO: Override addElement, deleteElement once this is necessary +template >> +class NodeVector + : public ManagedGenericList>, + ListAccessor>, Listener> { public: - using ManagedGenericMap>>::ManagedGenericMap; + using Base = ManagedGenericList>, + ListAccessor>, Listener>; + using Base::ManagedGenericList; }; -template -class NodeVector : public NodeGenericList>> { +template >>> +class NodeMap + : public ManagedGenericMap>, + MapAccessor>>, Listener> { public: - using NodeGenericList>>::NodeGenericList; + using Base = + ManagedGenericMap>, + MapAccessor>>, Listener>; + using Base::ManagedGenericMap; }; -template -class NodeMap : public NodeGenericMap>> { -public: - using NodeGenericMap>>::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 +#include #include 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 #include -#include #include #include #include @@ -361,7 +360,7 @@ public: class Typesystem : public Node { private: - ManagedVector types; + NodeVector types; public: Typesystem(Manager &mgr, std::string name, Handle parent = nullptr) diff --git a/test/core/NodeTest.cpp b/test/core/NodeTest.cpp index 182dfdd..334fcc8 100644 --- a/test/core/NodeTest.cpp +++ b/test/core/NodeTest.cpp @@ -18,7 +18,7 @@ #include -#include +#include #include -- cgit v1.2.3