From d114c38eda7dd052a4c7bfb3728903deb87926bd Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 3 Mar 2012 11:00:08 +0100 Subject: [PATCH] Added: #1440 Make pipeline plugin configuration part of workspace to allow different plugins being installed on different machines --HG-- branch : build_pipeline_v3 --- .../plugin_library/pipeline_interface.cpp | 2 - .../plugin_library/pipeline_interface.h | 8 --- .../plugin_library/process_interface.cpp | 52 ++++++++++++++ .../plugin_library/process_interface.h | 67 +++++++++++++++++++ .../service/pipeline_interface_impl.h | 9 +-- .../pipeline/service/pipeline_service.cpp | 6 +- .../service/process_interface_impl.cpp | 55 +++++++++++++++ .../pipeline/service/process_interface_impl.h | 61 +++++++++++++++++ .../DFN/pipeline/pipeline_plugin.dfn | 8 +++ .../DFN/pipeline/pipeline_plugin_process.dfn | 10 +++ .../pipeline/pipeline_plugin_process_type.typ | 7 ++ .../DFN/pipeline/pipeline_workspace.dfn | 6 +- .../pipeline/plugin_max.pipeline_plugin | 20 ++++++ .../pipeline/plugin_nel.pipeline_plugin | 22 ++++++ .../pipeline/ryzom_core.pipeline_workspace | 9 ++- 15 files changed, 316 insertions(+), 26 deletions(-) create mode 100644 code/nel/tools/pipeline/plugin_library/process_interface.cpp create mode 100644 code/nel/tools/pipeline/plugin_library/process_interface.h create mode 100644 code/nel/tools/pipeline/service/process_interface_impl.cpp create mode 100644 code/nel/tools/pipeline/service/process_interface_impl.h create mode 100644 code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin.dfn create mode 100644 code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process.dfn create mode 100644 code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process_type.typ create mode 100644 code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_max.pipeline_plugin create mode 100644 code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_nel.pipeline_plugin diff --git a/code/nel/tools/pipeline/plugin_library/pipeline_interface.cpp b/code/nel/tools/pipeline/plugin_library/pipeline_interface.cpp index ddb6c9097..0b232ad0b 100644 --- a/code/nel/tools/pipeline/plugin_library/pipeline_interface.cpp +++ b/code/nel/tools/pipeline/plugin_library/pipeline_interface.cpp @@ -41,8 +41,6 @@ using namespace std; namespace PIPELINE { -void fksjdlfkjdskfljdsklfjdslkfjdsf() { } - IPipelineInterface *IPipelineInterface::getInstance() { nlassert(NLMISC::INelContext::isContextInitialised()); diff --git a/code/nel/tools/pipeline/plugin_library/pipeline_interface.h b/code/nel/tools/pipeline/plugin_library/pipeline_interface.h index 377e58f0e..0ced6da77 100644 --- a/code/nel/tools/pipeline/plugin_library/pipeline_interface.h +++ b/code/nel/tools/pipeline/plugin_library/pipeline_interface.h @@ -71,14 +71,6 @@ public: /// Call when a runnable task has ended to reset to STATE_IDLE. virtual void endedRunnableTask() = 0; - - // ***************** PROCESS FUNCTIONS ***************** - - /// Get a parsed georges sheets value from the current project. (example: OutputDirectory) - virtual std::string getProjectValue(const std::string &name) = 0; - - /// Get the temporary directory for the current process. The directory must be deleted when the process ends. May return random temporary directories if no process is running. - virtual std::string getTempDir() = 0; }; /* class IPipelineInterface */ diff --git a/code/nel/tools/pipeline/plugin_library/process_interface.cpp b/code/nel/tools/pipeline/plugin_library/process_interface.cpp new file mode 100644 index 000000000..6362dd4a0 --- /dev/null +++ b/code/nel/tools/pipeline/plugin_library/process_interface.cpp @@ -0,0 +1,52 @@ +/** + * \file process_interface.cpp + * \brief IProcessInterface + * \date 2012-03-03 09:22GMT + * \author Jan Boon (Kaetemi) + * IProcessInterface + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE 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 2 of + * the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE 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 RYZOM CORE PIPELINE; see the file COPYING. If not, see + * . + */ + +#include +#include "process_interface.h" + +// STL includes + +// NeL includes +#include +#include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +IProcessInterface *IProcessInterface::getInstance() +{ + nlassert(NLMISC::INelContext::isContextInitialised()); + return static_cast(NLMISC::INelContext::getInstance().getSingletonPointer("IProcessInterface")); +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/plugin_library/process_interface.h b/code/nel/tools/pipeline/plugin_library/process_interface.h new file mode 100644 index 000000000..71ce1a94c --- /dev/null +++ b/code/nel/tools/pipeline/plugin_library/process_interface.h @@ -0,0 +1,67 @@ +/** + * \file process_interface.h + * \brief IProcessInterface + * \date 2012-03-03 09:22GMT + * \author Jan Boon (Kaetemi) + * IProcessInterface + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE 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 2 of + * the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE 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 RYZOM CORE PIPELINE; see the file COPYING. If not, see + * . + */ + +#ifndef PIPELINE_PROCESS_INTERFACE_H +#define PIPELINE_PROCESS_INTERFACE_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief IProcessInterface + * \date 2012-03-03 09:22GMT + * \author Jan Boon (Kaetemi) + * IProcessInterface + */ +class IProcessInterface +{ +public: + IProcessInterface(); + virtual ~IProcessInterface(); + + static IProcessInterface *getInstance(); + + // ***************** PROCESS FUNCTIONS (EASILY EXPOSABLE TO SCRIPTS ETCETERA) ***************** + + /// Get a parsed georges sheets value from the current project. (example: Interface.DstDirectory) + virtual std::string getProjectValue(const std::string &name) = 0; + + /// Get the temporary directory for the current process. The directory must be deleted when the process ends. May return random temporary directories if no process is running. + virtual std::string getTempDir() = 0; +}; /* class IProcessInterface */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PROCESS_INTERFACE_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/service/pipeline_interface_impl.h b/code/nel/tools/pipeline/service/pipeline_interface_impl.h index 83f5976b6..7e2a1ec34 100644 --- a/code/nel/tools/pipeline/service/pipeline_interface_impl.h +++ b/code/nel/tools/pipeline/service/pipeline_interface_impl.h @@ -52,12 +52,7 @@ class CPipelineInterfaceImpl : public IPipelineInterface { public: std::vector RegisteredClasses; -protected: - // pointers - // ... - - // instances - // ... + public: CPipelineInterfaceImpl(); virtual ~CPipelineInterfaceImpl(); @@ -66,8 +61,6 @@ public: virtual void registerClass(const std::string &className, NLMISC::IClassable* (*creator)(), const std::string &typeidCheck) throw(NLMISC::ERegistry); virtual bool tryRunnableTask(std::string stateName, NLMISC::IRunnable *task); virtual void endedRunnableTask(); - virtual std::string getProjectValue(const std::string &name); - virtual std::string getTempDir(); }; /* class CPipelineInterfaceImpl */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/service/pipeline_service.cpp b/code/nel/tools/pipeline/service/pipeline_service.cpp index 85eeba53d..53035b363 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/service/pipeline_service.cpp @@ -84,11 +84,7 @@ std::string macroPath(const std::string &path) namespace { #define PIPELINE_LONG_SERVICE_NAME "pipeline_service" -#ifdef PIPELINE_MASTER -#define PIPELINE_SHORT_SERVICE_NAME "PLSM" -#else -#define PIPELINE_SHORT_SERVICE_NAME "PLSS" -#endif +#define PIPELINE_SHORT_SERVICE_NAME "PLS" #ifdef NL_DEBUG #define PIPELINE_SERVICE_DIRECTORY "R:\\build\\dev\\bin\\Release" diff --git a/code/nel/tools/pipeline/service/process_interface_impl.cpp b/code/nel/tools/pipeline/service/process_interface_impl.cpp new file mode 100644 index 000000000..1298afd73 --- /dev/null +++ b/code/nel/tools/pipeline/service/process_interface_impl.cpp @@ -0,0 +1,55 @@ +/** + * \file process_interface_impl.cpp + * \brief CProcessInterfaceImpl + * \date 2012-03-03 09:33GMT + * \author Jan Boon (Kaetemi) + * CProcessInterfaceImpl + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE 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 2 of + * the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE 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 RYZOM CORE PIPELINE; see the file COPYING. If not, see + * . + */ + +#include +#include "process_interface_impl.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CProcessInterfaceImpl::CProcessInterfaceImpl() +{ + +} + +CProcessInterfaceImpl::~CProcessInterfaceImpl() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/service/process_interface_impl.h b/code/nel/tools/pipeline/service/process_interface_impl.h new file mode 100644 index 000000000..8761bfe7e --- /dev/null +++ b/code/nel/tools/pipeline/service/process_interface_impl.h @@ -0,0 +1,61 @@ +/** + * \file process_interface_impl.h + * \brief CProcessInterfaceImpl + * \date 2012-03-03 09:33GMT + * \author Jan Boon (Kaetemi) + * CProcessInterfaceImpl + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE 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 2 of + * the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE 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 RYZOM CORE PIPELINE; see the file COPYING. If not, see + * . + */ + +#ifndef PIPELINE_PROCESS_INTERFACE_IMPL_H +#define PIPELINE_PROCESS_INTERFACE_IMPL_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "../plugin_library/process_interface.h" + +namespace PIPELINE { + +/** + * \brief CProcessInterfaceImpl + * \date 2012-03-03 09:33GMT + * \author Jan Boon (Kaetemi) + * CProcessInterfaceImpl + */ +class CProcessInterfaceImpl : public IProcessInterface +{ +public: + CProcessInterfaceImpl(); + virtual ~CProcessInterfaceImpl(); + + virtual std::string getProjectValue(const std::string &name); + virtual std::string getTempDir(); +}; /* class CProcessInterfaceImpl */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PROCESS_INTERFACE_IMPL_H */ + +/* end of file */ diff --git a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin.dfn b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin.dfn new file mode 100644 index 000000000..62850ffe9 --- /dev/null +++ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin.dfn @@ -0,0 +1,8 @@ + + + + + Sat Feb 18 13:34:33 2012 (Kaetemi) Dfn Structure = +Sat Feb 18 13:34:44 2012 (Kaetemi) Dfn Structure = +Sat Feb 18 13:44:42 2012 (Kaetemi) Dfn Structure = + diff --git a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process.dfn b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process.dfn new file mode 100644 index 000000000..ad5e9a45b --- /dev/null +++ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process.dfn @@ -0,0 +1,10 @@ + + + + + + + Sat Feb 18 13:34:33 2012 (Kaetemi) Dfn Structure = +Sat Feb 18 13:34:44 2012 (Kaetemi) Dfn Structure = +Sat Feb 18 13:44:42 2012 (Kaetemi) Dfn Structure = + diff --git a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process_type.typ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process_type.typ new file mode 100644 index 000000000..ab4eac32b --- /dev/null +++ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_plugin_process_type.typ @@ -0,0 +1,7 @@ + + + + + + + diff --git a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_workspace.dfn b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_workspace.dfn index 68df130e3..ee020c545 100644 --- a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_workspace.dfn +++ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_workspace.dfn @@ -1,8 +1,10 @@ - + + Sat Feb 18 13:34:33 2012 (Kaetemi) Dfn Structure = Sat Feb 18 13:34:44 2012 (Kaetemi) Dfn Structure = -Sat Feb 18 13:44:42 2012 (Kaetemi) Dfn Structure = +Sat Feb 18 13:44:42 2012 (Kaetemi) Dfn Structure = +Sat Mar 03 10:57:33 2012 (Kaetemi) Dfn Structure = diff --git a/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_max.pipeline_plugin b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_max.pipeline_plugin new file mode 100644 index 000000000..101f64ebf --- /dev/null +++ b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_max.pipeline_plugin @@ -0,0 +1,20 @@ + +
+ + + + + + + + + + + + + + Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].Handler = CProcessMaxShape +Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].HandlerType = RegisteredClass +Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].Process = ExportShape +Sat Mar 03 10:55:24 2012 (Kaetemi) formName Resized = 1 + diff --git a/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_nel.pipeline_plugin b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_nel.pipeline_plugin new file mode 100644 index 000000000..1179dda6f --- /dev/null +++ b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/plugin_nel.pipeline_plugin @@ -0,0 +1,22 @@ + +
+ + + + + + + + + + + + + + Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].Handler = CProcessMaxShape +Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].HandlerType = RegisteredClass +Sat Mar 03 10:55:24 2012 (Kaetemi) .ProcessHandlers[0].Process = ExportShape +Sat Mar 03 10:55:24 2012 (Kaetemi) formName Resized = 1 +Sat Mar 03 10:56:08 2012 (Kaetemi) .ProcessHandlers[0].Handler = CProcessInterface +Sat Mar 03 10:56:08 2012 (Kaetemi) .ProcessHandlers[0].Process = Interface + diff --git a/code/ryzom/common/data_leveldesign/leveldesign/pipeline/ryzom_core.pipeline_workspace b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/ryzom_core.pipeline_workspace index 1c650d554..3cfada30e 100644 --- a/code/ryzom/common/data_leveldesign/leveldesign/pipeline/ryzom_core.pipeline_workspace +++ b/code/ryzom/common/data_leveldesign/leveldesign/pipeline/ryzom_core.pipeline_workspace @@ -5,6 +5,10 @@ + + + + @@ -15,5 +19,8 @@ Sat Feb 18 13:48:48 2012 (Kaetemi) formName Resized = 1 Sat Feb 18 14:44:25 2012 (Kaetemi) .Description = Ryzom Core Sat Feb 18 14:44:37 2012 (Kaetemi) .Projects[0] = common_interface.pipeline_project Sat Feb 18 23:23:17 2012 (Kaetemi) .Description = Ryzom Core Test -Sat Feb 18 23:23:26 2012 (Kaetemi) .Description = Ryzom Core +Sat Feb 18 23:23:26 2012 (Kaetemi) .Description = Ryzom Core +Sat Mar 03 10:58:02 2012 (Kaetemi) .Plugins[0] = plugin_nel.pipeline_plugin +Sat Mar 03 10:58:02 2012 (Kaetemi) .Plugins[1] = plugin_max.pipeline_plugin +Sat Mar 03 10:58:02 2012 (Kaetemi) formName Resized = 2