36 class AnySplitOutputPort;
80 unsigned getNumberOfElements()
const;
81 virtual std::string dump();
86 Any *getValueAtRank(
int i)
const;
101 void init(
bool start=
true);
129 ForEachLoopPassedData(
const std::vector<unsigned int>& passedIds,
const std::vector<SequenceAny *>& passedOutputs,
const std::vector<std::string>& nameOfOutputs);
133 void checkCompatibilyWithNb(
int nbOfElts)
const;
134 void checkLevel2(
const std::vector<AnyInputPort *>& ports)
const;
136 int toAbsId(
int localId)
const;
137 int toAbsIdNot(
int localId)
const;
138 int getNumberOfElementsToDo()
const;
139 void assignAlreadyDone(
const std::vector<SequenceAny *>& execVals)
const;
140 const std::vector<unsigned int>&
getIds()
const {
return _passedIds;}
141 const std::vector<SequenceAny *>&
getOutputs()
const {
return _passedOutputs;}
159 static const char NAME_OF_SPLITTERNODE[];
174 ForEachLoopGen(
const std::string& name,
TypeCode *typeOfDataSplitted, std::unique_ptr<NbBranchesAbstract>&& branchManager);
177 void init(
bool start=
true);
178 void exUpdateState();
179 void exUpdateProgress();
180 void getReadyTasks(std::vector<Task *>& tasks);
181 int getNumberOfInputPorts()
const;
183 void checkNoCyclePassingThrough(
Node *node) ;
184 void selectRunnableTasks(std::vector<Task *>& tasks);
187 std::list<InputPort *> getSetOfInputPort()
const;
188 std::list<InputPort *> getLocalInputPorts()
const;
190 InputPort *getInputPort(
const std::string& name)
const ;
191 OutPort *getOutPort(
const std::string& name)
const ;
192 OutputPort *getOutputPort(
const std::string& name)
const ;
193 Node *getChildByShortName(
const std::string& name)
const ;
194 std::list<OutputPort *> getLocalOutputPorts()
const;
195 void writeDot(std::ostream &os)
const;
196 virtual std::string
typeName() {
return "YACS__ENGINE__ForEachLoop";}
197 virtual void resetState(
int level);
198 std::string getProgress()
const;
199 std::list<ProgressWeight> getProgressWeight()
const;
201 int getNbOfElementsToBeProcessed()
const;
206 std::vector<unsigned int> getPassedResults(
Executor *execut, std::vector<SequenceAny *>& outputs, std::vector<std::string>& nameOfOutputs)
const;
207 void assignPassedResults(
const std::vector<unsigned int>& passedIds,
const std::vector<SequenceAny *>& passedOutputs,
const std::vector<std::string>& nameOfOutputs);
209 const TypeCode* getOutputPortType(
const std::string& portName)
const;
210 void cleanDynGraph()
override;
212 void checkLinkPossibility(
OutPort *start,
const std::list<ComposedNode *>& pointsOfViewStart,
213 InPort *end,
const std::list<ComposedNode *>& pointsOfViewEnd) ;
215 YACS::Event updateStateForInitNodeOnFinishedEventFrom(
Node *node,
unsigned int id);
216 YACS::Event updateStateForWorkNodeOnFinishedEventFrom(
Node *node,
unsigned int id,
bool isNormalFinish);
217 YACS::Event updateStateForFinalizeNodeOnFinishedEventFrom(
Node *node,
unsigned int id);
219 void buildDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView);
220 void getDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView) ;
221 void releaseDelegateOf(
OutPort *portDwn,
OutPort *portUp,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView) ;
223 void pushAllSequenceValues();
224 void createOutputOutOfScopeInterceptors(
int branchNb);
225 void prepareSequenceValues(
int sizeOfSamples);
226 OutPort *getDynOutPortByAbsName(
int branchNb,
const std::string& name);
227 void storeOutValsInSeqForOutOfScopeUse(
int rank,
int branchNb);
231 static void InterceptorizeNameOfPort(std::string& portName);
232 static const char INTERCEPTOR_STR[];
#define YACSLIBENGINE_EXPORT
void getAllRepresented(std::set< OutPort * > &represented) const
bool addInPort(InPort *inPort)
void addRepr(OutPort *repr, InterceptorInputPort *intercptr)
int removeInPort(InPort *inPort, bool forward)
InterceptorInputPort * _intercptr
OutPort * getRepr() const
OutputPort * clone(Node *newHelder) const
AnySplitOutputPort(const std::string &name, Node *node, TypeCode *type)
: Interface for management of storage of data formated dynamically in its TypeCode....
Base class for all composed nodes.
Base class for dynamically (fully or semifully) built graphs.
Base class for all calculation nodes.
FakeNodeForForEachLoop(ForEachLoopGen *loop, bool normalFinish)
Node * simpleClone(ComposedNode *father, bool editionOnly) const
ForEachLoopDyn(const std::string &name, TypeCode *typeOfDataSplitted)
ForEachLoopDyn(const ForEachLoopDyn &other, ComposedNode *father, bool editionOnly)
SplitterNode _splitterNode
unsigned getExecCurrentId() const
std::vector< SequenceAny * > _execVals
int getCurrentIndex() const
std::vector< AnySplitOutputPort * > _outGoingPorts
static const int NOT_RUNNING_BRANCH_ID
std::vector< InterceptorInputPort * > _intecptrsForOutGoingPorts
ports linked to node outside the current scope
FakeNodeForForEachLoop * _nodeForSpecialCases
std::vector< std::vector< AnyInputPort * > > _execOutGoingPorts
ForEachLoopPassedData * _passedData
virtual std::string typeName()
InputPort * edGetSeqOfSamplesPort()
unsigned _execCurrentId
ports created for TypeCodes correctness
std::vector< SequenceAny * > _passedOutputs
const std::vector< unsigned int > & getIds() const
std::vector< std::string > _nameOfOutputs
const std::vector< std::string > & getOutputNames() const
std::vector< unsigned int > _passedIds
std::vector< bool > _flagsIds
const std::vector< SequenceAny * > & getOutputs() const
int getNumberOfEltsAlreadyDone() const
Loop node for parametric calculation.
ForEachLoop(const ForEachLoop &other, ComposedNode *father, bool editionOnly)
ForEachLoop(const std::string &name, TypeCode *typeOfDataSplitted)
friend class InterceptorInputPort
Base class for all nodes.
void putSplittedValueOnRankTo(int rankInSeq, int branch, bool first)
InputPort * getInputPort(const std::string &name) const
SplitterNode(const std::string &name, TypeCode *typeOfData, ForEachLoopGen *father)
SeqAnyInputPort _dataPortToDispatch
void init(bool start=true)
unsigned getNumberOfElements() const
Node * simpleClone(ComposedNode *father, bool editionOnly) const
static const char NAME_OF_SEQUENCE_INPUT[]
Class for sequence objects.
Base class for all type objects.