Salome HOME
Use tempfile.mkdtemp to create temporary directory
[modules/yacs.git] / src / engine / Container.cxx
index 56ff46279649c9f9636d8a2cd2daf466e51ff671..59539eba8dbedf047e8877b17af8b94c0d5c850b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022  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
@@ -32,6 +32,8 @@ const char Container::KIND_ENTRY[]="container_kind";
 
 const char Container::AOC_ENTRY[]="attached_on_cloning";
 
+const char Container::USE_PYCACHE_PROPERTY[]="use_py_cache";
+
 Container::Container():_isAttachedOnCloning(false),_proc(0)
 {
 }
@@ -47,6 +49,18 @@ std::string Container::getDiscreminantStrOfThis(const Task *askingNode) const
   return oss.str();
 }
 
+void Container::start(const Task *askingNode,
+                      const std::string& resource_name,
+                      const std::string& container_name)
+{
+  return start(askingNode);
+}
+
+bool Container::canAcceptImposedResource()
+{
+  return false;
+}
+
 /*!
  * 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.
@@ -92,3 +106,27 @@ void Container::setProperties(const std::map<std::string,std::string>& propertie
     setProperty((*it).first,(*it).second);
 }
 
+bool Container::isUsingPythonCache()
+{
+  bool found = false;
+  std::string str_value;
+  str_value = getProperty(USE_PYCACHE_PROPERTY);
+  const char* yes_values[] = {"YES", "Yes", "yes", "TRUE", "True", "true", "1",
+                              "ON", "on", "On"};
+  for(const char* v : yes_values)
+    if(str_value == v)
+    {
+      found = true;
+      break;
+    }
+  return found;
+}
+
+void Container::usePythonCache(bool v)
+{
+  if(v)
+    setProperty(USE_PYCACHE_PROPERTY, "1");
+  else
+    setProperty(USE_PYCACHE_PROPERTY, "0");
+}
+