20 #ifndef __FOREACHLOOP_HXX__
21 #define __FOREACHLOOP_HXX__
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[];
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)
throw(
Exception);
184 void selectRunnableTasks(std::vector<Task *>& tasks);
187 std::list<InputPort *> getSetOfInputPort()
const;
188 std::list<InputPort *> getLocalInputPorts()
const;
193 Node *getChildByShortName(
const std::string& name)
const throw(
Exception);
194 std::list<OutputPort *> getLocalOutputPorts()
const;
196 void writeDot(std::ostream &os)
const;
197 virtual std::string
typeName() {
return "YACS__ENGINE__ForEachLoop";}
198 virtual void resetState(
int level);
199 std::string getProgress()
const;
200 std::list<ProgressWeight> getProgressWeight()
const;
202 int getNbOfElementsToBeProcessed()
const;
207 std::vector<unsigned int> getPassedResults(
Executor *execut, std::vector<SequenceAny *>& outputs, std::vector<std::string>& nameOfOutputs)
const;
208 void assignPassedResults(
const std::vector<unsigned int>& passedIds,
const std::vector<SequenceAny *>& passedOutputs,
const std::vector<std::string>& nameOfOutputs);
210 const TypeCode* getOutputPortType(
const std::string& portName)
const;
213 void checkLinkPossibility(
OutPort *start,
const std::list<ComposedNode *>& pointsOfViewStart,
214 InPort *end,
const std::list<ComposedNode *>& pointsOfViewEnd)
throw(
Exception);
216 YACS::Event updateStateForInitNodeOnFinishedEventFrom(
Node *node,
unsigned int id);
217 YACS::Event updateStateForWorkNodeOnFinishedEventFrom(
Node *node,
unsigned int id,
bool isNormalFinish);
218 YACS::Event updateStateForFinalizeNodeOnFinishedEventFrom(
Node *node,
unsigned int id);
220 void buildDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView);
221 void getDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView)
throw(
Exception);
222 void releaseDelegateOf(
OutPort *portDwn,
OutPort *portUp,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView)
throw(
Exception);
224 void cleanDynGraph();
225 void pushAllSequenceValues();
226 void createOutputOutOfScopeInterceptors(
int branchNb);
227 void prepareSequenceValues(
int sizeOfSamples);
228 OutPort *getDynOutPortByAbsName(
int branchNb,
const std::string& name);
229 void storeOutValsInSeqForOutOfScopeUse(
int rank,
int branchNb);
233 static void InterceptorizeNameOfPort(std::string& portName);
234 static const char INTERCEPTOR_STR[];