AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CloudControlledSettingProtocol.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 #include <memory>
17 
20 
27 
28 #ifndef ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_CLOUDCONTROLLEDSETTINGPROTOCOL_H_
29 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_CLOUDCONTROLLEDSETTINGPROTOCOL_H_
30 
31 namespace alexaClientSDK {
32 namespace settings {
33 
38 public:
49  static std::unique_ptr<CloudControlledSettingProtocol> create(
50  const SettingEventMetadata& metadata,
51  std::shared_ptr<SettingEventSenderInterface> eventSender,
52  std::shared_ptr<storage::DeviceSettingStorageInterface> settingStorage,
53  std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface> connectionManager,
54  const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>& metricRecorder);
55 
60 
64  ApplyChangeFunction applyChange,
65  RevertChangeFunction revertChange,
66  SettingNotificationFunction notifyObservers) override;
67 
68  bool avsChange(
69  ApplyChangeFunction applyChange,
70  RevertChangeFunction revertChange,
71  SettingNotificationFunction notifyObservers) override;
72 
73  bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers) override;
74 
75  bool clearData() override;
77 
78 private:
85  CloudControlledSettingProtocol(std::unique_ptr<SharedAVSSettingProtocol> sharedProtocol);
86 
88  std::unique_ptr<SharedAVSSettingProtocol> m_protocolImpl;
89 };
90 
91 } // namespace settings
92 } // namespace alexaClientSDK
93 
94 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_CLOUDCONTROLLEDSETTINGPROTOCOL_H_
std::function< std::pair< bool, std::string >()> ApplyChangeFunction
Definition: SettingProtocolInterface.h:46
std::function< std::pair< bool, std::string >(const std::string &dbValue)> ApplyDbChangeFunction
Definition: SettingProtocolInterface.h:56
Definition: SettingEventMetadata.h:27
bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers) override
bool avsChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers) override
static std::unique_ptr< CloudControlledSettingProtocol > create(const SettingEventMetadata &metadata, std::shared_ptr< SettingEventSenderInterface > eventSender, std::shared_ptr< storage::DeviceSettingStorageInterface > settingStorage, std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > connectionManager, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder)
std::function< void(SettingNotifications notification)> SettingNotificationFunction
Definition: SettingProtocolInterface.h:63
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
std::function< std::string()> RevertChangeFunction
Definition: SettingProtocolInterface.h:70
SetSettingResult
Definition: SetSettingResult.h:23
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: CloudControlledSettingProtocol.h:37
Definition: SettingProtocolInterface.h:38
SetSettingResult localChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers) override

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