arcstk::v_1_0_0::ARResponse class final

Response content from AccurateRip when responding to an request.

An ARResponse represents the HTTP-response of AccurateRip to an request for some ARId.

Syntactically, an ARResponse is essentially an iterable sequence of ARBlocks.

Semantically, an ARResponse represents the collected checksums AccurateRip has obtained for albums with the specified ARId.

Although an ARResponse represents content that is usually not created by the client, the client may nonetheless create an ARResponse on its own or modify an existing instance. This allows for easy testing ARResponse objects.

Public types

using const_iterator = const ARBlock*
A const_iterator over the ARBlocks of an ARResponse.
using iterator = ARBlock*
An iterator over the ARBlocks of an ARResponse.
using size_type = std::size_t
Size type of ARResponse.

Constructors, destructors, conversion operators

ARResponse()
Constructor.
ARResponse(ARResponse&& rhs) noexcept
Move constructor.
ARResponse(const ARResponse& rhs)
Copy constructor.
ARResponse(std::initializer_list<ARBlock> blocks)
Constructor.
~ARResponse() noexcept
Destructor.

Public functions

auto at(const size_type index) const -> const ARBlock&
The ARBlock with the specified 0-based index.
auto begin() const -> const_iterator
Obtain a const_iterator pointing to the first ARBlock.
auto cbegin() const -> const_iterator
Obtain a const_iterator pointing to the first ARBlock.
auto cend() const -> const_iterator
Obtain a const_iterator pointing behind the last ARBlock.
auto end() const -> const_iterator
Obtain a const_iterator pointing behind the last ARBlock.
auto operator[](const size_type index) const -> const ARBlock&
The ARBlock with the specified 0-based index.
auto size() const -> size_type noexcept
Number of ARBlocks in this instance.
auto tracks_per_block() const -> int noexcept
Number of tracks per ARBlock.

Function documentation

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

Move constructor.

Parameters
rhs in Instance to move

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

Copy constructor.

Parameters
rhs in Instance to copy

arcstk::v_1_0_0::ARResponse::ARResponse(std::initializer_list<ARBlock> blocks)

Constructor.

Parameters
blocks in Sequence of blocks

This constructor is intended for testing purposes only.

const ARBlock& arcstk::v_1_0_0::ARResponse::at(const size_type index) const

The ARBlock with the specified 0-based index.

Parameters
index in Index of the ARBlock to read
Returns ARBlock at index index.
Exceptions
std::out_of_range Iff index > ARResponse::size() - 1.

Bounds checking is performed. If index is illegal, an exception is thrown.

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

Obtain a const_iterator pointing to the first ARBlock.

Returns const_iterator pointing to the first ARBlock

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

Obtain a const_iterator pointing to the first ARBlock.

Returns const_iterator pointing to the first ARBlock

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

Obtain a const_iterator pointing behind the last ARBlock.

Returns const_iterator pointing behind the last ARBlock

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

Obtain a const_iterator pointing behind the last ARBlock.

Returns const_iterator pointing behind the last ARBlock

const ARBlock& arcstk::v_1_0_0::ARResponse::operator[](const size_type index) const

The ARBlock with the specified 0-based index.

Parameters
index in The index of the ARBlock to get
Returns ARBlock at index

No bounds checking is performed. For index based access with bounds checking, see at().

size_type arcstk::v_1_0_0::ARResponse::size() const noexcept

Number of ARBlocks in this instance.

Returns Number of ARBlocks in this response

int arcstk::v_1_0_0::ARResponse::tracks_per_block() const noexcept

Number of tracks per ARBlock.

Returns Number of tracks per ARBlocks