Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / engine / InlineNode.hxx
index 07ab9097234a357b1915ac8f2738459a51d3344a..e7bd37f268b1c77ed2abf18732c239081b6292da 100644 (file)
@@ -1,24 +1,26 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2012  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.
 //
-//  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
 //
+
 #ifndef __INLINENODE_HXX__
 #define __INLINENODE_HXX__
 
+#include "YACSlibEngineExport.hxx"
 #include "ElementaryNode.hxx"
 #include <string>
 
@@ -26,6 +28,8 @@ namespace YACS
 {
   namespace ENGINE
   {
+    class Container;
+
 /*! \brief Class for calculation node (script) inlined (and executed) in the schema
  *
  * \ingroup Nodes
@@ -36,18 +40,14 @@ namespace YACS
  * \see ServiceNode
  * \see ElementaryNode
  */
-    class InlineNode : public ElementaryNode 
+    class YACSLIBENGINE_EXPORT InlineNode : public ElementaryNode 
     {
     protected:
       InlineNode(const InlineNode& other, ComposedNode *father)
-        :ElementaryNode(other,father),_script(other._script) { }
-      InlineNode(const std::string& name):ElementaryNode(name) { }
+        :ElementaryNode(other,father),_script(other._script),_mode(other._mode),_container(0) { }
+      InlineNode(const std::string& name):ElementaryNode(name),_mode("local"),_container(0) { }
     public:
-//! Set the script (as a string) to execute
-/*!
- * \param script: script to execute
- */
-      virtual void setScript(const std::string& script) { _script=script; }
+      virtual void setScript(const std::string& script);
       virtual std::string getScript(){return _script;}
 
 //! Return a new InlineNode node by making a copy of this node
@@ -60,8 +60,16 @@ namespace YACS
       virtual void accept(Visitor *visitor);
       virtual ~InlineNode();
       virtual std::string typeName() {return "YACS__ENGINE__InlineNode";}
+      virtual void setExecutionMode(const std::string& mode);
+      virtual std::string getExecutionMode();
+      virtual void setContainer(Container* container);
+      virtual Container* getContainer();
+      void performDuplicationOfPlacement(const Node& other);
+      bool isDeployable() const;
     protected:
       std::string _script;
+      std::string _mode;
+      Container* _container;
     };
 
 /*! \brief Class for calculation node (function) inlined (and executed) in the schema
@@ -76,7 +84,7 @@ namespace YACS
  * \see ServiceNode
  * \see ElementaryNode
  */
-    class InlineFuncNode : public InlineNode
+    class YACSLIBENGINE_EXPORT InlineFuncNode : public InlineNode
     {
     protected:
       InlineFuncNode(const InlineFuncNode& other, ComposedNode *father)
@@ -87,11 +95,12 @@ namespace YACS
 /*!
  * \param fname: name of the function contained in the script to execute
  */
-      virtual void setFname(const std::string& fname) { _fname=fname; }
+      virtual void setFname(const std::string& fname);
       virtual std::string getFname() { return _fname; }
       void accept(Visitor *visitor);
       virtual ~InlineFuncNode();
       virtual std::string typeName() {return "YACS__ENGINE__InlineFuncNode";}
+      virtual void checkBasicConsistency() const throw(Exception);
     protected:
       std::string _fname;
     };