| 580 | } |
| 581 | |
| 582 | void |
| 583 | Space::_commit(const Choice& c, unsigned int a) { |
| 584 | if (a >= c.alternatives()) |
| 585 | throw SpaceIllegalAlternative("Space::commit"); |
| 586 | if (failed()) |
| 587 | return; |
| 588 | if (Brancher* b = brancher(c.bid)) { |
| 589 | // There is a matching brancher |
| 590 | if (pc.p.bid_sc & sc_trace) { |
| 591 | TraceRecorder* tr = findtracerecorder(); |
| 592 | if ((tr != nullptr) && (tr->events() & TE_COMMIT) && |
| 593 | tr->filter()(b->group())) { |
| 594 | CommitTraceInfo cti(*b,c,a); |
| 595 | tr->tracer()._commit(*this,cti); |
| 596 | } |
| 597 | ViewTraceInfo vti = pc.p.vti; |
| 598 | pc.p.vti.brancher(*b); |
| 599 | ExecStatus es = b->commit(*this,c,a); |
| 600 | pc.p.vti = vti; |
| 601 | if (es == ES_FAILED) |
| 602 | fail(); |
| 603 | } else { |
| 604 | if (b->commit(*this,c,a) == ES_FAILED) |
| 605 | fail(); |
| 606 | } |
| 607 | } else { |
| 608 | // There is no matching brancher! |
| 609 | throw SpaceNoBrancher("Space::commit"); |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | void |
| 614 | Space::_trycommit(const Choice& c, unsigned int a) { |
no test coverage detected