AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DeviceControlledSettingProtocol.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_SETTINGS_INCLUDE_SETTINGS_DEVICECONTROLLEDSETTINGPROTOCOL_H_
17 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_DEVICECONTROLLEDSETTINGPROTOCOL_H_
18 
19 #include <memory>
20 
24 
31 
32 namespace alexaClientSDK {
33 namespace settings {
34 
39 public:
50  static std::unique_ptr<DeviceControlledSettingProtocol> create(
51  const SettingEventMetadata& metadata,
52  std::shared_ptr<SettingEventSenderInterface> eventSender,
53  std::shared_ptr<storage::DeviceSettingStorageInterface> settingStorage,
54  std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface> connectionManager,
55  const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>& metricRecorder);
56 
60  ApplyChangeFunction applyChange,
61  RevertChangeFunction revertChange,
62  SettingNotificationFunction notifyObservers) override;
63 
64  bool avsChange(
65  ApplyChangeFunction applyChange,
66  RevertChangeFunction revertChange,
67  SettingNotificationFunction notifyObservers) override;
68 
69  bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers) override;
70 
71  bool clearData() override;
73 
78 
79 private:
85  DeviceControlledSettingProtocol(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_DEVICECONTROLLEDSETTINGPROTOCOL_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
std::function< void(SettingNotifications notification)> SettingNotificationFunction
Definition: SettingProtocolInterface.h:63
Definition: DeviceControlledSettingProtocol.h:38
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
bool avsChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers) override
bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers) override
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: SettingProtocolInterface.h:38
SetSettingResult localChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers) override
static std::unique_ptr< DeviceControlledSettingProtocol > 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)

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