project: added project skeleton
Skeleton includes emtpy implementations of application class structure. Source groups were added to CMakeLists to define filters in Visual Studio.
This commit is contained in:
+6
-4
@@ -1,4 +1,6 @@
|
||||
build/
|
||||
lib/
|
||||
bin/Debug/
|
||||
bin/Release/
|
||||
/build/
|
||||
/lib/
|
||||
/bin/Debug/
|
||||
/bin/Release/
|
||||
|
||||
.DS_Store
|
||||
|
||||
+32
-24
@@ -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}
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* Generated file, do not edit */
|
||||
|
||||
#ifndef CXXTEST_RUNNING
|
||||
#define CXXTEST_RUNNING
|
||||
#endif
|
||||
|
||||
#include <cxxtest/TestListener.h>
|
||||
#include <cxxtest/TestTracker.h>
|
||||
#include <cxxtest/TestRunner.h>
|
||||
#include <cxxtest/RealDescriptions.h>
|
||||
#include <cxxtest/TestMain.h>
|
||||
#include <cxxtest/ParenPrinter.h>
|
||||
|
||||
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 <cxxtest/Root.cpp>
|
||||
const char* CxxTest::RealWorldDescription::_worldName = "cxxtest";
|
||||
@@ -1,4 +1,8 @@
|
||||
add_files(
|
||||
APP_FILES
|
||||
|
||||
qt/QtElementFactory.cpp
|
||||
qt/QtElementFactory.h
|
||||
|
||||
main.cpp
|
||||
)
|
||||
|
||||
+11
-6
@@ -1,16 +1,21 @@
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "utility.h"
|
||||
#include "Application.h"
|
||||
#include "qt/QtElementFactory.h"
|
||||
|
||||
int main(int argv, char **args)
|
||||
{
|
||||
hello();
|
||||
QApplication qtApp(argv, args);
|
||||
std::shared_ptr<GuiElementFactory> elementFactory = std::make_shared<QtElementFactory>();
|
||||
|
||||
QApplication app(argv, args);
|
||||
std::shared_ptr<Application> app = Application::create(elementFactory);
|
||||
app->loadProject();
|
||||
|
||||
QTextEdit textEdit;
|
||||
textEdit.show();
|
||||
QTextEdit textEdit;
|
||||
textEdit.show();
|
||||
|
||||
return app.exec();
|
||||
return qtApp.exec();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "qt/QtElementFactory.h"
|
||||
|
||||
QtElementFactory::QtElementFactory()
|
||||
{
|
||||
}
|
||||
|
||||
QtElementFactory::~QtElementFactory()
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "Application.h"
|
||||
|
||||
std::shared_ptr<Application> Application::create(std::shared_ptr<GuiElementFactory> guiElementFactory)
|
||||
{
|
||||
std::shared_ptr<Application> ptr(new Application());
|
||||
ptr->m_viewManager = std::make_shared<ViewManager>();
|
||||
ptr->m_codeAccess = std::make_shared<CodeAccess>();
|
||||
ptr->m_graphAccess = std::make_shared<GraphAccess>();
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<Application> create(std::shared_ptr<GuiElementFactory> guiElementFactory);
|
||||
|
||||
~Application();
|
||||
|
||||
void loadProject();
|
||||
|
||||
private:
|
||||
Application();
|
||||
|
||||
std::shared_ptr<Project> m_project;
|
||||
|
||||
std::shared_ptr<CodeAccess> m_codeAccess;
|
||||
std::shared_ptr<GraphAccess> m_graphAccess;
|
||||
|
||||
std::shared_ptr<ComponentManager> m_componentManager;
|
||||
std::shared_ptr<ViewManager> m_viewManager;
|
||||
};
|
||||
|
||||
|
||||
#endif // APPLICATION_H
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "ApplicationSettings.h"
|
||||
|
||||
std::shared_ptr<ApplicationSettings> ApplicationSettings::s_instance;
|
||||
|
||||
std::shared_ptr<ApplicationSettings> ApplicationSettings::getInstance()
|
||||
{
|
||||
if (!s_instance)
|
||||
{
|
||||
s_instance = std::shared_ptr<ApplicationSettings>(new ApplicationSettings());
|
||||
}
|
||||
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
ApplicationSettings::ApplicationSettings()
|
||||
{
|
||||
}
|
||||
|
||||
ApplicationSettings::~ApplicationSettings()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef APPLICATION_SETTINGS_H
|
||||
#define APPLICATION_SETTINGS_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
class ApplicationSettings
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<ApplicationSettings> getInstance();
|
||||
|
||||
~ApplicationSettings();
|
||||
|
||||
private:
|
||||
ApplicationSettings();
|
||||
ApplicationSettings(const ApplicationSettings&);
|
||||
void operator=(const ApplicationSettings&);
|
||||
|
||||
static std::shared_ptr<ApplicationSettings> s_instance;
|
||||
};
|
||||
|
||||
|
||||
#endif // APPLICATION_SETTINGS_H
|
||||
+66
-2
@@ -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
|
||||
)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "Project.h"
|
||||
|
||||
std::shared_ptr<Project> Project::create(
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess)
|
||||
{
|
||||
std::shared_ptr<Project> 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;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef PROJECT_H
|
||||
#define PROJECT_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<Project> create(
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess);
|
||||
|
||||
~Project();
|
||||
|
||||
const ProjectSettings& getProjectSettings() const;
|
||||
|
||||
private:
|
||||
Project();
|
||||
Project(const Project&);
|
||||
|
||||
ProjectSettings m_settings;
|
||||
|
||||
std::shared_ptr<Parser> m_parser;
|
||||
|
||||
std::shared_ptr<GraphStorage> m_graphStorage;
|
||||
|
||||
std::shared_ptr<CodeAccess> m_codeAccess;
|
||||
std::shared_ptr<GraphAccess> m_graphAccess;
|
||||
};
|
||||
|
||||
|
||||
#endif // PROJECT_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "ProjectSettings.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef PROJECT_SETTINGS_H
|
||||
#define PROJECT_SETTINGS_H
|
||||
|
||||
class ProjectSettings
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // PROJECT_SETTINGS_H
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "component/Component.h"
|
||||
|
||||
Component::Component(const std::shared_ptr<Controller>& controller, const std::shared_ptr<View>& view)
|
||||
: m_controller(controller)
|
||||
, m_view(view)
|
||||
{
|
||||
}
|
||||
|
||||
Component::~Component()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef COMPONENT_H
|
||||
#define COMPONENT_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
#include "component/view/View.h"
|
||||
|
||||
class Component
|
||||
{
|
||||
public:
|
||||
Component(const std::shared_ptr<Controller>& controller, const std::shared_ptr<View>& view);
|
||||
|
||||
~Component();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Controller> m_controller;
|
||||
std::shared_ptr<View> m_view;
|
||||
};
|
||||
|
||||
|
||||
#endif // COMPONENT_H
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "component/ComponentFactory.h"
|
||||
|
||||
std::shared_ptr<ComponentFactory> ComponentFactory::create(
|
||||
const std::shared_ptr<ViewManager>& viewManager,
|
||||
const std::shared_ptr<GuiElementFactory>& guiElementFactory,
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess)
|
||||
{
|
||||
std::shared_ptr<ComponentFactory> 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()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef COMPONENT_FACTORY_H
|
||||
#define COMPONENT_FACTORY_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<ComponentFactory> create(
|
||||
const std::shared_ptr<ViewManager>& viewManager,
|
||||
const std::shared_ptr<GuiElementFactory>& guiElementFactory,
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess);
|
||||
|
||||
~ComponentFactory();
|
||||
|
||||
private:
|
||||
ComponentFactory();
|
||||
ComponentFactory(const ComponentFactory&);
|
||||
|
||||
std::shared_ptr<ViewManager> m_viewManger;
|
||||
std::shared_ptr<GuiElementFactory> m_guiElementFactory;
|
||||
|
||||
std::shared_ptr<CodeAccess> m_codeAccess;
|
||||
std::shared_ptr<GraphAccess> m_graphAccess;
|
||||
};
|
||||
|
||||
|
||||
#endif // COMPONENT_FACTORY_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "component/ComponentManager.h"
|
||||
|
||||
std::shared_ptr<ComponentManager> ComponentManager::create(
|
||||
const std::shared_ptr<ViewManager>& viewManager,
|
||||
const std::shared_ptr<GuiElementFactory>& guiElementFactory,
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess)
|
||||
{
|
||||
std::shared_ptr<ComponentManager> ptr(new ComponentManager());
|
||||
ptr->m_componentFactory = ComponentFactory::create(viewManager, guiElementFactory, codeAccess, graphAccess);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
ComponentManager::ComponentManager()
|
||||
{
|
||||
}
|
||||
|
||||
ComponentManager::~ComponentManager()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef COMPONENT_MANAGER_H
|
||||
#define COMPONENT_MANAGER_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#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<ComponentManager> create(
|
||||
const std::shared_ptr<ViewManager>& viewManager,
|
||||
const std::shared_ptr<GuiElementFactory>& guiElementFactory,
|
||||
const std::shared_ptr<CodeAccess>& codeAccess,
|
||||
const std::shared_ptr<GraphAccess>& graphAccess);
|
||||
|
||||
~ComponentManager();
|
||||
|
||||
private:
|
||||
ComponentManager();
|
||||
ComponentManager(const ComponentManager&);
|
||||
|
||||
std::shared_ptr<ComponentFactory> m_componentFactory;
|
||||
|
||||
std::vector<std::shared_ptr<Component>> m_components;
|
||||
};
|
||||
|
||||
|
||||
#endif // COMPONENT_MANAGER_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "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
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "component/controller/Controller.h"
|
||||
|
||||
Controller::~Controller()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef CONTROLLER_H
|
||||
#define CONTROLLER_H
|
||||
|
||||
class Controller
|
||||
{
|
||||
public:
|
||||
virtual ~Controller();
|
||||
};
|
||||
|
||||
|
||||
#endif // CONTROLLER_H
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "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
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "component/view/View.h"
|
||||
|
||||
View::~View()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef VIEW_H
|
||||
#define VIEW_H
|
||||
|
||||
class View
|
||||
{
|
||||
public:
|
||||
virtual ~View();
|
||||
};
|
||||
|
||||
|
||||
#endif // VIEW_H
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "component/view/ViewManager.h"
|
||||
|
||||
ViewManager::ViewManager()
|
||||
{
|
||||
}
|
||||
|
||||
ViewManager::~ViewManager()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef VIEW_MANAGER_H
|
||||
#define VIEW_MANAGER_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "component/view/View.h"
|
||||
|
||||
class ViewManager
|
||||
{
|
||||
public:
|
||||
ViewManager();
|
||||
~ViewManager();
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<View>> m_views;
|
||||
};
|
||||
|
||||
|
||||
#endif // VIEW_MANAGER_H
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "data/Edge.h"
|
||||
|
||||
#include "data/Node.h"
|
||||
|
||||
Edge::Edge(std::weak_ptr<Node> from, std::weak_ptr<Node> to)
|
||||
: m_from(from)
|
||||
, m_to(to)
|
||||
{
|
||||
}
|
||||
|
||||
Edge::~Edge()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef EDGE_H
|
||||
#define EDGE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "data/Element.h"
|
||||
|
||||
class Node;
|
||||
|
||||
class Edge: public Element
|
||||
{
|
||||
public:
|
||||
Edge(std::weak_ptr<Node> from, std::weak_ptr<Node> to);
|
||||
~Edge();
|
||||
|
||||
private:
|
||||
const std::weak_ptr<Node> m_from;
|
||||
const std::weak_ptr<Node> m_to;
|
||||
};
|
||||
|
||||
|
||||
#endif // EDGE_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/Element.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef ELEMENT_H
|
||||
#define ELEMENT_H
|
||||
|
||||
class Element
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // ELEMENT_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/ElementIndex.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef ELEMENT_INDEX_H
|
||||
#define ELEMENT_INDEX_H
|
||||
|
||||
class ElementIndex
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // ELEMENT_INDEX_H
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "data/Graph.h"
|
||||
|
||||
Graph::Graph()
|
||||
{
|
||||
}
|
||||
|
||||
Graph::~Graph()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef GRAPH_H
|
||||
#define GRAPH_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "data/Edge.h"
|
||||
#include "data/Node.h"
|
||||
|
||||
class Graph
|
||||
{
|
||||
public:
|
||||
Graph();
|
||||
~Graph();
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Node>> m_nodes;
|
||||
std::vector<std::shared_ptr<Edge>> m_edges;
|
||||
};
|
||||
|
||||
|
||||
#endif // GRAPH_H
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "data/GraphStorage.h"
|
||||
|
||||
GraphStorage::GraphStorage()
|
||||
{
|
||||
}
|
||||
|
||||
GraphStorage::~GraphStorage()
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/Node.h"
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef NODE_H
|
||||
#define NODE_H
|
||||
|
||||
#include "data/Element.h"
|
||||
|
||||
class Node: public Element
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // NODE_H
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "data/Parser.h"
|
||||
|
||||
Parser::~Parser()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef PARSER_H
|
||||
#define PARSER_H
|
||||
|
||||
class Parser
|
||||
{
|
||||
virtual ~Parser();
|
||||
};
|
||||
|
||||
|
||||
#endif // PARSER_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/SearchIndex.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef SEARCH_INDEX_H
|
||||
#define SEARCH_INDEX_H
|
||||
|
||||
class SearchIndex
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // SEARCH_INDEX_H
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "data/TextLocation.h"
|
||||
|
||||
#include "data/Element.h"
|
||||
#include "data/TextLocationLine.h"
|
||||
|
||||
TextLocation::TextLocation(
|
||||
const std::weak_ptr<TextLocationLine>& textLocationLine,
|
||||
const std::weak_ptr<Element>& element,
|
||||
unsigned int column)
|
||||
: m_textLocationLine(textLocationLine)
|
||||
, m_element(element)
|
||||
, m_column(column)
|
||||
{
|
||||
}
|
||||
|
||||
TextLocation::~TextLocation()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef TEXT_LOCATION_H
|
||||
#define TEXT_LOCATION_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Element;
|
||||
class TextLocationLine;
|
||||
|
||||
class TextLocation
|
||||
{
|
||||
public:
|
||||
TextLocation(
|
||||
const std::weak_ptr<TextLocationLine>& textLocationLine,
|
||||
const std::weak_ptr<Element>& element,
|
||||
unsigned int column);
|
||||
|
||||
~TextLocation();
|
||||
|
||||
private:
|
||||
const unsigned int m_column;
|
||||
const std::weak_ptr<TextLocationLine> m_textLocationLine;
|
||||
const std::weak_ptr<Element> m_element;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEXT_LOCATION_H
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "data/TextLocationFile.h"
|
||||
|
||||
TextLocationFile::TextLocationFile(const std::string& filePath)
|
||||
: m_filePath(filePath)
|
||||
{
|
||||
}
|
||||
|
||||
TextLocationFile::~TextLocationFile()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef TEXT_LOCATION_FILE_H
|
||||
#define TEXT_LOCATION_FILE_H
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "data/TextLocationLine.h"
|
||||
|
||||
class TextLocationFile
|
||||
{
|
||||
public:
|
||||
TextLocationFile(const std::string& filePath);
|
||||
~TextLocationFile();
|
||||
|
||||
private:
|
||||
const std::string m_filePath;
|
||||
std::vector<std::shared_ptr<TextLocationLine>> m_textLocationLine;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEXT_LOCATION_FILE_H
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "data/TextLocationLine.h"
|
||||
|
||||
#include "data/TextLocationFile.h"
|
||||
|
||||
TextLocationLine::TextLocationLine(const std::weak_ptr<TextLocationFile>& textLocationFile, unsigned int lineNumber)
|
||||
: m_textLocationFile(textLocationFile)
|
||||
, m_lineNumber(lineNumber)
|
||||
{
|
||||
}
|
||||
|
||||
TextLocationLine::~TextLocationLine()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef TEXT_LOCATION_LINE_H
|
||||
#define TEXT_LOCATION_LINE_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "data/TextLocation.h"
|
||||
|
||||
class TextLocationFile;
|
||||
|
||||
class TextLocationLine
|
||||
{
|
||||
public:
|
||||
TextLocationLine(const std::weak_ptr<TextLocationFile>& textLocationFile, unsigned int lineNumber);
|
||||
|
||||
~TextLocationLine();
|
||||
|
||||
private:
|
||||
const std::weak_ptr<TextLocationFile> m_textLocationFile;
|
||||
const unsigned int m_lineNumber;
|
||||
|
||||
const std::vector<std::shared_ptr<TextLocation>> m_textLocations;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEXT_LOCATION_LINE_H
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "data/TextLocationStorage.h"
|
||||
|
||||
TextLocationStorage::TextLocationStorage()
|
||||
{
|
||||
}
|
||||
|
||||
TextLocationStorage::~TextLocationStorage()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef TEXT_LOCATION_STORAGE_H
|
||||
#define TEXT_LOCATION_STORAGE_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "data/TextLocationFile.h"
|
||||
|
||||
class TextLocationStorage
|
||||
{
|
||||
public:
|
||||
TextLocationStorage();
|
||||
~TextLocationStorage();
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<TextLocationFile>> m_textLocationFiles;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEXT_LOCATION_STORAGE_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/access/CodeAccess.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef CODE_ACCESS_H
|
||||
#define CODE_ACCESS_H
|
||||
|
||||
class CodeAccess
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // CODE_ACCESS_H
|
||||
@@ -0,0 +1 @@
|
||||
#include "data/access/GraphAccess.h"
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef GRAPH_ACCESS_H
|
||||
#define GRAPH_ACCESS_H
|
||||
|
||||
class GraphAccess
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // GRAPH_ACCESS_H
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "gui/GuiElement.h"
|
||||
|
||||
GuiElement::~GuiElement()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef GUI_ELEMENT_H
|
||||
#define GUI_ELEMENT_H
|
||||
|
||||
class GuiElement
|
||||
{
|
||||
public:
|
||||
virtual ~GuiElement();
|
||||
};
|
||||
|
||||
|
||||
#endif // GUI_ELEMENT_H
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "gui/GuiElementFactory.h"
|
||||
|
||||
GuiElementFactory::~GuiElementFactory()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef GUI_ELEMENT_FACTORY_H
|
||||
#define GUI_ELEMENT_FACTORY_H
|
||||
|
||||
class GuiElementFactory
|
||||
{
|
||||
public:
|
||||
virtual ~GuiElementFactory();
|
||||
};
|
||||
|
||||
|
||||
#endif // GUI_ELEMENT_FACTORY_H
|
||||
@@ -1,13 +0,0 @@
|
||||
#include "utility.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void hello()
|
||||
{
|
||||
std::cout << "hello world!" << std::endl;
|
||||
}
|
||||
|
||||
int one()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
void hello();
|
||||
|
||||
int one();
|
||||
@@ -0,0 +1 @@
|
||||
#include "utility/ConfigManager.h"
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef CONFIG_MANAGER_H
|
||||
#define CONFIG_MANAGER_H
|
||||
|
||||
|
||||
class ConfigManager
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // CONFIG_MANAGER_H
|
||||
@@ -1,12 +1,10 @@
|
||||
#include <cxxtest/TestSuite.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user