AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MiscStorageInterface.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_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_STORAGE_MISCSTORAGEINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_STORAGE_MISCSTORAGEINTERFACE_H_
18 
19 #include <string>
20 #include <unordered_map>
21 
22 namespace alexaClientSDK {
23 namespace avsCommon {
24 namespace sdkInterfaces {
25 namespace storage {
26 
34 public:
36  enum class KeyType {
41  };
42 
44  enum class ValueType {
46  UNKNOWN_VALUE,
48  STRING_VALUE
49  };
50 
54  virtual ~MiscStorageInterface() = default;
55 
64  virtual bool createDatabase() = 0;
65 
73  virtual bool open() = 0;
74 
80  virtual bool isOpened() = 0;
81 
85  virtual void close() = 0;
86 
97  virtual bool createTable(
99  const std::string& tableName,
100  KeyType keyType,
101  ValueType valueType) = 0;
102 
110  virtual bool clearTable(const std::string& componentName, const std::string& tableName) = 0;
111 
120  virtual bool deleteTable(const std::string& componentName, const std::string& tableName) = 0;
121 
131  virtual bool get(
132  const std::string& componentName,
133  const std::string& tableName,
134  const std::string& key,
135  std::string* value) = 0;
136 
147  virtual bool add(
148  const std::string& componentName,
149  const std::string& tableName,
150  const std::string& key,
151  const std::string& value) = 0;
152 
162  virtual bool update(
163  const std::string& componentName,
164  const std::string& tableName,
165  const std::string& key,
166  const std::string& value) = 0;
167 
180  virtual bool put(
181  const std::string& componentName,
182  const std::string& tableName,
183  const std::string& key,
184  const std::string& value) = 0;
185 
194  virtual bool remove(const std::string& componentName, const std::string& tableName, const std::string& key) = 0;
195 
205  virtual bool tableEntryExists(
206  const std::string& componentName,
207  const std::string& tableName,
208  const std::string& key,
209  bool* tableEntryExistsValue) = 0;
210 
219  virtual bool tableExists(
220  const std::string& componentName,
221  const std::string& tableName,
222  bool* tableExistsValue) = 0;
223 
232  virtual bool load(
233  const std::string& componentName,
234  const std::string& tableName,
235  std::unordered_map<std::string, std::string>* valueContainer) = 0;
236 };
237 
238 } // namespace storage
239 } // namespace sdkInterfaces
240 } // namespace avsCommon
241 } // namespace alexaClientSDK
242 
243 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_STORAGE_MISCSTORAGEINTERFACE_H_
ValueType
The type of the value column in Misc DB.
Definition: MiscStorageInterface.h:44
::std::string string
Definition: gtest-port.h:1097
virtual bool load(const std::string &componentName, const std::string &tableName, std::unordered_map< std::string, std::string > *valueContainer)=0
virtual bool tableExists(const std::string &componentName, const std::string &tableName, bool *tableExistsValue)=0
virtual bool add(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
static const std::string tableName
Definition: SmartScreenCaptionStateManagerTest.cpp:30
KeyType
The type of the key column in Misc DB.
Definition: MiscStorageInterface.h:36
virtual bool deleteTable(const std::string &componentName, const std::string &tableName)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual bool createTable(const std::string &componentName, const std::string &tableName, KeyType keyType, ValueType valueType)=0
static const std::string componentName
Definition: SmartScreenCaptionStateManagerTest.cpp:29
virtual bool put(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
virtual bool tableEntryExists(const std::string &componentName, const std::string &tableName, const std::string &key, bool *tableEntryExistsValue)=0
virtual bool clearTable(const std::string &componentName, const std::string &tableName)=0
virtual bool update(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58

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