AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
ComponentAccumulator.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_COMPONENTACCUMULATOR_H_
17 #define ACSDKMANUFACTORY_COMPONENTACCUMULATOR_H_
18 
19 #include <memory>
20 
26 
27 namespace alexaClientSDK {
28 namespace acsdkManufactory {
29 
37 template <typename... Parameters>
38 class ComponentAccumulator {
39 public:
44 
51  template <typename... RhsParameters>
52  ComponentAccumulator(const ComponentAccumulator<RhsParameters...>& componentAccumulator);
53 
62  template <typename Type, typename... Dependencies>
63  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addUniqueFactory(
64  Type (*factory)(Dependencies...));
65 
75  template <typename Type, typename... Dependencies>
76  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addPrimaryFactory(
77  std::function<Type(Dependencies...)> factory);
78 
88  template <typename Type, typename... Dependencies>
89  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addPrimaryFactory(
90  Type (*factory)(Dependencies...));
91 
101  template <typename Type, typename... Dependencies>
102  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addRequiredFactory(
103  std::function<Type(Dependencies...)> factory);
104 
114  template <typename Type, typename... Dependencies>
115  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addRequiredFactory(
116  Type (*factory)(Dependencies...));
117 
127  template <typename Type, typename... Dependencies>
128  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addRetainedFactory(
129  std::function<Type(Dependencies...)> factory);
130 
140  template <typename Type, typename... Dependencies>
141  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addRetainedFactory(
142  Type (*factory)(Dependencies...));
143 
153  template <typename Type, typename... Dependencies>
154  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addUnloadableFactory(
155  std::function<Type(Dependencies...)> factory);
156 
166  template <typename Type, typename... Dependencies>
167  ComponentAccumulator<Import<internal::RemoveCvref_t<Dependencies>>..., Type, Parameters...> addUnloadableFactory(
168  Type (*factory)(Dependencies...));
169 
177  template <typename Type>
178  ComponentAccumulator<Type, Parameters...> addInstance(Type instance);
179 
186  template <typename Type>
187  ComponentAccumulator<internal::MakeOptional<Type>, Parameters...> makeImportOptional();
188 
197  template <typename... SubComponentParameters>
198  ComponentAccumulator<SubComponentParameters..., Parameters...> addComponent(
199  const Component<SubComponentParameters...>& component);
200 
201 private:
202  // Provide Component access to getCookBook().
203  template <typename...>
204  friend class Component;
205 
206  // Provide ComponentAccumulator access to getCookBook().
207  template <typename...>
208  friend class ComponentAccumulator;
209 
215  internal::CookBook getCookBook() const;
216 
218  internal::CookBook m_cookBook;
219 };
220 
221 } // namespace acsdkManufactory
222 } // namespace alexaClientSDK
223 
225 
226 #endif // ACSDKMANUFACTORY_COMPONENTACCUMULATOR_H_
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
ComponentAccumulator()
Definition: ComponentAccumulator_imp.h:26
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
friend class Component
Definition: ComponentAccumulator.h:204
ComponentAccumulator< Type, Parameters... > addInstance(Type instance)
Definition: ComponentAccumulator_imp.h:109
friend class ComponentAccumulator
Definition: ComponentAccumulator.h:208
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