Added: #1440 Class for pipeline project sheet

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent 9417b09f51
commit 80b37c6918

@ -0,0 +1,55 @@
/**
* \file pipeline_project.cpp
* \brief CPipelineProject
* \date 2012-03-03 11:31GMT
* \author Jan Boon (Kaetemi)
* CPipelineProject
*/
/*
* 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 "pipeline_project.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
CPipelineProject::CPipelineProject(CPipelineWorkspace *workspace, NLGEORGES::UForm *form) : m_Workspace(workspace), m_Form(form)
{
}
CPipelineProject::~CPipelineProject()
{
}
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,64 @@
/**
* \file pipeline_project.h
* \brief CPipelineProject
* \date 2012-03-03 11:31GMT
* \author Jan Boon (Kaetemi)
* CPipelineProject
*/
/*
* 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/>.
*/
#ifndef PIPELINE_PIPELINE_PROJECT_H
#define PIPELINE_PIPELINE_PROJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
#include <nel/misc/smart_ptr.h>
#include <nel/georges/u_form.h>
// Project includes
namespace PIPELINE {
class CPipelineWorkspace;
/**
* \brief CPipelineProject
* \date 2012-03-03 11:31GMT
* \author Jan Boon (Kaetemi)
* CPipelineProject
*/
class CPipelineProject
{
protected:
CPipelineWorkspace *m_Workspace;
NLMISC::CRefPtr<NLGEORGES::UForm> m_Form;
public:
CPipelineProject(CPipelineWorkspace *workspace, NLGEORGES::UForm *form);
virtual ~CPipelineProject();
}; /* class CPipelineProject */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_PIPELINE_PROJECT_H */
/* end of file */

@ -33,8 +33,10 @@
// NeL includes // NeL includes
// #include <nel/misc/debug.h> // #include <nel/misc/debug.h>
#include <nel/georges/u_form_elm.h> #include <nel/georges/u_form_elm.h>
#include <nel/misc/path.h>
// Project includes // Project includes
#include "pipeline_project.h"
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;
@ -85,7 +87,11 @@ CPipelineWorkspace::CPipelineWorkspace(NLGEORGES::UFormLoader *formLoader, const
std::string projectSheet; std::string projectSheet;
if (projects->getArrayValue(projectSheet, i)) if (projects->getArrayValue(projectSheet, i))
{ {
m_Projects.push_back(formLoader->loadForm(projectSheet.c_str())); std::string projectName = NLMISC::CFile::getFilenameWithoutExtension(projectSheet);
if (m_Projects.find(projectName) == m_Projects.end())
m_Projects[projectName] = new CPipelineProject(this, formLoader->loadForm(projectSheet.c_str()));
else
nlwarning("Project '%s' in '%s' already", projectSheet.c_str(), m_Form->getFilename().c_str());
} }
else else
{ {
@ -102,7 +108,9 @@ CPipelineWorkspace::CPipelineWorkspace(NLGEORGES::UFormLoader *formLoader, const
CPipelineWorkspace::~CPipelineWorkspace() CPipelineWorkspace::~CPipelineWorkspace()
{ {
for (std::map<std::string, CPipelineProject *>::iterator it = m_Projects.begin(), end = m_Projects.end(); it != end; ++it)
delete (*it).second;
m_Projects.clear();
} }
void CPipelineWorkspace::getProcessPlugins(std::vector<CProcessPluginInfo> &result, const std::string &process) void CPipelineWorkspace::getProcessPlugins(std::vector<CProcessPluginInfo> &result, const std::string &process)

@ -40,6 +40,7 @@
// Project includes // Project includes
namespace PIPELINE { namespace PIPELINE {
class CPipelineProject;
enum TPluginType enum TPluginType
{ {
@ -66,14 +67,15 @@ class CPipelineWorkspace
protected: protected:
NLGEORGES::UFormLoader *m_FormLoader; NLGEORGES::UFormLoader *m_FormLoader;
NLMISC::CRefPtr<NLGEORGES::UForm> m_Form; NLMISC::CRefPtr<NLGEORGES::UForm> m_Form;
std::vector<NLMISC::CRefPtr<NLGEORGES::UForm> > m_Projects;
std::vector<NLMISC::CRefPtr<NLGEORGES::UForm> > m_Plugins; std::vector<NLMISC::CRefPtr<NLGEORGES::UForm> > m_Plugins;
std::map<std::string, CPipelineProject *> m_Projects;
public: public:
CPipelineWorkspace(NLGEORGES::UFormLoader *formLoader, const std::string &sheetName); CPipelineWorkspace(NLGEORGES::UFormLoader *formLoader, const std::string &sheetName);
virtual ~CPipelineWorkspace(); virtual ~CPipelineWorkspace();
void getProcessPlugins(std::vector<CProcessPluginInfo> &result, const std::string &process); void getProcessPlugins(std::vector<CProcessPluginInfo> &result, const std::string &process);
CPipelineProject *getProject(const std::string &project) { return m_Projects[project]; }
}; /* class CPipelineWorkspace */ }; /* class CPipelineWorkspace */

Loading…
Cancel
Save