v_1_0_0::Match class
#include <include/match.hpp>
Interface: Result of matching Checksums against an ARResponse.
A Match is the result of matching given Checksums against an ARResponse. A Match is obtained by instantiating a Matcher and calling match() on it. It holds the result of any matching operation the Matcher has performed. Access to each of these results is provided in terms of block:track:version. The block and track address components are integers, that refer to the respective 0-based block and 0-based track in the ARResponse. The version is a boolean that indicates whether the match is for ARCSv2 (TRUE) or for ARCSv1 (FALSE).
Constructors, destructors, conversion operators
- ~Match() virtual noexcept
- Virtual default destructor.
Public functions
- auto clone() const -> std::unique_ptr<Match>
- Clones this instance.
- auto difference(int b, bool v2) const -> int64_t
- Returns the difference for block
b. - auto equals(const Match& rhs) const -> bool noexcept
- Return
TRUEiff the specified Match equals this instance. - auto id(int b) const -> bool
TRUEiff the ARId of the specified block matches the ARId of the original request, otherwiseFALSE.- auto size() const -> size_t
- Returns the number of comparison flags stored.
- auto total_blocks() const -> int
- Returns the number of analyzed blocks.
- auto track(int b, int t, bool v2) const -> bool
- Return the verification status of an ARCS of the specified track in the specified block.
- auto tracks_per_block() const -> int
- Returns the number of compared tracks per block.
- auto verify_id(int block) -> int
- Mark the ARId of the specified block as 'matched'.
- auto verify_track(int b, int t, bool v2) -> int
- Mark the checksum of a specified track in a specified block as 'matched'.
Private functions
- auto do_clone() const -> std::unique_ptr<Match> pure virtual
- Implements clone().
- auto do_difference(const int b, const bool v2) const -> int64_t pure virtual
- Implements difference(int, bool).
- auto do_equals(const Match& rhs) const -> bool pure virtual noexcept
- Implements equals().
- auto do_id(const int b) const -> bool pure virtual
- Implements id(int).
- auto do_size() const -> size_t pure virtual
- Implement size().
- auto do_total_blocks() const -> int pure virtual
- Implements total_
blocks(). - auto do_track(const int b, const int t, const bool v2) const -> bool pure virtual
- Implements track(int, int, bool).
- auto do_tracks_per_block() const -> int pure virtual
- Implements tracks_
per_ block(). - auto do_verify_id(const int b) -> int pure virtual
- Implements verify_
id(int). - auto do_verify_track(const int b, const int t, const bool v2) -> int pure virtual
- Implements verify_
track(b, t, v2).
Function documentation
int64_t arcstk:: v_1_0_0:: Match:: difference(int b,
bool v2) const
Returns the difference for block b .
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in the ARResponse |
| v2 in | Returns the ARCSv2 iff TRUE, otherwise ARCSv1 |
| Returns | Difference of block b |
| Exceptions | |
| std::runtime_error | Iff b is out of range |
The difference is the number of ARCSs in b that do not match their corresponsing positions in the request. The difference is only of relevance iff the ARId of b matchs the ARId of the request.
bool arcstk:: v_1_0_0:: Match:: id(int b) const
TRUE iff the ARId of the specified block matches the ARId of the original request, otherwise FALSE.
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in response |
| Returns | TRUE iff the ARId of block b matches the ARId of the request |
| Exceptions | |
| std::runtime_error | Iff b is out of range |
size_t arcstk:: v_1_0_0:: Match:: size() const
Returns the number of comparison flags stored.
| Returns | Number of flags stored |
|---|
int arcstk:: v_1_0_0:: Match:: total_blocks() const
Returns the number of analyzed blocks.
| Returns | Total number of analyzed blocks. |
|---|
This is identical with the total number of blocks in the ARResponse.
bool arcstk:: v_1_0_0:: Match:: track(int b,
int t,
bool v2) const
Return the verification status of an ARCS of the specified track in the specified block.
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in the ARResponse |
| t in | 0-based index of the track to verify in the ARResponse |
| v2 in | Returns the ARCSv2 flag iff TRUE, otherwise ARCSv1 |
| Returns | Flag for ARCS of track t in block b |
| Exceptions | |
| std::runtime_error | Iff b or t are out of range |
int arcstk:: v_1_0_0:: Match:: tracks_per_block() const
Returns the number of compared tracks per block.
| Returns | Total number of tracks per block. |
|---|
This is identical with the total number of tracks in each block in the ARResponse.
int arcstk:: v_1_0_0:: Match:: verify_track(int b,
int t,
bool v2)
Mark the checksum of a specified track in a specified block as 'matched'.
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in the ARResponse |
| t in | 0-based index of the track to verify in the ARResponse |
| v2 in | Verifies the ARCSv2 iff TRUE, otherwise ARCSv1 |
| Returns | Index position to store the verification flag |
| Exceptions | |
| std::runtime_error | Iff b or t are out of range |
int64_t arcstk:: v_1_0_0:: Match:: do_difference(const int b,
const bool v2) const pure virtual private
Implements difference(int, bool).
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in response |
| v2 in | Returns the ARCSv2 iff TRUE, otherwise ARCSv1 |
| Returns | Difference of block b |
| Exceptions | |
| Iff | b is out of range |
int arcstk:: v_1_0_0:: Match:: do_total_blocks() const pure virtual private
Implements total_
| Returns | Total number of compared blocks. |
|---|
bool arcstk:: v_1_0_0:: Match:: do_track(const int b,
const int t,
const bool v2) const pure virtual private
Implements track(int, int, bool).
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in response |
| t in | 0-based index of the track to verify in response |
| v2 in | Returns the ARCSv2 flag iff TRUE, otherwise ARCSv1 |
| Returns | Flag for ARCS of track t in block b |
| Exceptions | |
| Iff | b or t are out of range |
int arcstk:: v_1_0_0:: Match:: do_tracks_per_block() const pure virtual private
Implements tracks_
| Returns | Total number of tracks per block. |
|---|
int arcstk:: v_1_0_0:: Match:: do_verify_id(const int b) pure virtual private
Implements verify_
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in response |
| Returns | Index position to store the verification flag |
int arcstk:: v_1_0_0:: Match:: do_verify_track(const int b,
const int t,
const bool v2) pure virtual private
Implements verify_
| Parameters | |
|---|---|
| b in | 0-based index of the block to verify in response |
| t in | 0-based index of the track to verify in response |
| v2 in | Verifies the ARCSv2 iff TRUE, otherwise ARCSv1 |
| Returns | Index position to store the verification flag |
| Exceptions | |
| Iff | b or t are out of range |