AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Component_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_COMPONENT_IMP_H_
17 #define ACSDKMANUFACTORY_INTERNAL_COMPONENT_IMP_H_
18 
21 
22 namespace alexaClientSDK {
23 namespace acsdkManufactory {
24 
25 template <typename... Parameters>
26 template <typename... ComponentAccumulatorParameters>
29  m_cookBook{componentAccumulator.getCookBook()} {
30  using AccumulatorTypes = typename internal::GetImportsAndExports<ComponentAccumulatorParameters...>::type;
31 
32  using ComponentTypes = typename internal::GetImportsAndExports<Parameters...>::type;
33 
34  // Check if any export is missing. If missing, assertion will fail and PrintMissingExport will print a compilation
35  // error with the name of the types missing.
36  using MissingExports =
38  static_assert(
39  std::tuple_size<MissingExports>() == 0, "One or more exports declared by this Component was not provided.");
41 
42  // Check if any required import that has not been satisfied is missing from the component declaration. If missing,
43  // the assertion below will fail and PrintMissingImport statement will print a compilation error with the name of
44  // the types missing.
45  using MissingRequiredImports =
47  static_assert(
48  std::tuple_size<MissingRequiredImports>() == 0,
49  "One or more required import wasn't declared by this Component.");
51 
52  // Check if any import that has not been satisfied is missing from the component declaration. If missing,
53  // the assertion below will fail and PrintMissingImport statement will print a compilation error with the name of
54  // the types missing.
55  using MissingOptionalImports =
57  static_assert(
58  std::tuple_size<MissingOptionalImports>() == 0,
59  "One or more optional import wasn't declared by this Component.");
61 }
62 
63 template <typename... Parameters>
64 inline internal::CookBook Component<Parameters...>::getCookBook() const {
65  return m_cookBook;
66 }
67 
68 } // namespace acsdkManufactory
69 } // namespace alexaClientSDK
70 
71 #endif // ACSDKMANUFACTORY_INTERNAL_COMPONENT_IMP_H_
alexaClientSDK::acsdkManufactory::ComponentAccumulator
Definition: Component.h:26
alexaClientSDK::acsdkManufactory::internal::PrintMissingImport
Definition: Utils.h:543
alexaClientSDK::acsdkManufactory::Component::Component
Component(ComponentAccumulator< ComponentAccumulatorParameters... > &&componentAccumulator)
Definition: Component_imp.h:27
alexaClientSDK::acsdkManufactory::internal::PrintMissingExport
Definition: Utils.h:519
Component.h
Utils.h
alexaClientSDK::acsdkManufactory::internal::RemoveTypes
Definition: Utils.h:327
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::acsdkManufactory::internal::GetImportsAndExports
Definition: Utils.h:358

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