+// 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
{
class InputDataStreamPort;
class OutputDataStreamPort;
- class ElementaryNode : public Node, public Task
+ class YACSLIBENGINE_EXPORT ElementaryNode : public Node, public Task
{
friend class ComposedNode;
protected:
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);
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);
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();
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>