X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FDynParaLoop.hxx;h=8eddfceaa739c2250b82b5baadf3df5512cb602e;hb=22868d035fb80bab64e0231d8dfffdf7afc240c3;hp=723b27e2ec43aeab81b29ccf62131d5512e9a11f;hpb=53629c53c7f47f2d86aa47e31206e836290f055a;p=modules%2Fyacs.git diff --git a/src/engine/DynParaLoop.hxx b/src/engine/DynParaLoop.hxx index 723b27e2e..8eddfceaa 100644 --- a/src/engine/DynParaLoop.hxx +++ b/src/engine/DynParaLoop.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2016 CEA/DEN, EDF R&D +// Copyright (C) 2006-2023 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 @@ -25,6 +25,9 @@ #include "AnyInputPort.hxx" #include "AnyOutputPort.hxx" #include "OutputPort.hxx" +#include "NbBranches.hxx" + +#include namespace YACS { @@ -49,7 +52,8 @@ namespace YACS Node *_finalizeNode; unsigned _nbOfEltConsumed; std::vector _execIds; - AnyInputPort _nbOfBranches; + //NbBranches _nbOfBranches2; + std::unique_ptr _nbOfBranches; AnyOutputPort _splittedPort; std::vector _execNodes; std::vector _execInitNodes; @@ -57,13 +61,13 @@ namespace YACS int _initializingCounter; int _unfinishedCounter; int _failedCounter; - double _weight; + ComplexWeight _weight; + double _loopWeight; protected: static const char NAME_OF_SPLITTED_SEQ_OUT[]; static const char OLD_NAME_OF_SPLITTED_SEQ_OUT[]; - static const char NAME_OF_NUMBER_OF_BRANCHES[]; protected: - DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted); + DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted, std::unique_ptr&& branchManager); virtual ~DynParaLoop(); DynParaLoop(const DynParaLoop& other, ComposedNode *father, bool editionOnly); public: @@ -74,9 +78,9 @@ namespace YACS Node *edSetNode(Node *DISOWNnode); Node *edSetInitNode(Node *DISOWNnode); Node *edSetFinalizeNode(Node *DISOWNnode); - virtual bool edAddDFLink(OutPort *start, InPort *end) throw(Exception); + virtual bool edAddDFLink(OutPort *start, InPort *end) ; void init(bool start=true); - InputPort *edGetNbOfBranchesPort() { return &_nbOfBranches; } + InputPort *edGetNbOfBranchesPort() { return _nbOfBranches->getPort(); } int getNumberOfInputPorts() const; int getNumberOfOutputPorts() const; unsigned getNumberOfEltsConsumed() const { return _nbOfEltConsumed; } @@ -84,26 +88,27 @@ namespace YACS std::list getSetOfOutputPort() const; std::list getLocalOutputPorts() const; OutputPort *edGetSamplePort() { return &_splittedPort; } - OutPort *getOutPort(const std::string& name) const throw(Exception); - InputPort *getInputPort(const std::string& name) const throw(Exception); - OutputPort *getOutputPort(const std::string& name) const throw(Exception); + OutPort *getOutPort(const std::string& name) const ; + InputPort *getInputPort(const std::string& name) const ; + OutputPort *getOutputPort(const std::string& name) const ; //! For the moment false is returned : impovement about it coming soon. bool isPlacementPredictableB4Run() const; - void edRemoveChild(Node *node) throw(Exception); - virtual bool edAddChild(Node *DISOWNnode) throw(Exception); + void edRemoveChild(Node *node) ; + bool isLoop() const override { return true; } + virtual bool edAddChild(Node *DISOWNnode) ; std::list edGetDirectDescendants() const; std::list getSetOfInputPort() const; std::list getLocalInputPorts() const; - unsigned getNumberOfBranchesCreatedDyn() const throw(Exception); - Node *getChildByShortName(const std::string& name) const throw(Exception); - Node *getChildByNameExec(const std::string& name, unsigned id) const throw(Exception); + unsigned getNumberOfBranchesCreatedDyn() const ; + Node *getChildByShortName(const std::string& name) const ; + Node *getChildByNameExec(const std::string& name, unsigned id) const ; std::vector getNodes() const { return _execNodes; } // need to use in GUI part for adding observers for clone nodes - double getWeight() const { return _weight; } - void setWeight(double newVal); - double getWeightRegardingDPL() const { return getWeight(); } + ComplexWeight * getWeight(); + void setWeight(double loopWeight); + void getWeightRegardingDPL(ComplexWeight *weight) {weight->addWeight(getWeight());} bool isMultiplicitySpecified(unsigned& value) const; void forceMultiplicity(unsigned value); - virtual void checkBasicConsistency() const throw(Exception); + virtual void checkBasicConsistency() const ; virtual std::string getErrorReport(); void accept(Visitor *visitor); Node * getInitNode(); @@ -111,6 +116,7 @@ namespace YACS Node * getFinalizeNode(); int getMaxLevelOfParallelism() const; void partitionRegardingDPL(const PartDefinition *pd, std::map >& zeMap); + virtual void cleanDynGraph(); protected: void buildDelegateOf(InPort * & port, OutPort *initialStart, const std::list& pointsOfView); void buildDelegateOf(std::pair& port, InPort *finalTarget, const std::list& pointsOfView); @@ -121,9 +127,8 @@ namespace YACS std::map< ComposedNode *, std::list < OutPort *>, SortHierarc >& bw, LinkInfo& info) const; virtual void checkLinkPossibility(OutPort *start, const std::list& pointsOfViewStart, - InPort *end, const std::list& pointsOfViewEnd) throw(Exception); + InPort *end, const std::list& pointsOfViewEnd) ; protected: - void cleanDynGraph(); void prepareInputsFromOutOfScope(int branchNb); void putValueOnBranch(Any *val, unsigned branchId, bool first); TypeOfNode getIdentityOfNotifyerNode(const Node *node, unsigned& id);