Salome HOME
Merge branch 'V8_0_BR'
[modules/yacs.git] / src / engine / Container.cxx
index 08365dfb377efbd5967ec18eec05241715e4b8a5..56ff46279649c9f9636d8a2cd2daf466e51ff671 100644 (file)
@@ -1,31 +1,38 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2015  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.
+// 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.
+// 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
+// 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
+// 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";
+
+const char Container::AOC_ENTRY[]="attached_on_cloning";
+
+Container::Container():_isAttachedOnCloning(false),_proc(0)
 {
 }
 
@@ -33,6 +40,22 @@ Container::~Container()
 {
 }
 
+std::string Container::getDiscreminantStrOfThis(const Task *askingNode) const
+{
+  const void *ptr(this);
+  std::ostringstream oss; oss << ptr;
+  return oss.str();
+}
+
+/*!
+ * If \a val is equal to true the current container 'this' is not destined to be deeply copied on clone call.
+ * If \a val is equal to false the current container 'this' is destined to be deeply copied on clone call.
+ */
+void Container::setAttachOnCloningStatus(bool val) const
+{
+  _isAttachedOnCloning=val;
+}
+
 /*!
  * By calling this method the current container 'this' is not destined to be deeply copied on clone call.
  */
@@ -63,24 +86,9 @@ bool Container::isSupportingRTODefNbOfComp() const
   return true;
 }
 
-void Container::setProperty(const std::string& name, const std::string& value)
-{
-  DEBTRACE("Container::setProperty " << name << " " << value);
-  _propertyMap[name]=value;
-}
-
-std::string Container::getProperty(const std::string& name)
+void Container::setProperties(const std::map<std::string,std::string>& properties)
 {
-  DEBTRACE("Container::getProperty " << name );
-  return _propertyMap[name];
+  for (std::map<std::string,std::string>::const_iterator it=properties.begin();it!=properties.end();++it)
+    setProperty((*it).first,(*it).second);
 }
 
-void Container::setProperties(std::map<std::string,std::string> properties)
-{
-  _propertyMap.clear();
-  std::map<std::string,std::string>::iterator it;
-  for (it = properties.begin(); it != properties.end(); ++it)
-    {
-      setProperty((*it).first, (*it).second); // setProperty virtual and derived
-    }
-}