arcsdec::v_1_0_0::FileReaderSelector class

Interface for a selector on a set of FileReaderDescriptor instances.

Derived classes

class v_1_0_0::DefaultSelector final
Selector for highest preference.
class v_1_0_0::IdSelector final
FileReaderSelector for a specific descriptor id.

Constructors, destructors, conversion operators

~FileReaderSelector() virtual noexcept
Virtual default destructor.

Public functions

auto select(const Format format, const Codec codec, const FileReaders& descs, const DescriptorPreference& pref_model) const -> std::unique_ptr<FileReaderDescriptor>
Selects a descriptor for the specified Format and Codec.

Function documentation

std::unique_ptr<FileReaderDescriptor> arcsdec::v_1_0_0::FileReaderSelector::select(const Format format, const Codec codec, const FileReaders& descs, const DescriptorPreference& pref_model) const

Selects a descriptor for the specified Format and Codec.

Parameters
format in File format
codec in Audio codec
descs in Set of descriptors to select from
pref_model in Preference model for selecting descriptors
Returns A FileReaderDescriptor that accepts format and codec

The concrete implementation is supposed to use pref_model to establish a preference ordering on the set of descriptors. Based on this ordering the implementation of select() is free to decide which position of the ordering is the one to pick.