19 typedef std::map<Integer_t, Integer_t> MapType;
23 Matching(
size_t id1,
size_t id2) : branch1_id_(id1), branch2_id_(id2){};
24 Matching(
size_t id1,
size_t id2, MapType match, MapType match_inverted) : branch1_id_(id1),
26 match_(std::move(match)),
27 match_inverted_(std::move(match_inverted)){};
31 void AddMatch(Integer_t id1, Integer_t id2) {
32 match_.insert(std::make_pair(id1, id2));
33 match_inverted_.insert(std::make_pair(id2, id1));
36 ANALYSISTREE_ATTR_NODISCARD Integer_t GetMatchDirect(Integer_t
id)
const;
37 ANALYSISTREE_ATTR_NODISCARD Integer_t GetMatchInverted(Integer_t
id)
const;
38 ANALYSISTREE_ATTR_NODISCARD Integer_t GetMatch(Integer_t
id,
bool is_inverted =
false)
const {
39 return is_inverted ? GetMatchInverted(
id) : GetMatchDirect(
id);
42 ANALYSISTREE_ATTR_NODISCARD
const MapType& GetMatches(
bool is_inv =
false)
const {
43 return is_inv ? match_inverted_ : match_;
48 match_inverted_.clear();
51 ANALYSISTREE_ATTR_NODISCARD
size_t GetBranch1Id()
const {
return branch1_id_; }
52 ANALYSISTREE_ATTR_NODISCARD
size_t GetBranch2Id()
const {
return branch2_id_; }
54 void SetMatches(MapType match, MapType match_inv) {
55 match_ = std::move(match);
56 match_inverted_ = std::move(match_inv);
60 size_t branch1_id_{0};
61 size_t branch2_id_{0};
64 MapType match_inverted_{};