Salome HOME
Save/Load manages HPContainers.
[modules/yacs.git] / src / engine / Container.cxx
index 802fe1dda71bdb727883aabbbc3ea524b9801f27..d922a9deb97ac94d09d07d78a97144803988c9d0 100644 (file)
@@ -1,10 +1,36 @@
+// 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 "Container.hxx"
 #include "ComponentInstance.hxx"
 
+//#define _DEVDEBUG_
+#include "YacsTrace.hxx"
+
+#include <sstream>
+
 using namespace std;
 using namespace YACS::ENGINE;
 
-Container::Container():_isAttachedOnCloning(false)
+const char Container::KIND_ENTRY[]="container_kind";
+
+Container::Container():_isAttachedOnCloning(false),_proc(0)
 {
 }
 
@@ -12,6 +38,13 @@ Container::~Container()
 {
 }
 
+std::string Container::getDiscreminantStrOfThis(const Task *askingNode) const
+{
+  const void *ptr(this);
+  std::ostringstream oss; oss << ptr;
+  return oss.str();
+}
+
 /*!
  * By calling this method the current container 'this' is not destined to be deeply copied on clone call.
  */
@@ -42,13 +75,9 @@ bool Container::isSupportingRTODefNbOfComp() const
   return true;
 }
 
-void Container::setProperty(const std::string& name, const std::string& value)
-{
-  _propertyMap[name]=value;
-}
-
-std::string Container::getProperty(const std::string& name)
+void Container::setProperties(const std::map<std::string,std::string>& properties)
 {
-  return _propertyMap[name];
+  for (std::map<std::string,std::string>::const_iterator it=properties.begin();it!=properties.end();++it)
+    setProperty((*it).first,(*it).second);
 }