class
#include <include/match.hpp>
v_1_0_0::Matcher Interface: Try to Match Checksums against a specified ARResponse.
A Matcher implements a concrete logic of matching Checksums against a specified ARResponse. This logic defines which comparisons are actually performed, in which order and which input information is actually considered. Different Matchers may therefore produce Matches with different content on identical input.
Constructors, destructors, conversion operators
- ~Matcher() virtual noexcept
- Virtual default destructor.
Public functions
- auto best_difference() const -> int noexcept
- Returns the difference value of the ARBlock with index best_
match(). - auto best_match() const -> int noexcept
- Returns the 0-based index of the best matching block in the ARResponse.
- auto best_match_is_v2() const -> bool noexcept
- Returns
TRUE
iff the ARBlock with index best_match() matches the ARCSsv2 of the request, otherwise FALSE
. - auto clone() const -> std::unique_ptr<Matcher> noexcept
- Clones this instance.
- auto equals(const Matcher& rhs) const -> bool noexcept
- Return
TRUE
iff the specified Matcher equals this instance. - auto match() const -> const Match* noexcept
- Returns the actual Match.
- auto matches() const -> bool noexcept
- Returns
TRUE
iff at least one block in the ARResponse has a difference() of0
to either the ARCSs v1 or the ARCSs v2 in the request.
Private functions
- auto do_best_difference() const -> int pure virtual noexcept
- Implements best_
difference(). - auto do_best_match() const -> int pure virtual noexcept
- Implements best_
match(). - auto do_best_match_is_v2() const -> bool pure virtual noexcept
- Implements best_
match_ is_ v2(). - auto do_clone() const -> std::unique_ptr<Matcher> pure virtual noexcept
- Implements clone().
- auto do_equals(const Matcher& rhs) const -> bool pure virtual noexcept
- Implements equals().
- auto do_match() const -> const Match* pure virtual noexcept
- Implements match().
- auto do_matches() const -> bool pure virtual noexcept
- Implements matches().
Function documentation
int arcstk:: v_1_0_0:: Matcher:: best_difference() const noexcept
Returns the difference value of the ARBlock with index best_
Returns | Difference value of best block |
---|
The difference is the sum of the number of non-matching ARCSs and the number of non-matching ARIds in a single block. A block whose ARId does not match the ARId of the result has therefore at least a difference of 1
to the result.
int arcstk:: v_1_0_0:: Matcher:: best_match() const noexcept
Returns the 0-based index of the best matching block in the ARResponse.
Returns | 0-based index of the best matching block in response |
---|
If there is an ARCSv1 block that matches equally good as another ARCSv2 block, best_
bool arcstk:: v_1_0_0:: Matcher:: best_match_is_v2() const noexcept
Returns TRUE
iff the ARBlock with index best_FALSE
.
Returns | TRUE if best_ was to the ARCSsv2 in the ARResponse |
---|
bool arcstk:: v_1_0_0:: Matcher:: matches() const noexcept
Returns TRUE
iff at least one block in the ARResponse has a difference() of 0
to either the ARCSs v1 or the ARCSs v2 in the request.
Returns | TRUE if response contains a block matching result |
---|
int arcstk:: v_1_0_0:: Matcher:: do_best_difference() const pure virtual private noexcept
Implements best_
Returns | Difference value of best block |
---|
int arcstk:: v_1_0_0:: Matcher:: do_best_match() const pure virtual private noexcept
Implements best_
Returns | 0-based index of the best matching block in response |
---|
bool arcstk:: v_1_0_0:: Matcher:: do_best_match_is_v2() const pure virtual private noexcept
Implements best_
Returns | TRUE if best_ was a match to the ARCSsv2 |
---|
bool arcstk:: v_1_0_0:: Matcher:: do_matches() const pure virtual private noexcept
Implements matches().
Returns | TRUE if response contains a block matching result |
---|