22template <
class BaseIf,
class Adapter>
25 "The BaseIf class must define the type AdapterIdType.");
26 static_assert(std::is_same_v<typename BaseIf::AdapterIdType, elt::mal::Uri>,
27 "BaseIf::AdapterIdType must be defined to be elt::mal::Uri.");
29 "The Adapter class must implement the static class attribute "
30 "SUPPORTED_URI_SCHEME, which should be a string.");
32 return uri.scheme().compare(Adapter::SUPPORTED_URI_SCHEME) == 0;
35template <
class BaseIf,
class Adapter>
36std::unique_ptr<BaseIf>
38 return std::make_unique<Adapter>(uri);
bool CanHandle(const elt::mal::Uri &uri) const override
Check if this repository factory is compatible with the given URI.
Definition repositoryFactory.ipp:23
std::unique_ptr< BaseIf > CreateInstance(const elt::mal::Uri &uri) const override
Create a new adapter instance to access the repository specified by the given URI.
Definition repositoryFactory.ipp:37
Definition commandReplier.cpp:22
constexpr bool IS_ADAPTER_ID_TYPE_DEFINED
Is true if the class contains the type declaration for AdapterIdType.
Definition typeTraits.hpp:267
constexpr bool IS_SUPPORTED_URI_SCHEME_DEFINED
Is true if the class contains the member SUPPORTED_URI_SCHEME.
Definition typeTraits.hpp:239
Provides useful mechanisms to test various type traits.