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

Public Member Functions

bool createDatabase () override
 
bool open () override
 
void close () override
 
bool store (const std::string &message, int *id) override
 
bool store (const std::string &message, const std::string &uriPathExtension, int *id) override
 
bool load (std::queue< StoredMessage > *messageContainer) override
 
bool erase (int messageId) override
 
bool clearDatabase () override
 
- Public Member Functions inherited from alexaClientSDK::certifiedSender::MessageStorageInterface
virtual ~MessageStorageInterface ()=default
 

Detailed Description

Test MessageStorageInterface implementation to provide a valid instance for the initialization of other components.

Member Function Documentation

◆ clearDatabase()

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::clearDatabase ( )
inlineoverridevirtual

A utility function to clear the database of all records. Note that the database will still exist, as will the tables. Only the rows will be erased.

Returns
Whether the database was successfully cleared.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ close()

void alexaClientSDK::acsdkAlerts::test::StubMessageStorage::close ( )
inlineoverridevirtual

Close the currently open database, if one is open.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ createDatabase()

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::createDatabase ( )
inlineoverridevirtual

Creates a new database with the given filePath. If a database is already being handled by this object, or there is are other errors creating the database, 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 an internal error creating the database.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ erase()

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::erase ( int  messageId)
inlineoverridevirtual

Erases a single message from the database.

Parameters
messageIdThe id of the message to be erased.
Returns
Whether the message was successfully erased.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ load()

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::load ( std::queue< StoredMessage > *  messageContainer)
inlineoverridevirtual

Loads all messages in the database.

Parameters
[out]messageContainerThe container where messages should be stored.
Returns
Whether the StoredMessages were successfully loaded.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ open()

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::open ( )
inlineoverridevirtual

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::certifiedSender::MessageStorageInterface.

◆ store() [1/2]

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::store ( const std::string &  message,
int *  id 
)
inlineoverridevirtual

Stores a single message in the database.

Parameters
Themessage to store.
[out]idThe id associated with the stored messsage, if successfully stored.
Returns
Whether the message was successfully stored.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.

◆ store() [2/2]

bool alexaClientSDK::acsdkAlerts::test::StubMessageStorage::store ( const std::string &  message,
const std::string &  uriPathExtension,
int *  id 
)
inlineoverridevirtual

Stores a single message and its uri in the database.

Parameters
Themessage to store.
uriPathExtensionpath extension which will be appended to the base url of the AVS when sending the event.
[out]idThe id associated with the stored messsage, if successfully stored.
Returns
Whether the message was successfully stored.

Implements alexaClientSDK::certifiedSender::MessageStorageInterface.


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

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