| 611 | } |
| 612 | |
| 613 | void |
| 614 | Space::_trycommit(const Choice& c, unsigned int a) { |
| 615 | if (a >= c.alternatives()) |
| 616 | throw SpaceIllegalAlternative("Space::commit"); |
| 617 | if (failed()) |
| 618 | return; |
| 619 | if (Brancher* b = brancher(c.bid)) { |
| 620 | // There is a matching brancher |
| 621 | if (pc.p.bid_sc & sc_trace) { |
| 622 | TraceRecorder* tr = findtracerecorder(); |
| 623 | if ((tr != nullptr) && (tr->events() & TE_COMMIT) && |
| 624 | tr->filter()(b->group())) { |
| 625 | CommitTraceInfo cti(*b,c,a); |
| 626 | tr->tracer()._commit(*this,cti); |
| 627 | } |
| 628 | ViewTraceInfo vti = pc.p.vti; |
| 629 | pc.p.vti.brancher(*b); |
| 630 | ExecStatus es = b->commit(*this,c,a); |
| 631 | pc.p.vti = vti; |
| 632 | if (es == ES_FAILED) |
| 633 | fail(); |
| 634 | } else { |
| 635 | if (b->commit(*this,c,a) == ES_FAILED) |
| 636 | fail(); |
| 637 | } |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | NGL* |
| 642 | Space::ngl(const Choice& c, unsigned int a) { |