Changed: #1440 Some cleanup

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent ccd232eec8
commit d0c477cbf0

@ -67,11 +67,17 @@ 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 */
#define PIPELINE_REGISTER_CLASS(_class_) PIPELINE::IPipelineInterface::getInstance()->registerClass(#_class_, _class_::creator, typeid(_class_).name());

@ -97,6 +97,8 @@ public:
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;
}

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

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

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

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

Loading…
Cancel
Save