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,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<void> &callback, cons
updater->FilesUpdated = 0;
updater->Ready = false;
updater->CallbackCalled = false;
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.");
bool done = false;
updater->Mutex.enter();
updater->Ready = true;

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