AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage Class Reference
Inheritance diagram for alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage:
Collaboration graph
[legend]

Public Member Functions

bool createDatabase () override
 
bool open () override
 
void close () override
 
bool enqueue (const NotificationIndicator &notificationIndicator) override
 
bool dequeue () override
 
bool peek (NotificationIndicator *notificationIndicator) override
 
bool setIndicatorState (IndicatorState state) override
 
bool getIndicatorState (IndicatorState *state) override
 
bool checkForEmptyQueue (bool *empty) override
 
bool clearNotificationIndicators () override
 
bool getQueueSize (int *size) override
 
bool waitForQueueSizeToBe (size_t size, std::chrono::milliseconds timeout=MY_WAIT_TIMEOUT)
 
- Public Member Functions inherited from alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface
virtual ~NotificationsStorageInterface ()=default
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface
using IndicatorState = avsCommon::avs::IndicatorState
 Some useful shorthand. More...
 

Detailed Description

A test class that acts as NotificationsStorage. This storage is implemented using a std::queue.

Member Function Documentation

◆ checkForEmptyQueue()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::checkForEmptyQueue ( bool *  empty)
overridevirtual

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.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ clearNotificationIndicators()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::clearNotificationIndicators ( )
overridevirtual

Clears the database of all NotificationIndicators.

Returns
Whether the clear operation was successful.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ close()

void alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::close ( )
overridevirtual

Close the currently open database, if one is open.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ createDatabase()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::createDatabase ( )
overridevirtual

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.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ dequeue()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::dequeue ( )
overridevirtual

Dequeues the next NotificationIndicator in the database.

Returns
Whether the dequeue operation was successful.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ enqueue()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::enqueue ( const NotificationIndicator notificationIndicator)
overridevirtual

Enqueues a single NotificationIndicator in the database.

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

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ getIndicatorState()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::getIndicatorState ( IndicatorState state)
overridevirtual

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.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ getQueueSize()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::getQueueSize ( int *  size)
overridevirtual

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.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ open()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::open ( )
overridevirtual

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.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ peek()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::peek ( NotificationIndicator notificationIndicator)
overridevirtual

Peeks at the next NotificationIndicator in the database.

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

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ setIndicatorState()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::setIndicatorState ( IndicatorState  state)
overridevirtual

Stores the current IndicatorState.

Returns
Whether the store operation was successful.

Implements alexaClientSDK::acsdkNotificationsInterfaces::NotificationsStorageInterface.

◆ waitForQueueSizeToBe()

bool alexaClientSDK::acsdkNotifications::test::TestNotificationsStorage::waitForQueueSizeToBe ( size_t  size,
std::chrono::milliseconds  timeout = MY_WAIT_TIMEOUT 
)

Waits until the queue is a particular size.

Parameters
sizeThe size to wait for.
timeoutHow much time to wait before failing.

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

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