| 1231 | } |
| 1232 | |
| 1233 | void cComponentManager::tick(int threadId, long long tickNr, long lastNrun, long tickResultCounts[NUM_TICK_RESULTS]) |
| 1234 | { |
| 1235 | memset(tickResultCounts, 0, sizeof(long) * NUM_TICK_RESULTS); |
| 1236 | if (!ready) { |
| 1237 | return; |
| 1238 | } |
| 1239 | int nRunnable = 0; |
| 1240 | for (int i=0; i<=lastComponent; i++) { |
| 1241 | if (component[i] != NULL) { |
| 1242 | if (((threadId == -1)||(threadId == componentThreadId[i]))&&(componentThreadId[i]!=-2)) { |
| 1243 | nRunnable++; |
| 1244 | SMILE_DBG(4,"~~~~> 'ticking' component '%s' (idx %i)",component[i]->getInstName(),i); |
| 1245 | eTickResult ret = component[i]->tick(tickNr, EOIcondition, lastNrun); |
| 1246 | SMILE_DBG(4,"%s.tick() returned %s",component[i]->getInstName(),tickResultStr(ret)); |
| 1247 | tickResultCounts[ret]++; |
| 1248 | } |
| 1249 | } |
| 1250 | } |
| 1251 | if (tickResultCounts[TICK_SUCCESS] < nRunnable) { |
| 1252 | SMILE_DBG(4,"not all components were run during tick %i (threadID: %i)! (%i<%i)", |
| 1253 | tickNr,threadId,tickResultCounts[TICK_SUCCESS],nRunnable); |
| 1254 | } else { |
| 1255 | SMILE_DBG(4,"ran all components in thread %i (tick: %i)",threadId,(int)tickNr); |
| 1256 | } |
| 1257 | if (execDebug) { // show summary of components executed during this tick |
| 1258 | SMILE_PRINT("SUMMARY tick #%i thread %i, (eoi=%i):\n", (int)tickNr, (int)threadId, EOI); |
| 1259 | printExecDebug(threadId); |
| 1260 | } |
| 1261 | } |
| 1262 | |
| 1263 | // Notifies each component of a pause of the tick loop. |
| 1264 | // Returns 0 if at least one of the components rejected the pause, otherwise 1. |
nothing calls this directly
no test coverage detected