Salome HOME
Fix the python API of the savestate feature.
[modules/yacs.git] / src / engine / Proc.hxx
index 1da58cad32183f80643e553df8bfdb5fd439f342..95cc82d5700c1c0350482f8cbefdc6ab7543d46c 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2006-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016  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.
+// 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
@@ -40,7 +40,7 @@ namespace YACS
     class ComponentInstance;
     class Logger;
 
-    class YACSLIBENGINE_EXPORT Proc: public Bloc
+    class YACSLIBENGINE_EXPORT Proc : public Bloc
     {
     public:
       Proc(const std::string& name);
@@ -51,10 +51,10 @@ namespace YACS
       virtual TypeCode *createSequenceTc (const std::string& id, const std::string& name, 
                                          TypeCode *content);
       virtual TypeCode *createStructTc (const std::string& id, const std::string& name);
-      virtual TypeCodegetTypeCode(const std::string& name);
+      virtual TypeCode *getTypeCode(const std::string& name);
       virtual void setTypeCode(const std::string& name,TypeCode *t);
-      virtual Container* createContainer(const std::string& name,const std::string& kind="");
-      virtual ComponentInstance* createComponentInstance(const std::string& componame, 
+      virtual Container *createContainer(const std::string& name, const std::string& kind="");
+      virtual ComponentInstance *createComponentInstance(const std::string& componame,
                                                          const std::string& name="",
                                                          const std::string& kind="");
       virtual void addComponentInstance(ComponentInstance* inst, const std::string& name="",bool resetCtr=false);
@@ -62,9 +62,12 @@ namespace YACS
       virtual void removeContainer(Container* cont);
       virtual void accept(Visitor *visitor);
       virtual Proc *getProc();
-      virtual const Proc * getProc() const;
+      virtual const Proc *getProc() const;
+      virtual void updateContainersAndComponents();
 
       YACS::StatesForNode getNodeState(int numId);
+      std::string getNodeProgress(int numId);
+      int getGlobalProgressPercent();
       std::string getInPortValue(int nodeNumId, std::string portName);
       std::string setInPortValue(std::string nodeName, std::string portName, std::string value);
       std::string getOutPortValue(int nodeNumId, std::string portName);
@@ -94,8 +97,12 @@ namespace YACS
       virtual bool getEdition(){return _edition;}
       virtual void setEdition(bool edition);
       virtual void modified();
-      virtual void saveSchema(std::string xmlSchemaFile);
-      virtual void saveState(std::string xmlStateFile);
+      virtual void saveSchema(const std::string& xmlSchemaFile);
+      //! deprecated. See VisitorSalomeSaveState and schemaSaveState in order
+      //! to deal with the execution state of ForEachLoop.
+      virtual void saveState(const std::string& xmlStateFile);
+    protected:
+      void removeContainers();
     protected:
       bool _edition;
       int _compoinstctr;