AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
List of all members
alexaClientSDK::propertiesInterfaces::test::StubProperties Class Reference

In-memory stub implementation of PropertiesInterface. More...

#include <StubProperties.h>

Inheritance diagram for alexaClientSDK::propertiesInterfaces::test::StubProperties:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::propertiesInterfaces::test::StubProperties:
Collaboration graph
[legend]

Public Member Functions

PropertiesFactoryInterface functions.
bool getString (const std::string &key, std::string &value) noexcept override
 Method to load string value from configuration. More...
 
bool putString (const std::string &key, const std::string &value) noexcept override
 Method to store string value into configuration. More...
 
bool getBytes (const std::string &key, Bytes &value) noexcept override
 Method to load binary value from configuration. More...
 
bool putBytes (const std::string &key, const Bytes &value) noexcept override
 Method to store binary value into configuration. More...
 
bool getKeys (std::unordered_set< std::string > &keys) noexcept override
 Method to inspect existing properties. More...
 
bool remove (const std::string &key) noexcept override
 Removes a property with a given name. More...
 
bool clear () noexcept override
 Removes all properties from a configuration container. More...
 
- Public Member Functions inherited from alexaClientSDK::propertiesInterfaces::PropertiesInterface
virtual ~PropertiesInterface () noexcept=default
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::propertiesInterfaces::PropertiesInterface
typedef std::vector< unsigned char > Bytes
 Bytes data type. This data type represent a continuous byte array. More...
 

Detailed Description

In-memory stub implementation of PropertiesInterface.

This class provides in-memory implementation of PropertiesInterface. Users can create instances of this class by using StubPropertiesFactory.

See also
StubPropertiesFactory.

Member Function Documentation

◆ clear()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::clear ( )
overridevirtualnoexcept

Removes all properties from a configuration container.

This method removes all properties from a configuration container.

Returns
True if the container has been cleared. In case of error, false is returned, and the contents of container is undefined.

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ getBytes()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::getBytes ( const std::string &  key,
Bytes value 
)
overridevirtualnoexcept

Method to load binary value from configuration.

This method loads binary value from configuration. If the value in the storage is not binary data, the method behaviour is undefined.

Parameters
[in]keyConfiguration key.
[out]valueIf the method completes successfully, value will contain loaded value. Otherwise contents of value is unmodified.
Returns
True if value has been loaded, false otherwise.
See also
putBytes

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ getKeys()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::getKeys ( std::unordered_set< std::string > &  keys)
overridevirtualnoexcept

Method to inspect existing properties.

This method provides a set of known property keys from a configuration container.

Parameters
[out]keysContainer for property keys. If method completes successfully, keys will contain all property names. On error, the contents of keys is undefined.
Returns
True if operation succeeds, false otherwise.

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ getString()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::getString ( const std::string &  key,
std::string &  value 
)
overridevirtualnoexcept

Method to load string value from configuration.

This method loads string value from configuration. If the value in the storage is not a string, the method behaviour is undefined.

Parameters
[in]keyConfiguration key.
[out]valueResult container. If the method completes successfully, value will contain loaded value. Otherwise contents of value is unmodified.
Returns
True if value has been loaded, false otherwise.
See also
putString

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ putBytes()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::putBytes ( const std::string &  key,
const Bytes value 
)
overridevirtualnoexcept

Method to store binary value into configuration.

This method stores binary value into configuration. If there is an existing value for the the same key, the value is overwritten.

If operation fails, the implementation shall make a best effort for either keeping value unmodified, or clear it to prevent data corruption. Other properties shall not be impacted in case of an error.

Parameters
[in]keyConfiguration key.
[in]valueValue to store.
Returns
True if value has been stored, false otherwise. If this method returns false, the value may stay unchanged, or lost.
See also
getBytes

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ putString()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::putString ( const std::string &  key,
const std::string &  value 
)
overridevirtualnoexcept

Method to store string value into configuration.

This method stores string value into configuration. If there is an existing value for the the same key, the value is overwritten.

If operation fails, the implementation shall make a best effort for either keeping value unmodified, or clear it to prevent data corruption. Other properties shall not be impacted in case of an error.

Parameters
[in]keyConfiguration key.
[in]valueValue to store.
Returns
True if value has been stored, false otherwise. If this method returns false, the value may stay unchanged, or lost.
See also
getString

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.

◆ remove()

bool alexaClientSDK::propertiesInterfaces::test::StubProperties::remove ( const std::string &  key)
overridevirtualnoexcept

Removes a property with a given name.

This method removes a property with a given name from a configuration container. If the property doesn't exist, the method succeeds.

Parameters
[in]keyConfiguration key to remove.
Returns
True if the key has been removed or didn't exist. In case of error, false is returned and the state of configuration container is undefined.

Implements alexaClientSDK::propertiesInterfaces::PropertiesInterface.


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