From 62fdfecde3df92e2416f2722bae609f4c7b484e5 Mon Sep 17 00:00:00 2001 From: Olivier Langella <Olivier.Langella@moulon.inra.fr> Date: Thu, 5 Nov 2015 22:24:27 +0100 Subject: [PATCH] new class for project and xpip file --- src/CMakeLists.txt | 3 ++- src/core/project.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/core/project.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/files/xpipfile.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/files/xpipfile.h | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 src/core/project.cpp create mode 100644 src/core/project.h create mode 100644 src/files/xpipfile.cpp create mode 100644 src/files/xpipfile.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b96cd69d..e39188a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,6 +52,8 @@ configure_file (${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_SOURCE_DIR}/src/c # File list SET(CPP_FILES utils/readspectrum.cpp + core/project.cpp + files/xpipfile.cpp ) set(QTLIBS ${Qt5Xml_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES}) @@ -102,4 +104,3 @@ TARGET_LINK_LIBRARIES(xtpcpp ${PAPPSOMSPP_QT4_LIBRARY} ${Pwiz_LIBRARY} ${ODSSTRE INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xtpcpp DESTINATION bin) #configure_file (${CMAKE_SOURCE_DIR}/templates/share/applications/pt-peptideviewer.desktop.cmake ${CMAKE_BINARY_DIR}/templates/share/applications/pt-peptideviewer.desktop) - diff --git a/src/core/project.cpp b/src/core/project.cpp new file mode 100644 index 00000000..7a92c3fb --- /dev/null +++ b/src/core/project.cpp @@ -0,0 +1,37 @@ + +/******************************************************************************* +* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and implementation +******************************************************************************/ +#include "project.h" + +Project::Project() +{ + +} + +Project::~Project() +{ + +} + +ProjectSp Project::makeProjectSp() const { + return std::make_shared<Project>(*this); +} \ No newline at end of file diff --git a/src/core/project.h b/src/core/project.h new file mode 100644 index 00000000..31ff6dc6 --- /dev/null +++ b/src/core/project.h @@ -0,0 +1,40 @@ + +/******************************************************************************* +* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and implementation +******************************************************************************/ +#ifndef PROJECT_H +#define PROJECT_H + +#include<memory> + +class Project; +typedef std::shared_ptr<Project> ProjectSp; + +class Project +{ +public: + Project(); + ~Project(); + + ProjectSp makeProjectSp() const; +}; + +#endif // PROJECT_H diff --git a/src/files/xpipfile.cpp b/src/files/xpipfile.cpp new file mode 100644 index 00000000..4d13bf01 --- /dev/null +++ b/src/files/xpipfile.cpp @@ -0,0 +1,38 @@ +/******************************************************************************* +* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and implementation +******************************************************************************/ +#include "xpipfile.h" + +XpipFile::XpipFile(const QUrl & xpip_source) : _xpip_source(xpip_source) +{ + +} + +XpipFile::~XpipFile() +{ + +} +ProjectSp XpipFile::getProjectSp() const { + Project project; + + return (project.makeProjectSp()); + +} \ No newline at end of file diff --git a/src/files/xpipfile.h b/src/files/xpipfile.h new file mode 100644 index 00000000..86d162f2 --- /dev/null +++ b/src/files/xpipfile.h @@ -0,0 +1,40 @@ +/******************************************************************************* +* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and implementation +******************************************************************************/ +#ifndef XPIPFILE_H +#define XPIPFILE_H + +#include <QUrl> +#include "../core/project.h" + +class XpipFile +{ +public: + XpipFile(const QUrl & xpip_source); + ~XpipFile(); + + ProjectSp getProjectSp() const; + +private : + const QUrl _xpip_source; +}; + +#endif // XPIPFILE_H -- GitLab