AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Endpoint.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 ALEXA_CLIENT_SDK_ENDPOINTS_INCLUDE_ENDPOINTS_ENDPOINT_H_
17 #define ALEXA_CLIENT_SDK_ENDPOINTS_INCLUDE_ENDPOINTS_ENDPOINT_H_
18 
19 #include <list>
20 #include <mutex>
21 #include <set>
22 #include <unordered_map>
23 
30 
31 namespace alexaClientSDK {
32 namespace endpoints {
33 
38 public:
44 
50  Endpoint(const EndpointAttributes& attributes);
51 
55  ~Endpoint();
56 
59  EndpointIdentifier getEndpointId() const override;
60  EndpointAttributes getAttributes() const override;
61  std::vector<avsCommon::avs::CapabilityConfiguration> getCapabilityConfigurations() const override;
62  std::unordered_map<
64  std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface>>
65  getCapabilities() const override;
66  bool update(const std::shared_ptr<avsCommon::sdkInterfaces::endpoints::EndpointModificationData>&
67  endpointModificationData) override;
69 
77  bool addCapability(
78  const avsCommon::avs::CapabilityConfiguration& capabilityConfiguration,
79  std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> directiveHandler);
80 
87  bool removeCapability(const avsCommon::avs::CapabilityConfiguration& capabilityConfiguration);
88 
95  bool addCapabilityConfiguration(const avsCommon::avs::CapabilityConfiguration& capabilityConfiguration);
96 
103  bool validateEndpointAttributes(const EndpointAttributes& updatedAttributes);
104 
111  const std::list<std::shared_ptr<avsCommon::utils::RequiresShutdown>>& requireShutdownObjects);
112 
113 private:
115  mutable std::mutex m_mutex;
116 
118  EndpointAttributes m_attributes;
119 
121  std::unordered_map<
122  avsCommon::avs::CapabilityConfiguration,
123  std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface>>
124  m_capabilities;
125 
127  std::set<std::shared_ptr<avsCommon::utils::RequiresShutdown>> m_requireShutdownObjects;
128 };
129 
130 } // namespace endpoints
131 } // namespace alexaClientSDK
132 
133 #endif // ALEXA_CLIENT_SDK_ENDPOINTS_INCLUDE_ENDPOINTS_ENDPOINT_H_
Definition: Endpoint.h:37
EndpointIdentifier getEndpointId() const override
bool addCapability(const avsCommon::avs::CapabilityConfiguration &capabilityConfiguration, std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > directiveHandler)
bool validateEndpointAttributes(const EndpointAttributes &updatedAttributes)
Endpoint(const EndpointAttributes &attributes)
std::vector< avsCommon::avs::CapabilityConfiguration > getCapabilityConfigurations() const override
Definition: AVSDiscoveryEndpointAttributes.h:41
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool removeCapability(const avsCommon::avs::CapabilityConfiguration &capabilityConfiguration)
std::unordered_map< avsCommon::avs::CapabilityConfiguration, std::shared_ptr< avsCommon::sdkInterfaces::DirectiveHandlerInterface > > getCapabilities() const override
void addRequireShutdownObjects(const std::list< std::shared_ptr< avsCommon::utils::RequiresShutdown >> &requireShutdownObjects)
avsCommon::sdkInterfaces::endpoints::EndpointIdentifier EndpointIdentifier
Definition: Endpoint.h:41
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
Definition: CapabilityConfiguration.h:42
bool update(const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointModificationData > &endpointModificationData) override
EndpointAttributes getAttributes() const override
bool addCapabilityConfiguration(const avsCommon::avs::CapabilityConfiguration &capabilityConfiguration)

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