Salome HOME
Increment version: 8.0.0
[modules/yacs.git] / src / hmi / commandsProc.hxx
index 77ca2c1c6df39388b00bc24b36e772196ad3a3da..dfa9df76dcca20e2e3657c92c7dd82ad09308446 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  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
@@ -54,7 +54,7 @@ namespace YACS
     class SubjectOutputDataStreamPort;
     class SubjectLink;
     class SubjectControlLink;
-    class SubjectContainer;
+    class SubjectContainerBase;
     class SubjectComponent;
 
     typedef enum
@@ -527,19 +527,37 @@ namespace YACS
       std::string _inNode;
     };
 
-    class CommandAddContainer: public Command
+    class CommandAddContainerBase : public Command
     {
     public:
-      CommandAddContainer(std::string name,
-                          std::string refContainer ="");
-      SubjectContainer* getSubjectContainer() { return _subcont; };
+      CommandAddContainerBase(std::string name, std::string refContainer);
+      virtual ~CommandAddContainerBase();
+      SubjectContainerBase* getSubjectContainer() { return _subcont; }
     protected:
       virtual bool localExecute();
       virtual bool localReverse();
-      virtual std::string dump();
+      virtual YACS::ENGINE::Container *createNewInstance() const = 0;
       std::string _name;
       std::string _containerToClone;
-      SubjectContainer *_subcont;
+      SubjectContainerBase *_subcont;
+    };
+
+    class CommandAddContainer : public CommandAddContainerBase
+    {
+    public:
+      CommandAddContainer(std::string name, std::string refContainer ="");
+    protected:
+      std::string dump();
+      YACS::ENGINE::Container *createNewInstance() const;
+    };
+
+    class CommandAddHPContainer : public CommandAddContainerBase
+    {
+    public:
+      CommandAddHPContainer(std::string name, std::string refContainer ="");
+    protected:
+      std::string dump();
+      YACS::ENGINE::Container *createNewInstance() const;
     };
 
     class CommandSetContainerProperties: public Command