ComponentInstance.cxx
Dispatcher.cxx
Container.cxx
+ HomogeneousPoolContainer.cxx
DeploymentTree.cxx
Logger.cxx
LogRecord.cxx
class Proc;
/*!
* This is an abstract class, that represents an abstract process in which ComponentInstances can be launched and run.
+ * An instance of this will be mapped to one and only one physical container (except in the foreach context)
*/
class YACSLIBENGINE_EXPORT Container : public RefCounter
{
bool isAttachedOnCloning() const;
//! \b WARNING ! clone behaviour \b MUST be in coherence with what is returned by isAttachedOnCloning() method
virtual Container *clone() const = 0;
+ virtual Container *cloneAlways() const = 0;
virtual bool isSupportingRTODefNbOfComp() const;
virtual void checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception) = 0;
virtual void setProperty(const std::string& name,const std::string& value);
--- /dev/null
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HomogeneousPoolContainer.hxx"
+
+using namespace YACS::ENGINE;
+
+HomogeneousPoolContainer::HomogeneousPoolContainer()
+{
+}
+
+HomogeneousPoolContainer::~HomogeneousPoolContainer()
+{
+}
--- /dev/null
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __HOMOGENEOUSPOOLCONTAINER_HXX__
+#define __HOMOGENEOUSPOOLCONTAINER_HXX__
+
+#include "YACSlibEngineExport.hxx"
+#include "Exception.hxx"
+#include "Container.hxx"
+
+#include <list>
+#include <map>
+
+namespace YACS
+{
+ namespace ENGINE
+ {
+ /*!
+ * This is an abstract class, that represents a set of fixed number of worker "kernelcontainers" homegenous in the sense that can be used indifferently each other.
+ * But each of those worker pool can be used once at a time.
+ */
+ class YACSLIBENGINE_EXPORT HomogeneousPoolContainer : public Container
+ {
+ protected:
+ HomogeneousPoolContainer();
+#ifndef SWIG
+ virtual ~HomogeneousPoolContainer();
+#endif
+ };
+ }
+}
+
+#endif
return new ContainerTest;
}
+Container *ContainerTest::cloneAlways() const
+{
+ return new ContainerTest;
+}
+
void ContainerTest::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(YACS::Exception)
{
if(inst->getKind()!=SUPPORTED_COMP_KIND)
return new ContainerTest2;
}
+Container *ContainerTest2::cloneAlways() const
+{
+ return new ContainerTest2;
+}
+
void ContainerTest2::initAllContainers()
{
_counter=0;
bool isAlreadyStarted(const ComponentInstance *inst) const;
void start(const ComponentInstance *inst) throw(Exception);
Container *clone() const;
+ Container *cloneAlways() const;
std::string getPlacementId(const ComponentInstance *inst) const { return ""; }
std::string getFullPlacementId(const ComponentInstance *inst) const { return ""; }
static void initAllContainers();
bool isAlreadyStarted(const ComponentInstance *inst) const;
void start(const ComponentInstance *inst) throw(Exception);
Container *clone() const;
+ Container *cloneAlways() const;
std::string getPlacementId(const ComponentInstance *inst) const { return ""; }
std::string getFullPlacementId(const ComponentInstance *inst) const { return ""; }
static void initAllContainers();
%newobject *::createInputDataStreamPort;
%newobject *::createOutputDataStreamPort;
%newobject *::clone;
+%newobject *::cloneAlways;
%newobject *::New;
//Take ownership : transfer it from C++ (has to be completed)
if (proc->containerMap.count(cont->getName()) == 0)
{
//container exists but is not in containerMap. Clone it, it's probably the result of copy paste from outside the proc
- Container* newcont;
- if(cont->isAttachedOnCloning())
- {
- cont->dettachOnCloning();
- newcont=cont->clone();
- cont->attachOnCloning();
- newcont->attachOnCloning();
- }
- else
- newcont=cont->clone();
-
+ Container* newcont(cont->cloneAlways());
proc->containerMap[cont->getName()]=newcont;
instance->setContainer(newcont);
GuiContext::getCurrent()->getSubjectProc()->addSubjectContainer(newcont, newcont->getName());
return new CppContainer(*this);
}
+Container *CppContainer::cloneAlways() const
+{
+ return new CppContainer(*this);
+}
+
bool CppContainer::loadComponentLibrary(const std::string & componentName) throw (YACS::Exception)
{
if (_trueCont)
std::string getPlacementId(const ComponentInstance *inst) const;
std::string getFullPlacementId(const ComponentInstance *inst) const;
YACS::ENGINE::Container *clone() const;
-
+ Container *cloneAlways() const;
void lock();
void unLock();
return new SalomeContainer(*this);
}
+Container *SalomeContainer::cloneAlways() const
+{
+ return new SalomeContainer(*this);
+}
+
void SalomeContainer::checkCapabilityToDealWith(const ComponentInstance *inst) const throw(YACS::Exception)
{
if(inst->getKind()!=SalomeComponent::KIND)
Engines::Container_ptr getContainerPtr(const ComponentInstance *inst) const;
void start(const ComponentInstance *inst) throw (Exception);
Container *clone() const;
+ Container *cloneAlways() const;
std::string getPlacementId(const ComponentInstance *inst) const;
std::string getFullPlacementId(const ComponentInstance *inst) const;
void checkCapabilityToDealWith(const ComponentInstance *inst) const throw (Exception);