Salome HOME
Introduction of CMake build procedure for YACS module.
[modules/yacs.git] / src / engine / ElementaryNode.hxx
index aecf8efbcfdd0d661e986f2ac845e42792f15167..84096a88c1a65ca3bf5d46d97d3e47d81470e97a 100644 (file)
@@ -1,10 +1,32 @@
+// Copyright (C) 2006-2013  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 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #ifndef __ELEMENTARYNODE_HXX__
 #define __ELEMENTARYNODE_HXX__
 
+#include "YACSlibEngineExport.hxx"
 #include "Node.hxx"
 #include "Task.hxx"
 #include "define.hxx"
+
 #include <string>
+#include <algorithm>
 
 namespace YACS
 {
@@ -18,7 +40,7 @@ namespace YACS
     class InputDataStreamPort;
     class OutputDataStreamPort;
 
-    class ElementaryNode : public Node, public Task
+    class YACSLIBENGINE_EXPORT ElementaryNode : public Node, public Task
     {
       friend class ComposedNode;
     protected:
@@ -26,6 +48,10 @@ namespace YACS
       std::list<OutputPort *> _setOfOutputPort;
       std::list<InputDataStreamPort *> _setOfInputDataStreamPort;
       std::list<OutputDataStreamPort *> _setOfOutputDataStreamPort;
+
+      // Management of multi property
+      bool _createDatastreamPorts;
+      bool _multi_port_node;
     protected:
       ElementaryNode(const std::string& name);
       ElementaryNode(const ElementaryNode& other, ComposedNode *father);
@@ -36,6 +62,7 @@ namespace YACS
       void init(bool start=true);
       bool isDeployable() const;
       ComponentInstance *getComponent();
+      Container *getContainer();
       YACS::StatesForNode getState() const;
       void getReadyTasks(std::vector<Task *>& tasks);
       void edRemovePort(Port *port) throw(Exception);
@@ -69,6 +96,9 @@ namespace YACS
       virtual OutputPort *edAddOutputPort(const std::string& outputPortName, TypeCode* type) throw(Exception);
       virtual InputDataStreamPort *edAddInputDataStreamPort(const std::string& inputPortDSName, TypeCode* type) throw(Exception);
       virtual OutputDataStreamPort *edAddOutputDataStreamPort(const std::string& outputPortDSName, TypeCode* type) throw(Exception);
+      virtual void edOrderInputPorts(const std::list<InputPort*>& ports);
+      virtual void edOrderOutputPorts(const std::list<OutputPort*>& ports);
+
       virtual std::string typeName() {return "YACS__ENGINE__ElementaryNode";}
       virtual void edUpdateState();
       virtual void ensureLoading();
@@ -79,13 +109,24 @@ namespace YACS
       void finished();
       void aborted();
       void loaded();
+      void connected();
       virtual std::string getErrorDetails();
       virtual void initService() { }
       virtual void connectService() { }
       virtual void disconnectService() { }
       virtual void load() { }
+      virtual void getCoupledTasks(std::set<Task*>& coupledSet);
+      virtual void getCoupledNodes(std::set<Task*>& coupledSet);
       void accept(Visitor *visitor);
+
+      // Used for runtime nodes that need
+      // to configure their services for the multi property
+      virtual void addDatastreamPortToInitMultiService(const std::string & port_name,
+                                                       int number) {}
     protected:
+      // Management of multi property
+      virtual void createMultiDatastreamPorts();
+
       void edDisconnectAllLinksWithMe();
       bool areAllInputPortsValid() const;
       template<class PORT>