diff --git a/code/nel/tools/pipeline/service/database_status.cpp b/code/nel/tools/pipeline/service/database_status.cpp index ce8f54634..50d1dcf0b 100644 --- a/code/nel/tools/pipeline/service/database_status.cpp +++ b/code/nel/tools/pipeline/service/database_status.cpp @@ -339,6 +339,31 @@ public: } }; +void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &dir, bool recurse); +void updatePathStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &subPath, bool recurse, bool recurseOnce) +{ + if (CFile::isDirectory(subPath)) // if the file is a directory! + { + if (recurse || recurseOnce) + updateDirectoryStatus(ds, updater, subPath, recurse); + } + else + { + CFileStatus fileStatus; + if (!ds->getFileStatus(fileStatus, subPath)) + { + updater.Mutex.enter(); + if (!updater.CallbackCalled) // on abort. + { + ++updater.FilesRequested; + IRunnable *runnable = ds->updateFileStatus(TFileStatusCallback(&updater, &CDatabaseStatusUpdater::fileUpdated), subPath); + updater.RequestTasks.push_back(runnable); + } + updater.Mutex.leave(); + } + } +} + void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &dir, bool recurse) { std::string dirPath = CPath::standardizePath(dir, true); @@ -350,27 +375,8 @@ void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, { const std::string subPath = *it; - if (CFile::isDirectory(subPath)) // if the file is a directory! - { - if (recurse) - updateDirectoryStatus(ds, updater, subPath, recurse); // lol recurse is true anyway - } - else - { - CFileStatus fileStatus; - if (!ds->getFileStatus(fileStatus, subPath)) - { - updater.Mutex.enter(); - if (!updater.CallbackCalled) // on abort. - { - ++updater.FilesRequested; - IRunnable *runnable = ds->updateFileStatus(TFileStatusCallback(&updater, &CDatabaseStatusUpdater::fileUpdated), subPath); - updater.RequestTasks.push_back(runnable); - } - updater.Mutex.leave(); - } - } - + updatePathStatus(ds, updater, subPath, recurse, false); + if (g_IsExiting) return; } @@ -393,14 +399,14 @@ void CDatabaseStatus::updateDatabaseStatus(const CCallback &callback, cons updater->FilesUpdated = 0; updater->Ready = false; updater->CallbackCalled = false; - + nlinfo("Starting iteration through database, queueing file status updates."); for (std::vector::const_iterator it = paths.begin(), end = paths.end(); it != end; ++it) - updateDirectoryStatus(this, *updater, unMacroPath(*it), recurse); + updatePathStatus(this, *updater, unMacroPath(*it), recurse, true); nlinfo("Iteration through database, queueing file status updates complete."); - + bool done = false; updater->Mutex.enter(); updater->Ready = true; diff --git a/code/nel/tools/pipeline/service/module_pipeline_master.cpp b/code/nel/tools/pipeline/service/module_pipeline_master.cpp new file mode 100644 index 000000000..7c71d2469 --- /dev/null +++ b/code/nel/tools/pipeline/service/module_pipeline_master.cpp @@ -0,0 +1,82 @@ +/** + * \file module_pipeline_master.cpp + * \brief CModulePipelineMaster + * \date 2012-03-03 16:26GMT + * \author Jan Boon (Kaetemi) + * CModulePipelineMaster + */ + +/* + * 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 "module_pipeline_master_itf.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + +namespace PIPELINE { + +/** + * \brief CModulePipelineMaster + * \date 2012-03-03 16:26GMT + * \author Jan Boon (Kaetemi) + * CModulePipelineMaster + */ +class CModulePipelineMaster : + public CEmptyModuleServiceBehav > >, + public CModulePipelineMasterSkel +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CModulePipelineMaster() + { + + } + + virtual ~CModulePipelineMaster() + { + + } + + virtual void slaveFinishedBuildTask(NLNET::IModuleProxy *sender, uint32 taskId) + { + + } +}; /* class CModulePipelineMaster */ + +void module_pipeline_master_forceLink() { } +NLNET_REGISTER_MODULE_FACTORY(CModulePipelineMaster, "ModulePipelineMaster"); + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp b/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp new file mode 100644 index 000000000..99979e030 Binary files /dev/null and b/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.h b/code/nel/tools/pipeline/service/module_pipeline_master_itf.h new file mode 100644 index 000000000..4e5b9ea73 Binary files /dev/null and b/code/nel/tools/pipeline/service/module_pipeline_master_itf.h differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml b/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml new file mode 100644 index 000000000..ca5098a26 --- /dev/null +++ b/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp new file mode 100644 index 000000000..d4edc7249 --- /dev/null +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -0,0 +1,83 @@ +/** + * \file module_pipeline_slave.cpp + * \brief CModulePipelineSlave + * \date 2012-03-03 16:26GMT + * \author Jan Boon (Kaetemi) + * CModulePipelineSlave + */ + +/* + * 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 "module_pipeline_slave_itf.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +using namespace NLMISC; +using namespace NLNET; + +namespace PIPELINE { + +/** + * \brief CModulePipelineSlave + * \date 2012-03-03 16:26GMT + * \author Jan Boon (Kaetemi) + * CModulePipelineSlave + */ +class CModulePipelineSlave : + public CEmptyModuleServiceBehav > >, + public CModulePipelineSlaveSkel +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CModulePipelineSlave() + { + + } + + virtual ~CModulePipelineSlave() + { + + } + + virtual void startBuildTask(NLNET::IModuleProxy *sender, uint32 taskId, const std::string &projectName, const std::string &processHandler) + { + + } + +}; /* class CModulePipelineSlave */ + +void module_pipeline_slave_forceLink() { } +NLNET_REGISTER_MODULE_FACTORY(CModulePipelineSlave, "ModulePipelineSlave"); + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp new file mode 100644 index 000000000..e26d319d0 Binary files /dev/null and b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h new file mode 100644 index 000000000..6d031f5b2 Binary files /dev/null and b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml new file mode 100644 index 000000000..a718e1078 --- /dev/null +++ b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/code/nel/tools/pipeline/service/module_update.bat b/code/nel/tools/pipeline/service/module_update.bat new file mode 100644 index 000000000..d9949fe89 --- /dev/null +++ b/code/nel/tools/pipeline/service/module_update.bat @@ -0,0 +1,4 @@ +d:\tools\msxsl R:\code\nel\tools\pipeline\service\module_pipeline_master_itf.xml R:\code\ryzom\common\src\game_share\generate_module_interface.xslt output=header filename=module_pipeline_master_itf -o R:\code\nel\tools\pipeline\service\module_pipeline_master_itf.h +d:\tools\msxsl R:\code\nel\tools\pipeline\service\module_pipeline_master_itf.xml R:\code\ryzom\common\src\game_share\generate_module_interface.xslt output=cpp filename=module_pipeline_master_itf -o R:\code\nel\tools\pipeline\service\module_pipeline_master_itf.cpp +d:\tools\msxsl R:\code\nel\tools\pipeline\service\module_pipeline_slave_itf.xml R:\code\ryzom\common\src\game_share\generate_module_interface.xslt output=header filename=module_pipeline_slave_itf -o R:\code\nel\tools\pipeline\service\module_pipeline_slave_itf.h +d:\tools\msxsl R:\code\nel\tools\pipeline\service\module_pipeline_slave_itf.xml R:\code\ryzom\common\src\game_share\generate_module_interface.xslt output=cpp filename=module_pipeline_slave_itf -o R:\code\nel\tools\pipeline\service\module_pipeline_slave_itf.cpp \ No newline at end of file diff --git a/code/nel/tools/pipeline/service/pipeline_service.cpp b/code/nel/tools/pipeline/service/pipeline_service.cpp index b7a71bc00..635741cc3 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/service/pipeline_service.cpp @@ -85,6 +85,9 @@ std::string macroPath(const std::string &path) return result; } +extern void module_pipeline_master_forceLink(); +extern void module_pipeline_slave_forceLink(); + // ****************************************************************** namespace { @@ -275,7 +278,8 @@ private: public: CPipelineService() { - + module_pipeline_master_forceLink(); + module_pipeline_slave_forceLink(); } virtual ~CPipelineService()