AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Types | Public Member Functions | List of all members
alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface Class Referenceabstract

#include <NotificationsStorageInterface.h>

Inheritance diagram for alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface:
Inheritance graph
[legend]

Public Types

using IndicatorState = avsCommon::avs::IndicatorState
 Some useful shorthand. More...
 

Public Member Functions

virtual ~NotificationsStorageInterface ()=default
 
virtual bool createDatabase ()=0
 
virtual bool open ()=0
 
virtual void close ()=0
 
virtual bool enqueue (const acsdkNotifications::NotificationIndicator &notificationIndicator)=0
 
virtual bool dequeue ()=0
 
virtual bool peek (acsdkNotifications::NotificationIndicator *notificationIndicator)=0
 
virtual bool setIndicatorState (IndicatorState state)=0
 
virtual bool getIndicatorState (IndicatorState *state)=0
 
virtual bool checkForEmptyQueue (bool *empty)=0
 
virtual bool clearNotificationIndicators ()=0
 
virtual bool getQueueSize (int *size)=0
 

Detailed Description

This class implements an interface for interacting with a Notifications database.

Users should be notified of their pending notifications in the order that SetIndicator directives are received. NotificationIndicators are therefore stored in a queue and should be persisted across system shutdown.

This storage is also responsible for maintaining IndicatorState as defined in IndicatorState.h.

Member Typedef Documentation

◆ IndicatorState

Some useful shorthand.

Constructor & Destructor Documentation

◆ ~NotificationsStorageInterface()

virtual alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::~NotificationsStorageInterface ( )
virtualdefault

Member Function Documentation

◆ checkForEmptyQueue()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::checkForEmptyQueue ( bool *  empty)
pure virtual

Checks if there are any NotificationIndicator records in the database.

Parameters
[out]emptyWhether there were any records in the database.
Returns
Whether the operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ clearNotificationIndicators()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::clearNotificationIndicators ( )
pure virtual

Clears the database of all NotificationIndicators.

Returns
Whether the clear operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ close()

virtual void alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::close ( )
pure virtual

◆ createDatabase()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::createDatabase ( )
pure virtual

Creates a new database. If a database is already being handled by this object or there is another internal error, then this function returns false.

Returns
true If the database is created ok, or false if a database is already being handled by this object or there is a problem creating the database.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ dequeue()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::dequeue ( )
pure virtual

Dequeues the next NotificationIndicator in the database.

Returns
Whether the dequeue operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ enqueue()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::enqueue ( const acsdkNotifications::NotificationIndicator notificationIndicator)
pure virtual

Enqueues a single NotificationIndicator in the database.

Parameters
notificationIndicatorThe NotificationIndicator to enqueue.
Returns
Whether the NotificationIndicator was successfully enqueued.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ getIndicatorState()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::getIndicatorState ( IndicatorState state)
pure virtual

Retrieves the currently stored IndicatorState.

Parameters
[out]stateA pointer to receive the currently stored IndicatorState
Returns
Whether the get operation was successful.
Note
The default IndicatorState for a new database is IndicatorState::OFF.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ getQueueSize()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::getQueueSize ( int *  size)
pure virtual

Gets the size of the queue (number of records in the queue table).

Parameters
[out]sizeA pointer to receive the calculated size.
Returns
Whether the size operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ open()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::open ( )
pure virtual

Open an existing database. If this object is already managing an open database, or there is a problem opening the database, this function returns false.

Returns
true If the database is opened ok, false if this object is already managing an open database, or if there is another internal reason the database could not be opened.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ peek()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::peek ( acsdkNotifications::NotificationIndicator notificationIndicator)
pure virtual

Peeks at the next NotificationIndicator in the database.

Parameters
[out]notificationIndicatorA pointer to receive the peeked NotificationIndicator
Returns
Whether the peek operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.

◆ setIndicatorState()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface::setIndicatorState ( IndicatorState  state)
pure virtual

Stores the current IndicatorState.

Returns
Whether the store operation was successful.

Implemented in alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage, and alexaClientSDK::acsdkNotifications::SQLiteNotificationsStorage.


The documentation for this class was generated from the following file:

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