arcstk::v_1_0_0::ChecksumSet class final

A set of Checksum instances of different types for a single track.

The ChecksumSet represents the calculation result for a single track.

Constructors, destructors, conversion operators

ChecksumSet()
Constructor for a track with unknown length (will be 0)
ChecksumSet(ChecksumSet&& rhs) noexcept
Move constructor.
ChecksumSet(const ChecksumSet& rhs)
Copy constructor.
ChecksumSet(const lba_count_t length) explicit
Constructor.
~ChecksumSet() noexcept
Default destructor.

Public functions

auto begin() -> iterator
Obtain a pointer to the first Checksum.
auto begin() const -> const_iterator
Obtain a pointer to the first Checksum.
auto cbegin() const -> const_iterator
Obtain a pointer to the first Checksum.
auto cend() const -> const_iterator
Obtain a pointer pointing behind the last Checksum.
void clear()
Erases all Checksums contained in the instance.
auto contains(const checksum::type& type) const -> bool
Returns TRUE iff the instance contains a Checksum of the type type.
auto empty() const -> bool
Returns TRUE iff the instance contains no elements, otherwise FALSE.
auto end() -> iterator
Obtain a pointer pointing behind the last Checksum.
auto end() const -> const_iterator
Obtain a pointer pointing behind the last Checksum.
void erase(const checksum::type& type)
Erases the Checksum with the given type.
auto get(const checksum::type type) const -> Checksum
Return the Checksum for the specified type.
auto insert(const checksum::type type, const Checksum& checksum) -> std::pair<iterator, bool>
Inserts a new <type,Checksum> pair to the instance.
auto length() const -> lba_count_t noexcept
Length (in LBA frames) of this track.
void merge(const ChecksumSet& rhs)
Merge the elements of another instance into this instance.
auto size() const -> size_type
Returns the number of elements contained in the instance.
auto types() const -> std::set<checksum::type>
Return the checksum types present in this ChecksumSet.

Function documentation

arcstk::v_1_0_0::ChecksumSet::ChecksumSet(ChecksumSet&& rhs) noexcept

Move constructor.

Parameters
rhs in The instance to move

arcstk::v_1_0_0::ChecksumSet::ChecksumSet(const ChecksumSet& rhs)

Copy constructor.

Parameters
rhs in The instance to copy

arcstk::v_1_0_0::ChecksumSet::ChecksumSet(const lba_count_t length) explicit

Constructor.

Parameters
length in Length in LBA frames of the track

iterator arcstk::v_1_0_0::ChecksumSet::begin()

Obtain a pointer to the first Checksum.

Returns Pointer to the first Checksum

const_iterator arcstk::v_1_0_0::ChecksumSet::begin() const

Obtain a pointer to the first Checksum.

Returns Pointer to the first Checksum

const_iterator arcstk::v_1_0_0::ChecksumSet::cbegin() const

Obtain a pointer to the first Checksum.

Returns Pointer to the first Checksum

const_iterator arcstk::v_1_0_0::ChecksumSet::cend() const

Obtain a pointer pointing behind the last Checksum.

Returns Pointer pointing behind the last Checksum

void arcstk::v_1_0_0::ChecksumSet::clear()

Erases all Checksums contained in the instance.

After clear() has been called the size of the container will be 0 .

bool arcstk::v_1_0_0::ChecksumSet::contains(const checksum::type& type) const

Returns TRUE iff the instance contains a Checksum of the type type.

Parameters
type in The type to lookup the Checksum for
Returns TRUE iff type is present in the instance, otherwise FALSE

bool arcstk::v_1_0_0::ChecksumSet::empty() const

Returns TRUE iff the instance contains no elements, otherwise FALSE.

Returns TRUE iff instance contains no elements, otherwise FALSE

iterator arcstk::v_1_0_0::ChecksumSet::end()

Obtain a pointer pointing behind the last Checksum.

Returns Pointer pointing behind the last Checksum

const_iterator arcstk::v_1_0_0::ChecksumSet::end() const

Obtain a pointer pointing behind the last Checksum.

Returns Pointer pointing behind the last Checksum

void arcstk::v_1_0_0::ChecksumSet::erase(const checksum::type& type)

Erases the Checksum with the given type.

Parameters
type in The type to erase

Iff the given type is not contained in the instance, the call has no effect.

Checksum arcstk::v_1_0_0::ChecksumSet::get(const checksum::type type) const

Return the Checksum for the specified type.

Parameters
type in The checksum::type to return the value
Returns The checksum for the specified type

If there is no Checksum represented for the type, the Checksum returned will be empty().

std::pair<iterator, bool> arcstk::v_1_0_0::ChecksumSet::insert(const checksum::type type, const Checksum& checksum)

Inserts a new <type,Checksum> pair to the instance.

Parameters
type in The key to use
checksum in The checksum for the given key
Returns Pair with an iterator to the inserted value and a status flag

If the key is already present in the instance, the existing checksum will be left unmodified.

The pair returned contains an iterator to the inserted Checksum and a bool that is TRUE iff the insertion was successful. If the insertion was not successful, the value FALSE is returned for the bool and the iterator will point to the element that prevented the insertion.

lba_count_t arcstk::v_1_0_0::ChecksumSet::length() const noexcept

Length (in LBA frames) of this track.

Returns Length of this track in LBA frames

void arcstk::v_1_0_0::ChecksumSet::merge(const ChecksumSet& rhs)

Merge the elements of another instance into this instance.

Parameters
rhs in The list to be merged into the instance
Exceptions
domain_error If rhs.length() != length() and both are != 0

If a key in the other instance is already present in this instance, the corresponding element will be left unmodified.

Trying to merge a set with non-zero length into an instance with non-zero length of different value will cause a std::domain_error. If either rhs or this has zero length, the merge will succeed.

size_type arcstk::v_1_0_0::ChecksumSet::size() const

Returns the number of elements contained in the instance.

Returns Number of elements contained in the instance.

std::set<checksum::type> arcstk::v_1_0_0::ChecksumSet::types() const

Return the checksum types present in this ChecksumSet.

Returns The checksum types in this ChecksumSet