AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SQLiteNotificationsStorage.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 ACSDKNOTIFICATIONS_SQLITENOTIFICATIONSSTORAGE_H_
17 #define ACSDKNOTIFICATIONS_SQLITENOTIFICATIONSSTORAGE_H_
18 
20 
21 #include <mutex>
22 
25 
26 namespace alexaClientSDK {
27 namespace acsdkNotifications {
28 
35 public:
42  static std::shared_ptr<acsdkNotificationsInterfaces::NotificationsStorageInterface>
44  const std::shared_ptr<avsCommon::utils::configuration::ConfigurationNode>& configurationRoot);
45 
53  static std::unique_ptr<SQLiteNotificationsStorage> create(
55 
61  SQLiteNotificationsStorage(const std::string& databaseFilePath);
62 
64 
65  bool createDatabase() override;
66 
67  bool open() override;
68 
69  void close() override;
70 
71  bool enqueue(const NotificationIndicator& notificationIndicator) override;
72 
73  bool dequeue() override;
74 
75  bool peek(NotificationIndicator* notificationIndicator) override;
76 
77  bool setIndicatorState(IndicatorState state) override;
78 
79  bool getIndicatorState(IndicatorState* state) override;
80 
81  bool checkForEmptyQueue(bool* empty) override;
82 
83  bool clearNotificationIndicators() override;
84 
85  bool getQueueSize(int* size) override;
86 
87 private:
95  bool getNextNotificationIndicatorLocked(NotificationIndicator* notificationIndicator);
96 
102  bool createNotificationIndicatorsTable();
103 
109  bool createIndicatorStateTable();
110 
112  std::mutex m_databaseMutex;
113 
116 };
117 
118 } // namespace acsdkNotifications
119 } // namespace alexaClientSDK
120 
121 #endif // ACSDKNOTIFICATIONS_SQLITENOTIFICATIONSSTORAGE_H_
::std::string string
Definition: gtest-port.h:1097
bool enqueue(const NotificationIndicator &notificationIndicator) override
Definition: SQLiteNotificationsStorage.h:34
bool peek(NotificationIndicator *notificationIndicator) override
static std::unique_ptr< SQLiteNotificationsStorage > create(const avsCommon::utils::configuration::ConfigurationNode &configurationRoot)
SQLiteNotificationsStorage(const std::string &databaseFilePath)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
IndicatorState
Definition: IndicatorState.h:30
static std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > createNotificationsStorageInterface(const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot)
bool getIndicatorState(IndicatorState *state) override
Definition: NotificationIndicator.h:29

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