Added: #1440 Module shells for master and slave

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent fed5c05538
commit 4196ceff00

@ -339,21 +339,13 @@ public:
}
};
void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &dir, bool recurse)
{
std::string dirPath = CPath::standardizePath(dir, true);
std::vector<std::string> dirContents;
CPath::getPathContent(dirPath, false, true, true, dirContents);
for (std::vector<std::string>::iterator it = dirContents.begin(), end = dirContents.end(); it != end; ++it)
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)
{
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
if (recurse || recurseOnce)
updateDirectoryStatus(ds, updater, subPath, recurse);
}
else
{
@ -370,6 +362,20 @@ void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater,
updater.Mutex.leave();
}
}
}
void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &dir, bool recurse)
{
std::string dirPath = CPath::standardizePath(dir, true);
std::vector<std::string> dirContents;
CPath::getPathContent(dirPath, false, true, true, dirContents);
for (std::vector<std::string>::iterator it = dirContents.begin(), end = dirContents.end(); it != end; ++it)
{
const std::string subPath = *it;
updatePathStatus(ds, updater, subPath, recurse, false);
if (g_IsExiting)
return;
@ -397,7 +403,7 @@ void CDatabaseStatus::updateDatabaseStatus(const CCallback<void> &callback, cons
nlinfo("Starting iteration through database, queueing file status updates.");
for (std::vector<std::string>::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.");

@ -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
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "module_pipeline_master_itf.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// 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<CEmptyModuleCommBehav<CEmptySocketBehav<CModuleBase> > >,
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 */

@ -0,0 +1,17 @@
<generator header_tag="PIPELINE_MODULE_PIPELINE_MASTER_ITF_H">
<namespace name="PIPELINE">
<module_interface name="CModulePipelineMaster">
<method name="slaveFinishedBuildTask" msg="SFBT">
<doc line=""/>
<param type="uint32" name="taskId" />
</method>
</module_interface>
</namespace>
</generator>

@ -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
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "module_pipeline_slave_itf.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// 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<CEmptyModuleCommBehav<CEmptySocketBehav<CModuleBase> > >,
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 */

@ -0,0 +1,19 @@
<generator header_tag="PIPELINE_MODULE_PIPELINE_SLAVE_ITF_H">
<namespace name="PIPELINE">
<module_interface name="CModulePipelineSlave">
<method name="startBuildTask" msg="SBT">
<doc line=""/>
<param type="uint32" name="taskId" />
<param type="std::string" name="projectName" byref="true"/>
<param type="std::string" name="processHandler" byref="true"/>
</method>
</module_interface>
</namespace>
</generator>

@ -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

@ -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()

Loading…
Cancel
Save