From 811b8e3736d42038e571c4f014c4b5b5b1f29295 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 25 Feb 2012 12:28:12 +0100 Subject: [PATCH] Added: Seperated pipeline projects. --HG-- branch : build_pipeline_v3 --- code/nel/tools/3d/build_interface/main.cpp | 2 +- .../pipeline_library/pipeline_plugin.cpp | 55 +++++++++++++++ .../pipeline_library/pipeline_plugin.h | 63 +++++++++++++++++ .../pipeline_library/process_plugin.cpp | 55 +++++++++++++++ .../pipeline_library/process_plugin.h | 67 +++++++++++++++++++ .../tool_logger.cpp | 1 + .../tool_logger.h | 3 +- .../pipeline_plugin_max.cpp | 55 +++++++++++++++ .../pipeline_plugin_max/pipeline_plugin_max.h | 63 +++++++++++++++++ .../pipeline_plugin_max/process_max_shape.cpp | 55 +++++++++++++++ .../pipeline_plugin_max/process_max_shape.h | 63 +++++++++++++++++ .../pipeline_service/database_status.cpp | 11 ++- .../pipeline_service/pipeline_service.cpp | 6 +- .../pipeline_service/pipeline_service.h | 10 ++- 14 files changed, 499 insertions(+), 10 deletions(-) create mode 100644 code/nel/tools/pipeline/pipeline_library/pipeline_plugin.cpp create mode 100644 code/nel/tools/pipeline/pipeline_library/pipeline_plugin.h create mode 100644 code/nel/tools/pipeline/pipeline_library/process_plugin.cpp create mode 100644 code/nel/tools/pipeline/pipeline_library/process_plugin.h rename code/nel/tools/pipeline/{pipeline_service => pipeline_library}/tool_logger.cpp (88%) rename code/nel/tools/pipeline/{pipeline_service => pipeline_library}/tool_logger.h (93%) create mode 100644 code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.cpp create mode 100644 code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.h create mode 100644 code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.cpp create mode 100644 code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.h diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 1a0ef6ee2..b00f652f2 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -26,7 +26,7 @@ #include #include -#include "../../pipeline/pipeline_service/tool_logger.h" +#include "../../pipeline/pipeline_library/tool_logger.h" // --------------------------------------------------------------------------- diff --git a/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.cpp b/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.cpp new file mode 100644 index 000000000..40c49a32e --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.cpp @@ -0,0 +1,55 @@ +/** + * \file pipeline_plugin.cpp + * \brief IPipelinePlugin + * \date 2012-02-25 10:27GMT + * \author Jan Boon (Kaetemi) + * IPipelinePlugin + */ + +/* + * 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 "pipeline_plugin.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +IPipelinePlugin::IPipelinePlugin() +{ + +} + +IPipelinePlugin::~IPipelinePlugin() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.h b/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.h new file mode 100644 index 000000000..0cdd4660e --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_library/pipeline_plugin.h @@ -0,0 +1,63 @@ +/** + * \file pipeline_plugin.h + * \brief IPipelinePlugin + * \date 2012-02-25 10:27GMT + * \author Jan Boon (Kaetemi) + * IPipelinePlugin + */ + +/* + * 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_PIPELINE_PLUGIN_H +#define PIPELINE_PIPELINE_PLUGIN_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief IPipelinePlugin + * \date 2012-02-25 10:27GMT + * \author Jan Boon (Kaetemi) + * A pipeline plugin (dll) exposes multiple process plugins. + */ +class IPipelinePlugin +{ +protected: + // pointers + // ... + + // instances + // ... +public: + IPipelinePlugin(); + virtual ~IPipelinePlugin(); +}; /* class IPipelinePlugin */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PIPELINE_PLUGIN_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_library/process_plugin.cpp b/code/nel/tools/pipeline/pipeline_library/process_plugin.cpp new file mode 100644 index 000000000..c505be228 --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_library/process_plugin.cpp @@ -0,0 +1,55 @@ +/** + * \file process_plugin.cpp + * \brief IProcessPlugin + * \date 2012-02-25 10:19GMT + * \author Jan Boon (Kaetemi) + * IProcessPlugin + */ + +/* + * 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_plugin.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +IProcessPlugin::IProcessPlugin() +{ + +} + +IProcessPlugin::~IProcessPlugin() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_library/process_plugin.h b/code/nel/tools/pipeline/pipeline_library/process_plugin.h new file mode 100644 index 000000000..b1683a726 --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_library/process_plugin.h @@ -0,0 +1,67 @@ +/** + * \file process_plugin.h + * \brief IProcessPlugin + * \date 2012-02-25 10:19GMT + * \author Jan Boon (Kaetemi) + * IProcessPlugin + */ + +/* + * 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_PLUGIN_H +#define PIPELINE_PROCESS_PLUGIN_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief IProcessPlugin + * \date 2012-02-25 10:19GMT + * \author Jan Boon (Kaetemi) + * /// REJECTED.A /// A process plugin handles process sheets with specified sheet extention. + * /// REJECTED.A /// If more than one process plugin handles a sheet extention, all of them will be run. + * A process sheet may define one or more process plugins to handle the process. + * The master service may dispatch these seperately to different slave services to executa a single process sheets using multiple process plugins. + * This enables creating seperate plugins for different file formats for the same process, to allow handling files from different modeling packages on different build servers. + */ +class IProcessPlugin +{ +protected: + // pointers + // ... + + // instances + // ... +public: + IProcessPlugin(); + virtual ~IProcessPlugin(); +}; /* class IProcessPlugin */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PROCESS_PLUGIN_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_service/tool_logger.cpp b/code/nel/tools/pipeline/pipeline_library/tool_logger.cpp similarity index 88% rename from code/nel/tools/pipeline/pipeline_service/tool_logger.cpp rename to code/nel/tools/pipeline/pipeline_library/tool_logger.cpp index 271891b25..17c9b1b08 100644 --- a/code/nel/tools/pipeline/pipeline_service/tool_logger.cpp +++ b/code/nel/tools/pipeline/pipeline_library/tool_logger.cpp @@ -40,6 +40,7 @@ using namespace std; namespace PIPELINE { +// Tool logger is fully implemented in header so small tools do not need to link to this library unnecessarily. void dummmmmmmyyyyyyyyyyyyyyyyy_tool_logger_cpp() { } } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/pipeline_service/tool_logger.h b/code/nel/tools/pipeline/pipeline_library/tool_logger.h similarity index 93% rename from code/nel/tools/pipeline/pipeline_service/tool_logger.h rename to code/nel/tools/pipeline/pipeline_library/tool_logger.h index 26b159e3e..5886130da 100644 --- a/code/nel/tools/pipeline/pipeline_service/tool_logger.h +++ b/code/nel/tools/pipeline/pipeline_library/tool_logger.h @@ -3,7 +3,8 @@ * \brief CToolLogger * \date 2012-02-19 10:33GMT * \author Jan Boon (Kaetemi) - * CToolLogger + * Tool logger is fully implemented in header so small tools do not + * need to link to this library unnecessarily. */ /* diff --git a/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.cpp b/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.cpp new file mode 100644 index 000000000..7f3c2ced6 --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.cpp @@ -0,0 +1,55 @@ +/** + * \file pipeline_plugin_max.cpp + * \brief CPipelinePluginMax + * \date 2012-02-25 10:39GMT + * \author Jan Boon (Kaetemi) + * CPipelinePluginMax + */ + +/* + * 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 "pipeline_plugin_max.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CPipelinePluginMax::CPipelinePluginMax() +{ + +} + +CPipelinePluginMax::~CPipelinePluginMax() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.h b/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.h new file mode 100644 index 000000000..e0da1ad5e --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_plugin_max/pipeline_plugin_max.h @@ -0,0 +1,63 @@ +/** + * \file pipeline_plugin_max.h + * \brief CPipelinePluginMax + * \date 2012-02-25 10:39GMT + * \author Jan Boon (Kaetemi) + * Fabulous max! + */ + +/* + * 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_PIPELINE_PLUGIN_MAX_H +#define PIPELINE_PIPELINE_PLUGIN_MAX_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief CPipelinePluginMax + * \date 2012-02-25 10:39GMT + * \author Jan Boon (Kaetemi) + * CPipelinePluginMax + */ +class CPipelinePluginMax +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CPipelinePluginMax(); + virtual ~CPipelinePluginMax(); +}; /* class CPipelinePluginMax */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PIPELINE_PLUGIN_MAX_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.cpp b/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.cpp new file mode 100644 index 000000000..1c2dba78a --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.cpp @@ -0,0 +1,55 @@ +/** + * \file process_max_shape.cpp + * \brief CProcessMaxShape + * \date 2012-02-25 10:45GMT + * \author Jan Boon (Kaetemi) + * CProcessMaxShape + */ + +/* + * 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_max_shape.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CProcessMaxShape::CProcessMaxShape() +{ + +} + +CProcessMaxShape::~CProcessMaxShape() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.h b/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.h new file mode 100644 index 000000000..88bb103ff --- /dev/null +++ b/code/nel/tools/pipeline/pipeline_plugin_max/process_max_shape.h @@ -0,0 +1,63 @@ +/** + * \file process_max_shape.h + * \brief CProcessMaxShape + * \date 2012-02-25 10:45GMT + * \author Jan Boon (Kaetemi) + * CProcessMaxShape + */ + +/* + * 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_MAX_SHAPE_H +#define PIPELINE_PROCESS_MAX_SHAPE_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief CProcessMaxShape + * \date 2012-02-25 10:45GMT + * \author Jan Boon (Kaetemi) + * CProcessMaxShape + */ +class CProcessMaxShape +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CProcessMaxShape(); + virtual ~CProcessMaxShape(); +}; /* class CProcessMaxShape */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_PROCESS_MAX_SHAPE_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/pipeline_service/database_status.cpp b/code/nel/tools/pipeline/pipeline_service/database_status.cpp index 8521ceeab..7103c621e 100644 --- a/code/nel/tools/pipeline/pipeline_service/database_status.cpp +++ b/code/nel/tools/pipeline/pipeline_service/database_status.cpp @@ -251,18 +251,17 @@ public: IRunnable *CDatabaseStatus::updateFileStatus(const TFileStatusCallback &callback, const std::string &filePath) { - if (!g_IsMaster) - { - nlerror("Not master, not allowed."); - return NULL; - } - +#if defined(PIPELINE_MASTER) CUpdateFileStatus *ufs = new CUpdateFileStatus(); ufs->StatusMutex = &m_StatusMutex; ufs->FilePath = unMacroPath(filePath); ufs->Callback = callback; CAsyncFileManager::getInstance().addLoadTask(ufs); return ufs; +#else + nlerror("Not master, not allowed."); + return NULL; +#endif } // ****************************************************************** diff --git a/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp b/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp index d2b7bde10..36e3626cc 100644 --- a/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/pipeline_service/pipeline_service.cpp @@ -83,7 +83,11 @@ std::string macroPath(const std::string &path) namespace { #define PIPELINE_LONG_SERVICE_NAME "pipeline_service" -#define PIPELINE_SHORT_SERVICE_NAME "PLS" +#ifdef PIPELINE_MASTER +#define PIPELINE_SHORT_SERVICE_NAME "PLSM" +#else +#define PIPELINE_SHORT_SERVICE_NAME "PLSS" +#endif /// Enum enum EState diff --git a/code/nel/tools/pipeline/pipeline_service/pipeline_service.h b/code/nel/tools/pipeline/pipeline_service/pipeline_service.h index 0223ff622..01e9e9f8a 100644 --- a/code/nel/tools/pipeline/pipeline_service/pipeline_service.h +++ b/code/nel/tools/pipeline/pipeline_service/pipeline_service.h @@ -38,7 +38,15 @@ namespace PIPELINE { -extern bool g_IsMaster; +#if defined(PIPELINE_MASTER) +# if defined(PIPELINE_SLAVE) +# error Cannot define both PIPELINE_MASTER and PIPELINE_SLAVE at the same time. +# endif +#elif defined (PIPELINE_SLAVE) +#else +# error Must define either PIPELINE_MASTER or PIPELINE_SLAVE. Create 2 projects that output pipeline_service_master and pipeline_service_slave executables. +#endif + extern std::string g_DatabaseDirectory; extern std::string g_PipelineDirectory;