16 #ifndef ACSDK_SDKCLIENT_INCLUDE_ACSDK_SDKCLIENT_INTERNAL_SDKCLIENTREGISTRY_IMPL_H_ 17 #define ACSDK_SDKCLIENT_INCLUDE_ACSDK_SDKCLIENT_INTERNAL_SDKCLIENTREGISTRY_IMPL_H_ 27 typename std::enable_if<std::is_base_of<FeatureClientInterface, ClientType>::value>
::type*>
29 auto clientTypeId = avsCommon::utils::getTypeIndex<ClientType>();
30 auto it = m_clientMapping.find(clientTypeId);
31 if (it == m_clientMapping.end()) {
34 return std::static_pointer_cast<ClientType>(it->second);
37 template <
typename ComponentType>
40 auto clientTypeId = avsCommon::utils::getTypeIndex<ComponentType>();
41 auto it = m_componentMapping.find(clientTypeId);
42 if (it == m_componentMapping.end()) {
48 template <
typename ComponentType>
49 ACSDK_INLINE_VISIBILITY inline bool SDKClientRegistry::registerComponent(std::shared_ptr<ComponentType> component) {
50 auto clientTypeId = avsCommon::utils::getTypeIndex<ComponentType>();
51 return registerComponent(clientTypeId,
std::move(component));
54 template <
typename AnnotatedName,
typename ComponentType>
56 Annotated<AnnotatedName, ComponentType> component) {
57 auto clientTypeId = avsCommon::utils::getTypeIndex<Annotated<AnnotatedName, ComponentType>>();
58 std::shared_ptr<ComponentType> spComponent =
std::move(component);
59 return registerComponent(clientTypeId,
std::move(spComponent));
62 template <
typename FeatureClientBuilderType>
64 std::unique_ptr<FeatureClientBuilderType> featureBuilder) {
65 internal::AssertFeatureClientBuilderTypeIsValid<FeatureClientBuilderType>();
67 const auto typeIndex =
69 FeatureClientBuilderType,
const std::shared_ptr<SDKClientRegistry>&)>::type::element_type>();
70 auto constructFn = std::bind(&FeatureClientBuilderType::construct, featureBuilder.get(), std::placeholders::_1);
76 #endif // ACSDK_SDKCLIENT_INCLUDE_ACSDK_SDKCLIENT_INTERNAL_SDKCLIENTREGISTRY_IMPL_H_
TypeIndex getTypeIndex()
Definition: TypeIndex.h:133
ADSLComponent getComponent()
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
type
Definition: upload.py:443
const T & move(const T &t)
Definition: gtest-port.h:1317
T type
Definition: Utils.h:28