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:
Eberhard Graether
2014-03-31 17:59:52 +02:00
parent b5f91e62fa
commit d4e3433e5d
72 changed files with 957 additions and 57 deletions
+25
View File
@@ -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);
}
+35
View File
@@ -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
+21
View File
@@ -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()
{
}
+22
View File
@@ -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
View File
@@ -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
)
+24
View File
@@ -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;
}
+38
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
#include "ProjectSettings.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef PROJECT_SETTINGS_H
#define PROJECT_SETTINGS_H
class ProjectSettings
{
};
#endif // PROJECT_SETTINGS_H
+11
View File
@@ -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()
{
}
+22
View File
@@ -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
+23
View File
@@ -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()
{
}
+35
View File
@@ -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
+20
View File
@@ -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()
{
}
+35
View File
@@ -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()
{
}
+11
View File
@@ -0,0 +1,11 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
class Controller
{
public:
virtual ~Controller();
};
#endif // CONTROLLER_H
+2
View File
@@ -0,0 +1,2 @@
#include "component/view/CodeView.h"
+11
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
#include "component/view/View.h"
View::~View()
{
}
+11
View File
@@ -0,0 +1,11 @@
#ifndef VIEW_H
#define VIEW_H
class View
{
public:
virtual ~View();
};
#endif // VIEW_H
+9
View File
@@ -0,0 +1,9 @@
#include "component/view/ViewManager.h"
ViewManager::ViewManager()
{
}
ViewManager::~ViewManager()
{
}
+20
View File
@@ -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
+13
View File
@@ -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()
{
}
+22
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
#include "data/Element.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef ELEMENT_H
#define ELEMENT_H
class Element
{
};
#endif // ELEMENT_H
+1
View File
@@ -0,0 +1 @@
#include "data/ElementIndex.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef ELEMENT_INDEX_H
#define ELEMENT_INDEX_H
class ElementIndex
{
};
#endif // ELEMENT_INDEX_H
+9
View File
@@ -0,0 +1,9 @@
#include "data/Graph.h"
Graph::Graph()
{
}
Graph::~Graph()
{
}
+21
View File
@@ -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
+9
View File
@@ -0,0 +1,9 @@
#include "data/GraphStorage.h"
GraphStorage::GraphStorage()
{
}
GraphStorage::~GraphStorage()
{
}
+17
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
#include "data/Node.h"
+11
View File
@@ -0,0 +1,11 @@
#ifndef NODE_H
#define NODE_H
#include "data/Element.h"
class Node: public Element
{
};
#endif // NODE_H
+5
View File
@@ -0,0 +1,5 @@
#include "data/Parser.h"
Parser::~Parser()
{
}
+10
View File
@@ -0,0 +1,10 @@
#ifndef PARSER_H
#define PARSER_H
class Parser
{
virtual ~Parser();
};
#endif // PARSER_H
+1
View File
@@ -0,0 +1 @@
#include "data/SearchIndex.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef SEARCH_INDEX_H
#define SEARCH_INDEX_H
class SearchIndex
{
};
#endif // SEARCH_INDEX_H
+18
View File
@@ -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()
{
}
+26
View File
@@ -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
+10
View File
@@ -0,0 +1,10 @@
#include "data/TextLocationFile.h"
TextLocationFile::TextLocationFile(const std::string& filePath)
: m_filePath(filePath)
{
}
TextLocationFile::~TextLocationFile()
{
}
+22
View File
@@ -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
+13
View File
@@ -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()
{
}
+26
View File
@@ -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
+9
View File
@@ -0,0 +1,9 @@
#include "data/TextLocationStorage.h"
TextLocationStorage::TextLocationStorage()
{
}
TextLocationStorage::~TextLocationStorage()
{
}
+19
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
#include "data/access/CodeAccess.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef CODE_ACCESS_H
#define CODE_ACCESS_H
class CodeAccess
{
};
#endif // CODE_ACCESS_H
+1
View File
@@ -0,0 +1 @@
#include "data/access/GraphAccess.h"
+9
View File
@@ -0,0 +1,9 @@
#ifndef GRAPH_ACCESS_H
#define GRAPH_ACCESS_H
class GraphAccess
{
};
#endif // GRAPH_ACCESS_H
+5
View File
@@ -0,0 +1,5 @@
#include "gui/GuiElement.h"
GuiElement::~GuiElement()
{
}
+11
View File
@@ -0,0 +1,11 @@
#ifndef GUI_ELEMENT_H
#define GUI_ELEMENT_H
class GuiElement
{
public:
virtual ~GuiElement();
};
#endif // GUI_ELEMENT_H
+5
View File
@@ -0,0 +1,5 @@
#include "gui/GuiElementFactory.h"
GuiElementFactory::~GuiElementFactory()
{
}
+11
View File
@@ -0,0 +1,11 @@
#ifndef GUI_ELEMENT_FACTORY_H
#define GUI_ELEMENT_FACTORY_H
class GuiElementFactory
{
public:
virtual ~GuiElementFactory();
};
#endif // GUI_ELEMENT_FACTORY_H
-13
View File
@@ -1,13 +0,0 @@
#include "utility.h"
#include <iostream>
void hello()
{
std::cout << "hello world!" << std::endl;
}
int one()
{
return 1;
}
-3
View File
@@ -1,3 +0,0 @@
void hello();
int one();
+1
View File
@@ -0,0 +1 @@
#include "utility/ConfigManager.h"
+10
View File
@@ -0,0 +1,10 @@
#ifndef CONFIG_MANAGER_H
#define CONFIG_MANAGER_H
class ConfigManager
{
};
#endif // CONFIG_MANAGER_H