21template <
class BaseIf,
class Adapter>
24 "The BaseIf class must define the type AdapterIdType.");
25 static_assert(std::is_same_v<typename BaseIf::AdapterIdType, elt::mal::Uri>,
26 "BaseIf::AdapterIdType must be defined to be elt::mal::Uri.");
28 "The Adapter class must implement the static class attribute "
29 "SUPPORTED_URI_SCHEME, which should be a string.");
31 return uri.scheme().compare(Adapter::SUPPORTED_URI_SCHEME) == 0;
34template <
class BaseIf,
class Adapter>
35std::unique_ptr<BaseIf>
37 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:22
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:36
constexpr bool IS_ADAPTER_ID_TYPE_DEFINED
Is true if the class contains the type declaration for AdapterIdType.
Definition typeTraits.hpp:266
constexpr bool IS_SUPPORTED_URI_SCHEME_DEFINED
Is true if the class contains the member SUPPORTED_URI_SCHEME.
Definition typeTraits.hpp:238
Definition commandReplier.cpp:21
Provides useful mechanisms to test various type traits.