AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
ComponentAccumulator_imp.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKMANUFACTORY_INTERNAL_COMPONENTACCUMULATOR_IMP_H_
17 #define ACSDKMANUFACTORY_INTERNAL_COMPONENTACCUMULATOR_IMP_H_
18 
21 
22 namespace alexaClientSDK {
23 namespace acsdkManufactory {
24 
25 template <>
27 }
28 
29 template <typename... Parameters>
30 template <typename... RhsParameters>
32  m_cookBook{rhs.getCookBook()} {
33 }
34 
35 template <typename... Parameters>
36 template <typename Type, typename... Dependencies>
38  Parameters...>::addUniqueFactory(Type (*factory)(Dependencies...)) {
39  m_cookBook.addUniqueFactory(factory);
40  return *this;
41 }
42 
43 template <typename... Parameters>
44 template <typename Type, typename... Dependencies>
46  Parameters...>::addPrimaryFactory(std::function<Type(Dependencies...)> factory) {
47  m_cookBook.addPrimaryFactory(factory);
48  return *this;
49 }
50 
51 template <typename... Parameters>
52 template <typename Type, typename... Dependencies>
54  Parameters...>::addPrimaryFactory(Type (*factory)(Dependencies...)) {
55  m_cookBook.addPrimaryFactory(factory);
56  return *this;
57 }
58 
59 template <typename... Parameters>
60 template <typename Type, typename... Dependencies>
62  Parameters...>::addRequiredFactory(std::function<Type(Dependencies...)> factory) {
63  m_cookBook.addRequiredFactory(factory);
64  return *this;
65 }
66 
67 template <typename... Parameters>
68 template <typename Type, typename... Dependencies>
70  Parameters...>::addRequiredFactory(Type (*factory)(Dependencies...)) {
71  m_cookBook.addRequiredFactory(factory);
72  return *this;
73 }
74 
75 template <typename... Parameters>
76 template <typename Type, typename... Dependencies>
78  Parameters...>::addRetainedFactory(std::function<Type(Dependencies...)> factory) {
79  m_cookBook.addRetainedFactory(factory);
80  return *this;
81 }
82 
83 template <typename... Parameters>
84 template <typename Type, typename... Dependencies>
86  Parameters...>::addRetainedFactory(Type (*factory)(Dependencies...)) {
87  m_cookBook.addRetainedFactory(factory);
88  return *this;
89 }
90 
91 template <typename... Parameters>
92 template <typename Type, typename... Dependencies>
94  Parameters...>::addUnloadableFactory(std::function<Type(Dependencies...)> factory) {
95  m_cookBook.addUnloadableFactory(factory);
96  return *this;
97 }
98 
99 template <typename... Parameters>
100 template <typename Type, typename... Dependencies>
102  Parameters...>::addUnloadableFactory(Type (*factory)(Dependencies...)) {
103  m_cookBook.addUnloadableFactory(factory);
104  return *this;
105 }
106 
107 template <typename... Parameters>
108 template <typename Type>
110  m_cookBook.addInstance(instance);
111  return *this;
112 }
113 
114 template <typename... Parameters>
115 template <typename Type>
117  Parameters...>::makeImportOptional() {
118  return *this;
119 }
120 
121 template <typename... Parameters>
122 template <typename... SubComponentParameters>
123 inline ComponentAccumulator<SubComponentParameters..., Parameters...> ComponentAccumulator<Parameters...>::addComponent(
124  const Component<SubComponentParameters...>& component) {
125  m_cookBook.addCookBook(component.getCookBook());
126  return *this;
127 }
128 
129 template <typename... Parameters>
131  return m_cookBook;
132 }
133 
134 } // namespace acsdkManufactory
135 } // namespace alexaClientSDK
136 
137 #endif // ACSDKMANUFACTORY_INTERNAL_COMPONENTACCUMULATOR_IMP_H_
CookBook & addPrimaryFactory(std::function< std::shared_ptr< Type >(Dependencies...)> factory)
Definition: CookBook_imp.h:93
ComponentAccumulator< internal::MakeOptional< Type >, Parameters... > makeImportOptional()
Definition: ComponentAccumulator_imp.h:117
ComponentAccumulator< Import< internal::RemoveCvref_t< Dependencies > >..., Type, Parameters... > addUnloadableFactory(std::function< Type(Dependencies...)> factory)
Definition: ComponentAccumulator_imp.h:94
CookBook & addRetainedFactory(std::function< std::shared_ptr< Type >(Dependencies...)> factory)
Definition: CookBook_imp.h:325
ComponentAccumulator()
Definition: ComponentAccumulator_imp.h:26
CookBook & addUnloadableFactory(std::function< std::shared_ptr< Type >(Dependencies...)> factory)
Definition: CookBook_imp.h:429
CookBook & addUniqueFactory(std::function< std::unique_ptr< Type >(Dependencies...)> factory)
Definition: CookBook_imp.h:41
CookBook & addCookBook(const CookBook &cookBook)
Definition: CookBook_imp.h:582
ComponentAccumulator< Import< internal::RemoveCvref_t< Dependencies > >..., Type, Parameters... > addRequiredFactory(std::function< Type(Dependencies...)> factory)
Definition: ComponentAccumulator_imp.h:62
ComponentAccumulator< Import< internal::RemoveCvref_t< Dependencies > >..., Type, Parameters... > addPrimaryFactory(std::function< Type(Dependencies...)> factory)
Definition: ComponentAccumulator_imp.h:46
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
ComponentAccumulator< Import< internal::RemoveCvref_t< Dependencies > >..., Type, Parameters... > addRetainedFactory(std::function< Type(Dependencies...)> factory)
Definition: ComponentAccumulator_imp.h:78
CookBook & addRequiredFactory(std::function< std::shared_ptr< Type >(Dependencies...)> factory)
Definition: CookBook_imp.h:209
ComponentAccumulator< Type, Parameters... > addInstance(Type instance)
Definition: ComponentAccumulator_imp.h:109
CookBook & addInstance(const Type &instance)
Definition: CookBook_imp.h:533
ComponentAccumulator< SubComponentParameters..., Parameters... > addComponent(const Component< SubComponentParameters... > &component)
Definition: ComponentAccumulator_imp.h:123
ComponentAccumulator< Import< internal::RemoveCvref_t< Dependencies > >..., Type, Parameters... > addUniqueFactory(Type(*factory)(Dependencies...))
Definition: ComponentAccumulator_imp.h:38

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0