VerificationResult class
#include <verify.hpp>
Interface: Result of a verification process.
A VerificationResult is the result of a complete matching of actual Checksums against a ChecksumSource of referene checksums.
It holds the result of any verification task of any reference track value. Access to each of these results is provided in terms of block:track:Version information. The block and track address components are integers, that refer to the respective 0-based block and 0-based track in the ChecksumSource. The Version information is a boolean that indicates whether the match is for ARCSv2 (TRUE) or for ARCSv1 (FALSE).
The result contains also the track-based interpretation of the flags, i.e. whether a given track is considered to be verified or not.
Constructors, destructors, conversion operators
- ~VerificationResult() virtual noexcept
- Virtual default destructor.
Public functions
- auto all_tracks_verified() const -> bool
- TRUE iff each track is verified.
- auto best_block() const -> std::tuple<int, bool, int>
- Identify best matching block (the one with smallest difference).
- auto best_block_difference() const -> int
- Difference of the best block in this result.
- auto clone() const -> std::unique_ptr<VerificationResult>
- Returns a deep copy of the instance.
- auto difference(int b, bool v2) const -> int
- Returns the difference for block
b. - auto id(int b) const -> bool
TRUEiff the ARId of the specified block matches the ARId of the original request, otherwiseFALSE.- auto is_verified(const int track) const -> bool
- TRUE iff specified 0-based track is verified, otherwise FALSE.
- auto size() const -> size_t
- Returns the number of comparison flags stored.
- auto strict() const -> bool
- TRUE iff verification obeys a strict policy.
- auto total_blocks() const -> int
- Returns the number of analyzed reference blocks.
- auto total_unverified_tracks() const -> int
- Total number of unverified tracks.
- 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 reference 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'.
Function documentation
bool arcstk:: VerificationResult:: all_tracks_verified() const
TRUE iff each track is verified.
| Returns | TRUE iff each track is verified otherwise FALSE |
|---|
This is shorthand for checking whether total_
A rip for which all tracks are verified can be considered accurate relative to the applied verification method. Iff the method is strict, then a total match requires at least one block in the ChecksumSource that is identical to the list of actual Checksums. Iff the method is non-strict, every actual Checksum occurred at least in one block of the ChecksumSource.
std::tuple<int, bool, int> arcstk:: VerificationResult:: best_block() const
Identify best matching block (the one with smallest difference).
| Returns | 0-based index, ARCS version, and difference of the best block |
|---|
If there is more than one block with the smallest difference, return the one with the lowest index position.
int arcstk:: VerificationResult:: best_block_difference() const
Difference of the best block in this result.
| Returns | Smallest difference of any block |
|---|
This is shorthand for getting element 2 of best_
std::unique_ptr<VerificationResult> arcstk:: VerificationResult:: clone() const
Returns a deep copy of the instance.
| Returns | A deep copy of the instance |
|---|
int arcstk:: VerificationResult:: 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 ChecksumSource |
| 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:: VerificationResult:: 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 |
bool arcstk:: VerificationResult:: is_verified(const int track) const
TRUE iff specified 0-based track is verified, otherwise FALSE.
| Parameters | |
|---|---|
| track in | 0-based track |
| Returns | TRUE iff specified track is verified, otherwise FALSE |
size_t arcstk:: VerificationResult:: size() const
Returns the number of comparison flags stored.
| Returns | Number of flags stored |
|---|
bool arcstk:: VerificationResult:: strict() const
TRUE iff verification obeys a strict policy.
| Returns | TRUE iff verification obeys a strict policy, otherwise FALSE. |
|---|
int arcstk:: VerificationResult:: total_blocks() const
Returns the number of analyzed reference blocks.
| Returns | Total number of analyzed blocks. |
|---|
This is identical to the total number of blocks in the ChecksumSource.
int arcstk:: VerificationResult:: total_unverified_tracks() const
Total number of unverified tracks.
| Returns | Total number of unverified tracks. |
|---|
bool arcstk:: VerificationResult:: 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 ChecksumSource |
| t in | 0-based index of the track to verify in the ChecksumSource |
| 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:: VerificationResult:: tracks_per_block() const
Returns the number of compared tracks per reference block.
| Returns | Total number of tracks per block. |
|---|
This is identical to the total number of tracks in each block in the ChecksumSource.
int arcstk:: VerificationResult:: 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 ChecksumSource |
| t in | 0-based index of the track to verify in the ChecksumSource |
| 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 |