Account for the state of the given task.
| 536 | |
| 537 | // Account for the state of the given task. |
| 538 | void count(const Task& task) |
| 539 | { |
| 540 | switch (task.state()) { |
| 541 | case TASK_STAGING: { ++staging; break; } |
| 542 | case TASK_STARTING: { ++starting; break; } |
| 543 | case TASK_RUNNING: { ++running; break; } |
| 544 | case TASK_KILLING: { ++killing; break; } |
| 545 | case TASK_FINISHED: { ++finished; break; } |
| 546 | case TASK_KILLED: { ++killed; break; } |
| 547 | case TASK_FAILED: { ++failed; break; } |
| 548 | case TASK_LOST: { ++lost; break; } |
| 549 | case TASK_ERROR: { ++error; break; } |
| 550 | case TASK_DROPPED: { ++dropped; break; } |
| 551 | case TASK_UNREACHABLE: { ++unreachable; break; } |
| 552 | case TASK_GONE: { ++gone; break; } |
| 553 | case TASK_GONE_BY_OPERATOR: { ++gone_by_operator; break; } |
| 554 | case TASK_UNKNOWN: { ++unknown; break; } |
| 555 | // No default case allows for a helpful compiler error if we |
| 556 | // introduce a new state. |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | size_t staging; |
| 561 | size_t starting; |
no test coverage detected