| 685 | } |
| 686 | |
| 687 | int MacroActionVariable::GetSegmentIndexValue() const |
| 688 | { |
| 689 | auto m = GetMacro(); |
| 690 | if (!m) { |
| 691 | return -1; |
| 692 | } |
| 693 | |
| 694 | auto segment = _macroSegment.lock(); |
| 695 | if (!segment) { |
| 696 | return -1; |
| 697 | } |
| 698 | |
| 699 | if (_action == Action::SET_CONDITION_VALUE) { |
| 700 | auto it = std::find(m->Conditions().begin(), |
| 701 | m->Conditions().end(), segment); |
| 702 | if (it != m->Conditions().end()) { |
| 703 | return std::distance(m->Conditions().begin(), it); |
| 704 | } |
| 705 | return -1; |
| 706 | } else if (_action == Action::SET_ACTION_VALUE) { |
| 707 | auto it = std::find(m->Actions().begin(), m->Actions().end(), |
| 708 | segment); |
| 709 | if (it != m->Actions().end()) { |
| 710 | return std::distance(m->Actions().begin(), it); |
| 711 | } |
| 712 | return -1; |
| 713 | } |
| 714 | |
| 715 | return -1; |
| 716 | } |
| 717 | |
| 718 | void MacroActionVariable::ResolveVariablesToFixedValues() |
| 719 | { |
no test coverage detected