RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
repositoryFactory.ipp
Go to the documentation of this file.
1
13// Note this is a template implementation file and should not be included directly.
14// The typical header protection macro is not added to avoid it showing up in Doxygen API
15// documentation.
16#pragma once
17
19
21
22template <class BaseIf, class Adapter>
23bool RepositoryFactory<BaseIf, Adapter>::CanHandle(const elt::mal::Uri& uri) const {
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.");
31
32 return uri.scheme().compare(Adapter::SUPPORTED_URI_SCHEME) == 0;
33}
34
35template <class BaseIf, class Adapter>
36std::unique_ptr<BaseIf>
38 return std::make_unique<Adapter>(uri);
39}
40
41} // namespace rtctk::componentFramework
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
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Provides useful mechanisms to test various type traits.