AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SettingProtocolInterface.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_SETTINGPROTOCOLINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGPROTOCOLINTERFACE_H_
18 
19 #include <functional>
20 #include <memory>
21 #include <string>
22 #include <utility>
23 
25 
28 
29 namespace alexaClientSDK {
30 namespace settings {
31 
39 public:
46  using ApplyChangeFunction = std::function<std::pair<bool, std::string>()>;
47 
56  using ApplyDbChangeFunction = std::function<std::pair<bool, std::string>(const std::string& dbValue)>;
57 
63  using SettingNotificationFunction = std::function<void(SettingNotifications notification)>;
64 
70  using RevertChangeFunction = std::function<std::string()>;
71 
82  ApplyChangeFunction applyChange,
83  RevertChangeFunction revertChange,
84  SettingNotificationFunction notifyObservers) = 0;
85 
95  virtual bool avsChange(
96  ApplyChangeFunction applyChange,
97  RevertChangeFunction revertChange,
98  SettingNotificationFunction notifyObservers) = 0;
99 
108  virtual bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers) = 0;
109 
115  virtual bool clearData() = 0;
116 
120  virtual ~SettingProtocolInterface() = default;
121 };
122 
123 } // namespace settings
124 } // namespace alexaClientSDK
125 
126 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGPROTOCOLINTERFACE_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
::std::string string
Definition: gtest-port.h:1097
virtual bool restoreValue(ApplyDbChangeFunction applyChange, SettingNotificationFunction notifyObservers)=0
std::function< void(SettingNotifications notification)> SettingNotificationFunction
Definition: SettingProtocolInterface.h:63
virtual SetSettingResult localChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers)=0
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
virtual bool avsChange(ApplyChangeFunction applyChange, RevertChangeFunction revertChange, SettingNotificationFunction notifyObservers)=0

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