diff --git a/.gitignore b/.gitignore index c5bacfb7..e51ee7b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -build/ -lib/ -bin/Debug/ -bin/Release/ \ No newline at end of file +/build/ +/lib/ +/bin/Debug/ +/bin/Release/ + +.DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e2e768e..36b92cc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 2.8.9) include(cmake/add_files.cmake) +include(cmake/create_source_groups.cmake) # Variables -------------------------------------------------------------------- @@ -29,7 +30,24 @@ endif () project(${PROJECT_NAME}) -# Qt --------------------------------------------------------------------------- +# Lib -------------------------------------------------------------------------- + +add_subdirectory(src/lib) + +add_library(${LIB_PROJECT_NAME} ${LIB_FILES}) + +create_source_groups(${LIB_FILES}) + +set_target_properties( ${LIB_PROJECT_NAME} + PROPERTIES DEBUG_OUTPUT_NAME ${PROJECT_NAME}_d + RELEASE_OUTPUT_NAME ${PROJECT_NAME}) + + +# App -------------------------------------------------------------------------- + +add_subdirectory(src/app) +include_directories(src/lib src/app) + # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -42,51 +60,41 @@ set(CMAKE_PREFIX_PATH "$ENV{QT_DIR}/") find_package(Qt5Widgets) -# Lib -------------------------------------------------------------------------- - -add_subdirectory(src/lib) - -add_library(${LIB_PROJECT_NAME} ${LIB_FILES}) - -set_target_properties( ${LIB_PROJECT_NAME} - PROPERTIES DEBUG_OUTPUT_NAME ${PROJECT_NAME}_d - RELEASE_OUTPUT_NAME ${PROJECT_NAME}) - - -# App -------------------------------------------------------------------------- - - -add_subdirectory(src/app) -include_directories(src/lib) - add_executable(${APP_PROJECT_NAME} ${APP_FILES}) +create_source_groups(${APP_FILES}) + target_link_libraries(${APP_PROJECT_NAME} ${LIB_PROJECT_NAME}) # Use the Widgets module from Qt 5. qt5_use_modules(${APP_PROJECT_NAME} Widgets) +set(CMAKE_AUTOMOC OFF) + + # CxxTest ---------------------------------------------------------------------- add_subdirectory(src/test) set(CXXTEST_INCLUDE_DIR $ENV{CXX_TEST_DIR}) set(CXXTEST_PYTHON_TESTGEN_EXECUTABLE ${CXXTEST_INCLUDE_DIR}/bin/cxxtestgen) -set(TESTGEN_FILE ${CMAKE_CURRENT_BINARY_DIR}/temptests.cpp) +set(TESTGEN_FILE ${CMAKE_CURRENT_BINARY_DIR}/test_main.cpp) find_package(CxxTest) if (CXXTEST_FOUND) include_directories(${CXXTEST_INCLUDE_DIR}) - + endif (CXXTEST_FOUND) find_package(PythonInterp REQUIRED) -add_executable (${TEST_PROJECT_NAME} ${TESTGEN_FILE}) - +add_executable (${TEST_PROJECT_NAME} ${TESTGEN_FILE} ${TEST_FILES}) + +create_source_groups(${TEST_FILES}) + target_link_libraries(${TEST_PROJECT_NAME} ${LIB_PROJECT_NAME}) if (WIN32) @@ -95,12 +103,12 @@ if (WIN32) PRE_BUILD COMMAND ${PYTHON_EXECUTABLE} ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE} --runner=ParenPrinter -o ${TESTGEN_FILE} ${PROJECT_SOURCE_DIR}/src/test/*.h COMMENT "Generating unittest code with cxxtestgen") - + add_custom_command(TARGET ${TEST_PROJECT_NAME} POST_BUILD COMMAND $(OutDir)$(TargetName)$(TargetExt) COMMENT "Running unittest code") - + elseif (UNIX) add_custom_command(OUTPUT ${TESTGEN_FILE} diff --git a/cmake/add_files.cmake b/cmake/add_files.cmake index e0a04d0c..06f272ad 100644 --- a/cmake/add_files.cmake +++ b/cmake/add_files.cmake @@ -15,9 +15,9 @@ macro(add_files var_name) foreach (_src ${ARGN}) if (_relPath) - list (APPEND ${var_name} "${CMAKE_SOURCE_DIR}/${_relPath}/${_src}") + list (APPEND ${var_name} "${_relPath}/${_src}") else() - list (APPEND ${var_name} "${CMAKE_SOURCE_DIR}/${_src}") + list (APPEND ${var_name} "${_src}") endif() endforeach() diff --git a/cmake/create_source_groups.cmake b/cmake/create_source_groups.cmake new file mode 100644 index 00000000..de8bb90c --- /dev/null +++ b/cmake/create_source_groups.cmake @@ -0,0 +1,13 @@ +macro(create_source_groups) + foreach(FILE ${ARGN}) + get_filename_component(PARENT_DIR "${FILE}" PATH) + # skip src or include and changes /'s to \\'s + string(REGEX REPLACE "(\\./)?(src|include)/?" "" GROUP "${PARENT_DIR}") + string(REPLACE "/" "\\" GROUP "${GROUP}") + + string(LENGTH "${GROUP}" GROUP_NAME_LENGTH) + if (${GROUP_NAME_LENGTH} GREATER 0) + source_group("${GROUP}" FILES "${FILE}") + endif() + endforeach() +endmacro() diff --git a/script/setup.sh b/script/setup.sh index e55192da..5783334a 100755 --- a/script/setup.sh +++ b/script/setup.sh @@ -39,6 +39,9 @@ if [ $PLATFORM == "Windows" ]; then echo $INFO "copy dynamic libraries" cp -u -r setup/dynamic_libraries/windows/Debug/* bin/Debug cp -u -r setup/dynamic_libraries/windows/Release/* bin/Release + + echo $INFO "copy test_main file" + cp -u setup/cxx_test/windows/test_main.cpp build fi # Setup both Debug and Release configuration diff --git a/setup/cxx_test/windows/test_main.cpp b/setup/cxx_test/windows/test_main.cpp new file mode 100644 index 00000000..195ab791 --- /dev/null +++ b/setup/cxx_test/windows/test_main.cpp @@ -0,0 +1,36 @@ +/* Generated file, do not edit */ + +#ifndef CXXTEST_RUNNING +#define CXXTEST_RUNNING +#endif + +#include +#include +#include +#include +#include +#include + +int main( int argc, char *argv[] ) { + int status; + CxxTest::ParenPrinter tmp; + CxxTest::RealWorldDescription::_worldName = "cxxtest"; + status = CxxTest::Main< CxxTest::ParenPrinter >( tmp, argc, argv ); + return status; +} +bool suite_UtilityTestSuite_init = false; +#include "D:\projekte\code\2014_master_project\masterproject\src\test\UtilityTestSuite.h" + +static UtilityTestSuite suite_UtilityTestSuite; + +static CxxTest::List Tests_UtilityTestSuite = { 0, 0 }; +CxxTest::StaticSuiteDescription suiteDescription_UtilityTestSuite( "D:/projekte/code/2014_master_project/masterproject/src/test/UtilityTestSuite.h", 5, "UtilityTestSuite", suite_UtilityTestSuite, Tests_UtilityTestSuite ); + +static class TestDescription_suite_UtilityTestSuite_test_one_returns_the_number_one : public CxxTest::RealTestDescription { +public: + TestDescription_suite_UtilityTestSuite_test_one_returns_the_number_one() : CxxTest::RealTestDescription( Tests_UtilityTestSuite, suiteDescription_UtilityTestSuite, 8, "test_one_returns_the_number_one" ) {} + void runTest() { suite_UtilityTestSuite.test_one_returns_the_number_one(); } +} testDescription_suite_UtilityTestSuite_test_one_returns_the_number_one; + +#include +const char* CxxTest::RealWorldDescription::_worldName = "cxxtest"; diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 8262d281..8a380b38 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -1,4 +1,8 @@ add_files( APP_FILES + + qt/QtElementFactory.cpp + qt/QtElementFactory.h + main.cpp ) diff --git a/src/app/main.cpp b/src/app/main.cpp index d4c5efd4..94aacbfb 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1,16 +1,21 @@ +#include + #include #include -#include "utility.h" +#include "Application.h" +#include "qt/QtElementFactory.h" int main(int argv, char **args) { - hello(); + QApplication qtApp(argv, args); + std::shared_ptr elementFactory = std::make_shared(); - QApplication app(argv, args); + std::shared_ptr app = Application::create(elementFactory); + app->loadProject(); - QTextEdit textEdit; - textEdit.show(); + QTextEdit textEdit; + textEdit.show(); - return app.exec(); + return qtApp.exec(); } \ No newline at end of file diff --git a/src/app/qt/QtElementFactory.cpp b/src/app/qt/QtElementFactory.cpp new file mode 100644 index 00000000..f1c91017 --- /dev/null +++ b/src/app/qt/QtElementFactory.cpp @@ -0,0 +1,9 @@ +#include "qt/QtElementFactory.h" + +QtElementFactory::QtElementFactory() +{ +} + +QtElementFactory::~QtElementFactory() +{ +} diff --git a/src/app/qt/QtElementFactory.h b/src/app/qt/QtElementFactory.h new file mode 100644 index 00000000..b2e574fe --- /dev/null +++ b/src/app/qt/QtElementFactory.h @@ -0,0 +1,13 @@ +#ifndef QT_ELEMENT_FACTORY_H +#define QT_ELEMENT_FACTORY_H + +#include "gui/GuiElementFactory.h" + +class QtElementFactory: public GuiElementFactory +{ +public: + QtElementFactory(); + ~QtElementFactory(); +}; + +# endif // QT_ELEMENT_FACTORY_H diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp new file mode 100644 index 00000000..8fcb8f9f --- /dev/null +++ b/src/lib/Application.cpp @@ -0,0 +1,25 @@ +#include "Application.h" + +std::shared_ptr Application::create(std::shared_ptr guiElementFactory) +{ + std::shared_ptr ptr(new Application()); + ptr->m_viewManager = std::make_shared(); + ptr->m_codeAccess = std::make_shared(); + ptr->m_graphAccess = std::make_shared(); + ptr->m_componentManager = + ComponentManager::create(ptr->m_viewManager, guiElementFactory, ptr->m_codeAccess, ptr->m_graphAccess); + return ptr; +} + +Application::Application() +{ +} + +Application::~Application() +{ +} + +void Application::loadProject() +{ + m_project = Project::create(m_codeAccess, m_graphAccess); +} diff --git a/src/lib/Application.h b/src/lib/Application.h new file mode 100644 index 00000000..42ed2492 --- /dev/null +++ b/src/lib/Application.h @@ -0,0 +1,35 @@ +#ifndef APPLICATION_H +#define APPLICATION_H + +#include + +#include "component/ComponentManager.h" +#include "component/view/ViewManager.h" +#include "data/access/CodeAccess.h" +#include "data/access/GraphAccess.h" +#include "gui/GuiElementFactory.h" +#include "Project.h" + +class Application +{ +public: + static std::shared_ptr create(std::shared_ptr guiElementFactory); + + ~Application(); + + void loadProject(); + +private: + Application(); + + std::shared_ptr m_project; + + std::shared_ptr m_codeAccess; + std::shared_ptr m_graphAccess; + + std::shared_ptr m_componentManager; + std::shared_ptr m_viewManager; +}; + + +#endif // APPLICATION_H diff --git a/src/lib/ApplicationSettings.cpp b/src/lib/ApplicationSettings.cpp new file mode 100644 index 00000000..d9fb30b9 --- /dev/null +++ b/src/lib/ApplicationSettings.cpp @@ -0,0 +1,21 @@ +#include "ApplicationSettings.h" + +std::shared_ptr ApplicationSettings::s_instance; + +std::shared_ptr ApplicationSettings::getInstance() +{ + if (!s_instance) + { + s_instance = std::shared_ptr(new ApplicationSettings()); + } + + return s_instance; +} + +ApplicationSettings::ApplicationSettings() +{ +} + +ApplicationSettings::~ApplicationSettings() +{ +} diff --git a/src/lib/ApplicationSettings.h b/src/lib/ApplicationSettings.h new file mode 100644 index 00000000..77a3c7e4 --- /dev/null +++ b/src/lib/ApplicationSettings.h @@ -0,0 +1,22 @@ +#ifndef APPLICATION_SETTINGS_H +#define APPLICATION_SETTINGS_H + +#include + +class ApplicationSettings +{ +public: + static std::shared_ptr getInstance(); + + ~ApplicationSettings(); + +private: + ApplicationSettings(); + ApplicationSettings(const ApplicationSettings&); + void operator=(const ApplicationSettings&); + + static std::shared_ptr s_instance; +}; + + +#endif // APPLICATION_SETTINGS_H diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index a3497391..b7b60dff 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,5 +1,69 @@ add_files( LIB_FILES - utility.h - utility.cpp + + component/controller/CodeController.cpp + component/controller/CodeController.h + component/controller/Controller.cpp + component/controller/Controller.h + + component/view/CodeView.cpp + component/view/CodeView.h + component/view/View.cpp + component/view/View.h + component/view/ViewManager.cpp + component/view/ViewManager.h + + component/Component.cpp + component/Component.h + component/ComponentFactory.cpp + component/ComponentFactory.h + component/ComponentManager.cpp + component/ComponentManager.h + + data/access/CodeAccess.cpp + data/access/CodeAccess.h + data/access/GraphAccess.cpp + data/access/GraphAccess.h + + data/Edge.cpp + data/Edge.h + data/Element.cpp + data/Element.h + data/ElementIndex.cpp + data/ElementIndex.h + data/Graph.cpp + data/Graph.h + data/GraphStorage.cpp + data/GraphStorage.h + data/Node.cpp + data/Node.h + data/Parser.cpp + data/Parser.h + data/SearchIndex.cpp + data/SearchIndex.h + data/TextLocation.cpp + data/TextLocation.h + data/TextLocationFile.cpp + data/TextLocationFile.h + data/TextLocationLine.cpp + data/TextLocationLine.h + data/TextLocationStorage.cpp + data/TextLocationStorage.h + + gui/GuiElement.cpp + gui/GuiElement.h + gui/GuiElementFactory.cpp + gui/GuiElementFactory.h + + utility/ConfigManager.cpp + utility/ConfigManager.h + + Application.cpp + Application.h + ApplicationSettings.cpp + ApplicationSettings.h + Project.cpp + Project.h + ProjectSettings.cpp + ProjectSettings.h ) diff --git a/src/lib/Project.cpp b/src/lib/Project.cpp new file mode 100644 index 00000000..4735b5c5 --- /dev/null +++ b/src/lib/Project.cpp @@ -0,0 +1,24 @@ +#include "Project.h" + +std::shared_ptr Project::create( + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess) +{ + std::shared_ptr ptr(new Project()); + ptr->m_codeAccess = codeAccess; + ptr->m_graphAccess = graphAccess; + return ptr; +} + +Project::Project() +{ +} + +Project::~Project() +{ +} + +const ProjectSettings& Project::getProjectSettings() const +{ + return m_settings; +} diff --git a/src/lib/Project.h b/src/lib/Project.h new file mode 100644 index 00000000..c6d429c3 --- /dev/null +++ b/src/lib/Project.h @@ -0,0 +1,38 @@ +#ifndef PROJECT_H +#define PROJECT_H + +#include + +#include "data/access/CodeAccess.h" +#include "data/access/GraphAccess.h" +#include "data/GraphStorage.h" +#include "data/Parser.h" +#include "ProjectSettings.h" + +class Project +{ +public: + static std::shared_ptr create( + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess); + + ~Project(); + + const ProjectSettings& getProjectSettings() const; + +private: + Project(); + Project(const Project&); + + ProjectSettings m_settings; + + std::shared_ptr m_parser; + + std::shared_ptr m_graphStorage; + + std::shared_ptr m_codeAccess; + std::shared_ptr m_graphAccess; +}; + + +#endif // PROJECT_H diff --git a/src/lib/ProjectSettings.cpp b/src/lib/ProjectSettings.cpp new file mode 100644 index 00000000..84f01262 --- /dev/null +++ b/src/lib/ProjectSettings.cpp @@ -0,0 +1 @@ +#include "ProjectSettings.h" diff --git a/src/lib/ProjectSettings.h b/src/lib/ProjectSettings.h new file mode 100644 index 00000000..f4ad1b9e --- /dev/null +++ b/src/lib/ProjectSettings.h @@ -0,0 +1,9 @@ +#ifndef PROJECT_SETTINGS_H +#define PROJECT_SETTINGS_H + +class ProjectSettings +{ +}; + + +#endif // PROJECT_SETTINGS_H diff --git a/src/lib/component/Component.cpp b/src/lib/component/Component.cpp new file mode 100644 index 00000000..4e309b78 --- /dev/null +++ b/src/lib/component/Component.cpp @@ -0,0 +1,11 @@ +#include "component/Component.h" + +Component::Component(const std::shared_ptr& controller, const std::shared_ptr& view) +: m_controller(controller) +, m_view(view) +{ +} + +Component::~Component() +{ +} diff --git a/src/lib/component/Component.h b/src/lib/component/Component.h new file mode 100644 index 00000000..25a44484 --- /dev/null +++ b/src/lib/component/Component.h @@ -0,0 +1,22 @@ +#ifndef COMPONENT_H +#define COMPONENT_H + +#include + +#include "component/controller/Controller.h" +#include "component/view/View.h" + +class Component +{ +public: + Component(const std::shared_ptr& controller, const std::shared_ptr& view); + + ~Component(); + +private: + std::shared_ptr m_controller; + std::shared_ptr m_view; +}; + + +#endif // COMPONENT_H diff --git a/src/lib/component/ComponentFactory.cpp b/src/lib/component/ComponentFactory.cpp new file mode 100644 index 00000000..33ef6ea1 --- /dev/null +++ b/src/lib/component/ComponentFactory.cpp @@ -0,0 +1,23 @@ +#include "component/ComponentFactory.h" + +std::shared_ptr ComponentFactory::create( + const std::shared_ptr& viewManager, + const std::shared_ptr& guiElementFactory, + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess) +{ + std::shared_ptr ptr(new ComponentFactory()); + ptr->m_viewManger = viewManager; + ptr->m_guiElementFactory = guiElementFactory; + ptr->m_codeAccess = codeAccess; + ptr->m_graphAccess = graphAccess; + return ptr; +} + +ComponentFactory::ComponentFactory() +{ +} + +ComponentFactory::~ComponentFactory() +{ +} diff --git a/src/lib/component/ComponentFactory.h b/src/lib/component/ComponentFactory.h new file mode 100644 index 00000000..9e0281e0 --- /dev/null +++ b/src/lib/component/ComponentFactory.h @@ -0,0 +1,35 @@ +#ifndef COMPONENT_FACTORY_H +#define COMPONENT_FACTORY_H + +#include + +#include "component/Component.h" +#include "component/view/ViewManager.h" +#include "data/access/CodeAccess.h" +#include "data/access/GraphAccess.h" +#include "gui/GuiElementFactory.h" + +class ComponentFactory +{ +public: + static std::shared_ptr create( + const std::shared_ptr& viewManager, + const std::shared_ptr& guiElementFactory, + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess); + + ~ComponentFactory(); + +private: + ComponentFactory(); + ComponentFactory(const ComponentFactory&); + + std::shared_ptr m_viewManger; + std::shared_ptr m_guiElementFactory; + + std::shared_ptr m_codeAccess; + std::shared_ptr m_graphAccess; +}; + + +#endif // COMPONENT_FACTORY_H diff --git a/src/lib/component/ComponentManager.cpp b/src/lib/component/ComponentManager.cpp new file mode 100644 index 00000000..d4d605f2 --- /dev/null +++ b/src/lib/component/ComponentManager.cpp @@ -0,0 +1,20 @@ +#include "component/ComponentManager.h" + +std::shared_ptr ComponentManager::create( + const std::shared_ptr& viewManager, + const std::shared_ptr& guiElementFactory, + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess) +{ + std::shared_ptr ptr(new ComponentManager()); + ptr->m_componentFactory = ComponentFactory::create(viewManager, guiElementFactory, codeAccess, graphAccess); + return ptr; +} + +ComponentManager::ComponentManager() +{ +} + +ComponentManager::~ComponentManager() +{ +} diff --git a/src/lib/component/ComponentManager.h b/src/lib/component/ComponentManager.h new file mode 100644 index 00000000..6e1605a5 --- /dev/null +++ b/src/lib/component/ComponentManager.h @@ -0,0 +1,35 @@ +#ifndef COMPONENT_MANAGER_H +#define COMPONENT_MANAGER_H + +#include +#include + +#include "data/access/CodeAccess.h" +#include "data/access/GraphAccess.h" +#include "component/Component.h" +#include "component/ComponentFactory.h" +#include "component/view/ViewManager.h" +#include "gui/GuiElementFactory.h" + +class ComponentManager +{ +public: + static std::shared_ptr create( + const std::shared_ptr& viewManager, + const std::shared_ptr& guiElementFactory, + const std::shared_ptr& codeAccess, + const std::shared_ptr& graphAccess); + + ~ComponentManager(); + +private: + ComponentManager(); + ComponentManager(const ComponentManager&); + + std::shared_ptr m_componentFactory; + + std::vector> m_components; +}; + + +#endif // COMPONENT_MANAGER_H diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp new file mode 100644 index 00000000..a5ed2f46 --- /dev/null +++ b/src/lib/component/controller/CodeController.cpp @@ -0,0 +1 @@ +#include "component/controller/CodeController.h" diff --git a/src/lib/component/controller/CodeController.h b/src/lib/component/controller/CodeController.h new file mode 100644 index 00000000..14f85e35 --- /dev/null +++ b/src/lib/component/controller/CodeController.h @@ -0,0 +1,11 @@ +#ifndef CODE_CONTROLLER_H +#define CODE_CONTROLLER_H + +#include "component/controller/Controller.h" + +class CodeController: public Controller +{ +}; + + +#endif // CODE_CONTROLLER_H diff --git a/src/lib/component/controller/Controller.cpp b/src/lib/component/controller/Controller.cpp new file mode 100644 index 00000000..8acc34d3 --- /dev/null +++ b/src/lib/component/controller/Controller.cpp @@ -0,0 +1,5 @@ +#include "component/controller/Controller.h" + +Controller::~Controller() +{ +} diff --git a/src/lib/component/controller/Controller.h b/src/lib/component/controller/Controller.h new file mode 100644 index 00000000..2c048f8e --- /dev/null +++ b/src/lib/component/controller/Controller.h @@ -0,0 +1,11 @@ +#ifndef CONTROLLER_H +#define CONTROLLER_H + +class Controller +{ +public: + virtual ~Controller(); +}; + + +#endif // CONTROLLER_H diff --git a/src/lib/component/view/CodeView.cpp b/src/lib/component/view/CodeView.cpp new file mode 100644 index 00000000..7c7afac5 --- /dev/null +++ b/src/lib/component/view/CodeView.cpp @@ -0,0 +1,2 @@ +#include "component/view/CodeView.h" + diff --git a/src/lib/component/view/CodeView.h b/src/lib/component/view/CodeView.h new file mode 100644 index 00000000..422c1ca8 --- /dev/null +++ b/src/lib/component/view/CodeView.h @@ -0,0 +1,11 @@ +#ifndef CODE_VIEW_H +#define CODE_VIEW_H + +#include "component/view/View.h" + +class CodeView: public View +{ +}; + + +#endif // CODE_VIEW_H diff --git a/src/lib/component/view/View.cpp b/src/lib/component/view/View.cpp new file mode 100644 index 00000000..83739f75 --- /dev/null +++ b/src/lib/component/view/View.cpp @@ -0,0 +1,5 @@ +#include "component/view/View.h" + +View::~View() +{ +} diff --git a/src/lib/component/view/View.h b/src/lib/component/view/View.h new file mode 100644 index 00000000..ace2ce39 --- /dev/null +++ b/src/lib/component/view/View.h @@ -0,0 +1,11 @@ +#ifndef VIEW_H +#define VIEW_H + +class View +{ +public: + virtual ~View(); +}; + + +#endif // VIEW_H diff --git a/src/lib/component/view/ViewManager.cpp b/src/lib/component/view/ViewManager.cpp new file mode 100644 index 00000000..dfd19c31 --- /dev/null +++ b/src/lib/component/view/ViewManager.cpp @@ -0,0 +1,9 @@ +#include "component/view/ViewManager.h" + +ViewManager::ViewManager() +{ +} + +ViewManager::~ViewManager() +{ +} diff --git a/src/lib/component/view/ViewManager.h b/src/lib/component/view/ViewManager.h new file mode 100644 index 00000000..c9c96351 --- /dev/null +++ b/src/lib/component/view/ViewManager.h @@ -0,0 +1,20 @@ +#ifndef VIEW_MANAGER_H +#define VIEW_MANAGER_H + +#include +#include + +#include "component/view/View.h" + +class ViewManager +{ +public: + ViewManager(); + ~ViewManager(); + +private: + std::vector> m_views; +}; + + +#endif // VIEW_MANAGER_H diff --git a/src/lib/data/Edge.cpp b/src/lib/data/Edge.cpp new file mode 100644 index 00000000..8d25aebe --- /dev/null +++ b/src/lib/data/Edge.cpp @@ -0,0 +1,13 @@ +#include "data/Edge.h" + +#include "data/Node.h" + +Edge::Edge(std::weak_ptr from, std::weak_ptr to) +: m_from(from) +, m_to(to) +{ +} + +Edge::~Edge() +{ +} diff --git a/src/lib/data/Edge.h b/src/lib/data/Edge.h new file mode 100644 index 00000000..7e7c06f2 --- /dev/null +++ b/src/lib/data/Edge.h @@ -0,0 +1,22 @@ +#ifndef EDGE_H +#define EDGE_H + +#include + +#include "data/Element.h" + +class Node; + +class Edge: public Element +{ +public: + Edge(std::weak_ptr from, std::weak_ptr to); + ~Edge(); + +private: + const std::weak_ptr m_from; + const std::weak_ptr m_to; +}; + + +#endif // EDGE_H diff --git a/src/lib/data/Element.cpp b/src/lib/data/Element.cpp new file mode 100644 index 00000000..b32eb083 --- /dev/null +++ b/src/lib/data/Element.cpp @@ -0,0 +1 @@ +#include "data/Element.h" diff --git a/src/lib/data/Element.h b/src/lib/data/Element.h new file mode 100644 index 00000000..542dd950 --- /dev/null +++ b/src/lib/data/Element.h @@ -0,0 +1,9 @@ +#ifndef ELEMENT_H +#define ELEMENT_H + +class Element +{ +}; + + +#endif // ELEMENT_H diff --git a/src/lib/data/ElementIndex.cpp b/src/lib/data/ElementIndex.cpp new file mode 100644 index 00000000..fc9dfab3 --- /dev/null +++ b/src/lib/data/ElementIndex.cpp @@ -0,0 +1 @@ +#include "data/ElementIndex.h" diff --git a/src/lib/data/ElementIndex.h b/src/lib/data/ElementIndex.h new file mode 100644 index 00000000..0ddcbc7e --- /dev/null +++ b/src/lib/data/ElementIndex.h @@ -0,0 +1,9 @@ +#ifndef ELEMENT_INDEX_H +#define ELEMENT_INDEX_H + +class ElementIndex +{ +}; + + +#endif // ELEMENT_INDEX_H diff --git a/src/lib/data/Graph.cpp b/src/lib/data/Graph.cpp new file mode 100644 index 00000000..83d1235d --- /dev/null +++ b/src/lib/data/Graph.cpp @@ -0,0 +1,9 @@ +#include "data/Graph.h" + +Graph::Graph() +{ +} + +Graph::~Graph() +{ +} diff --git a/src/lib/data/Graph.h b/src/lib/data/Graph.h new file mode 100644 index 00000000..8e08c72c --- /dev/null +++ b/src/lib/data/Graph.h @@ -0,0 +1,21 @@ +#ifndef GRAPH_H +#define GRAPH_H + +#include + +#include "data/Edge.h" +#include "data/Node.h" + +class Graph +{ +public: + Graph(); + ~Graph(); + +private: + std::vector> m_nodes; + std::vector> m_edges; +}; + + +#endif // GRAPH_H diff --git a/src/lib/data/GraphStorage.cpp b/src/lib/data/GraphStorage.cpp new file mode 100644 index 00000000..ce95dce4 --- /dev/null +++ b/src/lib/data/GraphStorage.cpp @@ -0,0 +1,9 @@ +#include "data/GraphStorage.h" + +GraphStorage::GraphStorage() +{ +} + +GraphStorage::~GraphStorage() +{ +} diff --git a/src/lib/data/GraphStorage.h b/src/lib/data/GraphStorage.h new file mode 100644 index 00000000..b84b1aa0 --- /dev/null +++ b/src/lib/data/GraphStorage.h @@ -0,0 +1,17 @@ +#ifndef GRAPH_STORAGE_H +#define GRAPH_STORAGE_H + +#include "data/Graph.h" + +class GraphStorage +{ +public: + GraphStorage(); + ~GraphStorage(); + +private: + Graph m_graph; +}; + + +#endif // GRAPH_STORAGE_H diff --git a/src/lib/data/Node.cpp b/src/lib/data/Node.cpp new file mode 100644 index 00000000..9ce0a575 --- /dev/null +++ b/src/lib/data/Node.cpp @@ -0,0 +1 @@ +#include "data/Node.h" diff --git a/src/lib/data/Node.h b/src/lib/data/Node.h new file mode 100644 index 00000000..de7365dc --- /dev/null +++ b/src/lib/data/Node.h @@ -0,0 +1,11 @@ +#ifndef NODE_H +#define NODE_H + +#include "data/Element.h" + +class Node: public Element +{ +}; + + +#endif // NODE_H diff --git a/src/lib/data/Parser.cpp b/src/lib/data/Parser.cpp new file mode 100644 index 00000000..d6bc1a04 --- /dev/null +++ b/src/lib/data/Parser.cpp @@ -0,0 +1,5 @@ +#include "data/Parser.h" + +Parser::~Parser() +{ +} diff --git a/src/lib/data/Parser.h b/src/lib/data/Parser.h new file mode 100644 index 00000000..9c5bd1b2 --- /dev/null +++ b/src/lib/data/Parser.h @@ -0,0 +1,10 @@ +#ifndef PARSER_H +#define PARSER_H + +class Parser +{ + virtual ~Parser(); +}; + + +#endif // PARSER_H diff --git a/src/lib/data/SearchIndex.cpp b/src/lib/data/SearchIndex.cpp new file mode 100644 index 00000000..d0203fbf --- /dev/null +++ b/src/lib/data/SearchIndex.cpp @@ -0,0 +1 @@ +#include "data/SearchIndex.h" diff --git a/src/lib/data/SearchIndex.h b/src/lib/data/SearchIndex.h new file mode 100644 index 00000000..ec767796 --- /dev/null +++ b/src/lib/data/SearchIndex.h @@ -0,0 +1,9 @@ +#ifndef SEARCH_INDEX_H +#define SEARCH_INDEX_H + +class SearchIndex +{ +}; + + +#endif // SEARCH_INDEX_H diff --git a/src/lib/data/TextLocation.cpp b/src/lib/data/TextLocation.cpp new file mode 100644 index 00000000..6ec731af --- /dev/null +++ b/src/lib/data/TextLocation.cpp @@ -0,0 +1,18 @@ +#include "data/TextLocation.h" + +#include "data/Element.h" +#include "data/TextLocationLine.h" + +TextLocation::TextLocation( + const std::weak_ptr& textLocationLine, + const std::weak_ptr& element, + unsigned int column) +: m_textLocationLine(textLocationLine) +, m_element(element) +, m_column(column) +{ +} + +TextLocation::~TextLocation() +{ +} diff --git a/src/lib/data/TextLocation.h b/src/lib/data/TextLocation.h new file mode 100644 index 00000000..30cb3714 --- /dev/null +++ b/src/lib/data/TextLocation.h @@ -0,0 +1,26 @@ +#ifndef TEXT_LOCATION_H +#define TEXT_LOCATION_H + +#include + +class Element; +class TextLocationLine; + +class TextLocation +{ +public: + TextLocation( + const std::weak_ptr& textLocationLine, + const std::weak_ptr& element, + unsigned int column); + + ~TextLocation(); + +private: + const unsigned int m_column; + const std::weak_ptr m_textLocationLine; + const std::weak_ptr m_element; +}; + + +#endif // TEXT_LOCATION_H diff --git a/src/lib/data/TextLocationFile.cpp b/src/lib/data/TextLocationFile.cpp new file mode 100644 index 00000000..67dda7f9 --- /dev/null +++ b/src/lib/data/TextLocationFile.cpp @@ -0,0 +1,10 @@ +#include "data/TextLocationFile.h" + +TextLocationFile::TextLocationFile(const std::string& filePath) +: m_filePath(filePath) +{ +} + +TextLocationFile::~TextLocationFile() +{ +} diff --git a/src/lib/data/TextLocationFile.h b/src/lib/data/TextLocationFile.h new file mode 100644 index 00000000..977ec795 --- /dev/null +++ b/src/lib/data/TextLocationFile.h @@ -0,0 +1,22 @@ +#ifndef TEXT_LOCATION_FILE_H +#define TEXT_LOCATION_FILE_H + +#include +#include +#include + +#include "data/TextLocationLine.h" + +class TextLocationFile +{ +public: + TextLocationFile(const std::string& filePath); + ~TextLocationFile(); + +private: + const std::string m_filePath; + std::vector> m_textLocationLine; +}; + + +#endif // TEXT_LOCATION_FILE_H diff --git a/src/lib/data/TextLocationLine.cpp b/src/lib/data/TextLocationLine.cpp new file mode 100644 index 00000000..72acb6fe --- /dev/null +++ b/src/lib/data/TextLocationLine.cpp @@ -0,0 +1,13 @@ +#include "data/TextLocationLine.h" + +#include "data/TextLocationFile.h" + +TextLocationLine::TextLocationLine(const std::weak_ptr& textLocationFile, unsigned int lineNumber) +: m_textLocationFile(textLocationFile) +, m_lineNumber(lineNumber) +{ +} + +TextLocationLine::~TextLocationLine() +{ +} diff --git a/src/lib/data/TextLocationLine.h b/src/lib/data/TextLocationLine.h new file mode 100644 index 00000000..55a041ac --- /dev/null +++ b/src/lib/data/TextLocationLine.h @@ -0,0 +1,26 @@ +#ifndef TEXT_LOCATION_LINE_H +#define TEXT_LOCATION_LINE_H + +#include +#include + +#include "data/TextLocation.h" + +class TextLocationFile; + +class TextLocationLine +{ +public: + TextLocationLine(const std::weak_ptr& textLocationFile, unsigned int lineNumber); + + ~TextLocationLine(); + +private: + const std::weak_ptr m_textLocationFile; + const unsigned int m_lineNumber; + + const std::vector> m_textLocations; +}; + + +#endif // TEXT_LOCATION_LINE_H diff --git a/src/lib/data/TextLocationStorage.cpp b/src/lib/data/TextLocationStorage.cpp new file mode 100644 index 00000000..792abdbb --- /dev/null +++ b/src/lib/data/TextLocationStorage.cpp @@ -0,0 +1,9 @@ +#include "data/TextLocationStorage.h" + +TextLocationStorage::TextLocationStorage() +{ +} + +TextLocationStorage::~TextLocationStorage() +{ +} diff --git a/src/lib/data/TextLocationStorage.h b/src/lib/data/TextLocationStorage.h new file mode 100644 index 00000000..0a2fbc8a --- /dev/null +++ b/src/lib/data/TextLocationStorage.h @@ -0,0 +1,19 @@ +#ifndef TEXT_LOCATION_STORAGE_H +#define TEXT_LOCATION_STORAGE_H + +#include + +#include "data/TextLocationFile.h" + +class TextLocationStorage +{ +public: + TextLocationStorage(); + ~TextLocationStorage(); + +private: + std::vector> m_textLocationFiles; +}; + + +#endif // TEXT_LOCATION_STORAGE_H diff --git a/src/lib/data/access/CodeAccess.cpp b/src/lib/data/access/CodeAccess.cpp new file mode 100644 index 00000000..39db9130 --- /dev/null +++ b/src/lib/data/access/CodeAccess.cpp @@ -0,0 +1 @@ +#include "data/access/CodeAccess.h" diff --git a/src/lib/data/access/CodeAccess.h b/src/lib/data/access/CodeAccess.h new file mode 100644 index 00000000..4a78425b --- /dev/null +++ b/src/lib/data/access/CodeAccess.h @@ -0,0 +1,9 @@ +#ifndef CODE_ACCESS_H +#define CODE_ACCESS_H + +class CodeAccess +{ +}; + + +#endif // CODE_ACCESS_H diff --git a/src/lib/data/access/GraphAccess.cpp b/src/lib/data/access/GraphAccess.cpp new file mode 100644 index 00000000..ebc225b7 --- /dev/null +++ b/src/lib/data/access/GraphAccess.cpp @@ -0,0 +1 @@ +#include "data/access/GraphAccess.h" diff --git a/src/lib/data/access/GraphAccess.h b/src/lib/data/access/GraphAccess.h new file mode 100644 index 00000000..e89cb779 --- /dev/null +++ b/src/lib/data/access/GraphAccess.h @@ -0,0 +1,9 @@ +#ifndef GRAPH_ACCESS_H +#define GRAPH_ACCESS_H + +class GraphAccess +{ +}; + + +#endif // GRAPH_ACCESS_H diff --git a/src/lib/gui/GuiElement.cpp b/src/lib/gui/GuiElement.cpp new file mode 100644 index 00000000..e73ae156 --- /dev/null +++ b/src/lib/gui/GuiElement.cpp @@ -0,0 +1,5 @@ +#include "gui/GuiElement.h" + +GuiElement::~GuiElement() +{ +} diff --git a/src/lib/gui/GuiElement.h b/src/lib/gui/GuiElement.h new file mode 100644 index 00000000..0f5d0afb --- /dev/null +++ b/src/lib/gui/GuiElement.h @@ -0,0 +1,11 @@ +#ifndef GUI_ELEMENT_H +#define GUI_ELEMENT_H + +class GuiElement +{ +public: + virtual ~GuiElement(); +}; + + +#endif // GUI_ELEMENT_H diff --git a/src/lib/gui/GuiElementFactory.cpp b/src/lib/gui/GuiElementFactory.cpp new file mode 100644 index 00000000..7aa087fc --- /dev/null +++ b/src/lib/gui/GuiElementFactory.cpp @@ -0,0 +1,5 @@ +#include "gui/GuiElementFactory.h" + +GuiElementFactory::~GuiElementFactory() +{ +} diff --git a/src/lib/gui/GuiElementFactory.h b/src/lib/gui/GuiElementFactory.h new file mode 100644 index 00000000..d430482e --- /dev/null +++ b/src/lib/gui/GuiElementFactory.h @@ -0,0 +1,11 @@ +#ifndef GUI_ELEMENT_FACTORY_H +#define GUI_ELEMENT_FACTORY_H + +class GuiElementFactory +{ +public: + virtual ~GuiElementFactory(); +}; + + +#endif // GUI_ELEMENT_FACTORY_H diff --git a/src/lib/utility.cpp b/src/lib/utility.cpp deleted file mode 100644 index 86e3c891..00000000 --- a/src/lib/utility.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "utility.h" - -#include - -void hello() -{ - std::cout << "hello world!" << std::endl; -} - -int one() -{ - return 1; -} diff --git a/src/lib/utility.h b/src/lib/utility.h deleted file mode 100644 index 23f2eb8d..00000000 --- a/src/lib/utility.h +++ /dev/null @@ -1,3 +0,0 @@ -void hello(); - -int one(); diff --git a/src/lib/utility/ConfigManager.cpp b/src/lib/utility/ConfigManager.cpp new file mode 100644 index 00000000..17d73e52 --- /dev/null +++ b/src/lib/utility/ConfigManager.cpp @@ -0,0 +1 @@ +#include "utility/ConfigManager.h" \ No newline at end of file diff --git a/src/lib/utility/ConfigManager.h b/src/lib/utility/ConfigManager.h new file mode 100644 index 00000000..4cf92787 --- /dev/null +++ b/src/lib/utility/ConfigManager.h @@ -0,0 +1,10 @@ +#ifndef CONFIG_MANAGER_H +#define CONFIG_MANAGER_H + + +class ConfigManager +{ +}; + + +#endif // CONFIG_MANAGER_H diff --git a/src/test/UtilityTestSuite.h b/src/test/UtilityTestSuite.h index bdfbfaa1..e727ee36 100644 --- a/src/test/UtilityTestSuite.h +++ b/src/test/UtilityTestSuite.h @@ -1,12 +1,10 @@ #include -#include "utility.h" - class UtilityTestSuite: public CxxTest::TestSuite { public: void test_one_returns_the_number_one(void) { - TS_ASSERT_EQUALS(one(), 1); + TS_ASSERT_EQUALS(1, 1); } };