AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::acsdkProperties::MiscStorageProperties Class Reference

Properties for MiscStorageInterface. More...

#include <MiscStorageProperties.h>

Inheritance diagram for alexaClientSDK::acsdkProperties::MiscStorageProperties:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkProperties::MiscStorageProperties:
Collaboration graph
[legend]

Public Member Functions

PropertiesInterface methods
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 remove (const std::string &key) noexcept override
 Removes a property with a given name. More...
 
bool getKeys (std::unordered_set< std::string > &valueContainer) noexcept override
 Method to inspect existing properties. More...
 
bool clear () noexcept override
 Removes all properties from a configuration container. More...
 
- Public Member Functions inherited from alexaClientSDK::acsdkPropertiesInterfaces::PropertiesInterface
virtual ~PropertiesInterface () noexcept=default
 Destructor. More...
 

Static Public Member Functions

static std::shared_ptr< MiscStoragePropertiescreate (const std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::storage::MiscStorageInterface > &storage, const std::string &configUri, const std::string &componentName, const std::string &tableName)
 Factory method. More...
 

Additional Inherited Members

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

Detailed Description

Properties for MiscStorageInterface.

This class adapts MiscStorageInterface into PropertiesInterface.

This class is thread safe and can be shared between multiple consumers.

See also
alexaClientSDK::acsdkPropertiesInterfaces::PropertiesInterface
alexaClientSDK::avsCommon::sdkInterfaces::storage::MiscStorageInterface

Member Function Documentation

◆ clear()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ create()

std::shared_ptr< MiscStorageProperties > alexaClientSDK::acsdkProperties::MiscStorageProperties::create ( const std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::storage::MiscStorageInterface > &  storage,
const std::string &  configUri,
const std::string &  componentName,
const std::string &  tableName 
)
static

Factory method.

This method creates a new object instance to access configuration properties.

Parameters
storageInterface for data access.
configUriConfiguration URI.
componentNameComponent name for data access calls.
tableNameTable name for data access calls.
Returns
New object reference or nullptr on error.

◆ getBytes()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ getKeys()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ getString()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ putBytes()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ putString()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.

◆ remove()

bool alexaClientSDK::acsdkProperties::MiscStorageProperties::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::acsdkPropertiesInterfaces::PropertiesInterface.


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

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