arcstk::v_1_0_0::Match class

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 TRUE iff the specified Match equals this instance.
auto id(int b) const -> bool
TRUE iff the ARId of the specified block matches the ARId of the original request, otherwise FALSE.
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

std::unique_ptr<Match> arcstk::v_1_0_0::Match::clone() const

Clones this instance.

Returns Deep copy of this instance.

int64_t arcstk::v_1_0_0::Match::difference(int b, bool v2) const

Returns the difference for block b .

Parameters
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::equals(const Match& rhs) const noexcept

Return TRUE iff the specified Match equals this instance.

Parameters
rhs in The right hand side of the operation
Returns TRUE iff rhs equals this instance

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
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
in 0-based index of the block to verify in the ARResponse
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_id(int block)

Mark the ARId of the specified block as 'matched'.

Parameters
block in 0-based index of the block to verify
Returns Index position to store the verification flag
Exceptions
std::runtime_error Iff b is out of range

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
in 0-based index of the block to verify in the ARResponse
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

std::unique_ptr<Match> arcstk::v_1_0_0::Match::do_clone() const pure virtual private

Implements clone().

Returns Deep copy of this instance.

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
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

bool arcstk::v_1_0_0::Match::do_id(const int b) const pure virtual private

Implements id(int).

Parameters
in 0-based index of the block to verify in response
Returns TRUE iff the ARId of block b matches the ARId of result
Exceptions
Iff b is out of range

size_t arcstk::v_1_0_0::Match::do_size() const pure virtual private

Implement size().

Returns Number of flags stored

int arcstk::v_1_0_0::Match::do_total_blocks() const pure virtual private

Implements total_blocks().

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
in 0-based index of the block to verify in response
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_per_block().

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_id(int).

Parameters
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_track(b, t, v2).

Parameters
in 0-based index of the block to verify in response
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