From d0c477cbf055859f9c434284c49bf5d9423dfebb Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 4 Mar 2012 13:50:28 +0100 Subject: [PATCH] Changed: #1440 Some cleanup --HG-- branch : build_pipeline_v3 --- .../pipeline/plugin_library/pipeline_interface.h | 8 +++++++- .../tools/pipeline/service/module_pipeline_slave.cpp | 4 ++++ .../pipeline/service/pipeline_interface_impl.cpp | 12 +++++++++++- .../tools/pipeline/service/pipeline_interface_impl.h | 4 +++- code/nel/tools/pipeline/service/pipeline_service.cpp | 2 +- code/nel/tools/pipeline/service/pipeline_service.h | 2 +- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/pipeline/plugin_library/pipeline_interface.h b/code/nel/tools/pipeline/plugin_library/pipeline_interface.h index 0ced6da77..879d00ad4 100644 --- a/code/nel/tools/pipeline/plugin_library/pipeline_interface.h +++ b/code/nel/tools/pipeline/plugin_library/pipeline_interface.h @@ -67,10 +67,16 @@ public: virtual void registerClass(const std::string &className, NLMISC::IClassable* (*creator)(), const std::string &typeidCheck) throw(NLMISC::ERegistry) = 0; /// Runs a runnable task if STATE_IDLE. You must call endedRunnableTask when the task has ended. - virtual bool tryRunnableTask(std::string stateName, NLMISC::IRunnable *task) = 0; + virtual bool tryRunnableTask(const std::string &stateName, NLMISC::IRunnable *task) = 0; /// Call when a runnable task has ended to reset to STATE_IDLE. virtual void endedRunnableTask() = 0; + + /// Runs a runnable task if STATE_IDLE. You must call endedRunnableTask when the task has ended. + virtual bool tryDirectCode(const std::string &stateName) = 0; + + /// Call when a runnable task has ended to reset to STATE_IDLE. + virtual void endedDirectCode() = 0; }; /* class IPipelineInterface */ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp index abd37814e..620f69ea0 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -96,6 +96,8 @@ public: nlinfo("Master UP (%s)", moduleProxy->getModuleName().c_str()); nlassert(m_Master == NULL); + + // TODO: SAY HELLO m_Master = new CModulePipelineMasterProxy(moduleProxy); } @@ -109,6 +111,8 @@ public: nlassert(m_Master->getModuleProxy() == moduleProxy); + // TODO: ABORT RUNNING BUILD PROCESS + delete m_Master; m_Master = NULL; } diff --git a/code/nel/tools/pipeline/service/pipeline_interface_impl.cpp b/code/nel/tools/pipeline/service/pipeline_interface_impl.cpp index 7c01cb528..b0611a0fb 100644 --- a/code/nel/tools/pipeline/service/pipeline_interface_impl.cpp +++ b/code/nel/tools/pipeline/service/pipeline_interface_impl.cpp @@ -68,7 +68,7 @@ void CPipelineInterfaceImpl::registerClass(const std::string &className, NLMISC: nldebug("Registered class '%s'", className.c_str()); } -bool CPipelineInterfaceImpl::tryRunnableTask(std::string stateName, NLMISC::IRunnable *task) +bool CPipelineInterfaceImpl::tryRunnableTask(const std::string &stateName, NLMISC::IRunnable *task) { return PIPELINE::tryRunnableTask(stateName, task); } @@ -78,6 +78,16 @@ void CPipelineInterfaceImpl::endedRunnableTask() PIPELINE::endedRunnableTask(); } +bool CPipelineInterfaceImpl::tryDirectCode(const std::string &stateName) +{ + return PIPELINE::tryDirectTask(stateName); +} + +void CPipelineInterfaceImpl::endedDirectCode() +{ + PIPELINE::endedDirectTask(); +} + } /* namespace PIPELINE */ /* 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 9d57f8da4..2cdc8e3de 100644 --- a/code/nel/tools/pipeline/service/pipeline_interface_impl.h +++ b/code/nel/tools/pipeline/service/pipeline_interface_impl.h @@ -57,8 +57,10 @@ public: virtual NLMISC::CConfigFile &getConfigFile(); 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 bool tryRunnableTask(const std::string &stateName, NLMISC::IRunnable *task); virtual void endedRunnableTask(); + virtual bool tryDirectCode(const std::string &stateName); + virtual void endedDirectCode(); }; /* 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 15c8777fd..abf4d459e 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/service/pipeline_service.cpp @@ -168,7 +168,7 @@ bool isServiceStateIdle() return (s_State == STATE_IDLE); } -bool tryRunnableTask(std::string stateName, IRunnable *task) +bool tryRunnableTask(const std::string &stateName, IRunnable *task) { // copy paste from above. diff --git a/code/nel/tools/pipeline/service/pipeline_service.h b/code/nel/tools/pipeline/service/pipeline_service.h index 30207a610..3915d6a65 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.h +++ b/code/nel/tools/pipeline/service/pipeline_service.h @@ -67,7 +67,7 @@ std::string unMacroPath(const std::string &path); /// Macros a path, and standardizes it in advance. std::string macroPath(const std::string &path); -bool tryRunnableTask(std::string stateName, NLMISC::IRunnable *task); +bool tryRunnableTask(const std::string &stateName, NLMISC::IRunnable *task); void endedRunnableTask(); bool tryDirectTask(const std::string &stateName);