AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <CommunicationPropertiesHandlerInterface.h>
Public Member Functions | |
virtual | ~CommunicationPropertiesHandlerInterface ()=default |
virtual std::shared_ptr< CommunicationProperty< T > > | registerProperty (const std::string &propertyName, T initValue, const std::shared_ptr< CommunicationPropertyValidatorInterface< T >> &writeValidator=nullptr)=0 |
virtual void | deregisterProperty (const std::string &propertyName, const std::shared_ptr< CommunicationProperty< T >> &property)=0 |
virtual bool | writeProperty (const std::string &propertyName, T newValue)=0 |
virtual bool | readProperty (const std::string &propertyName, T &value)=0 |
virtual bool | subscribeToPropertyChangeEvent (const std::string &propertyName, const std::weak_ptr< CommunicationPropertyChangeSubscriber< T >> &subscriber)=0 |
virtual bool | unsubscribeToPropertyChangeEvent (const std::string &propertyName, const std::shared_ptr< CommunicationPropertyChangeSubscriber< T >> &subscriber)=0 |
The CommunicationPropertiesHandlerInterface is used to register, deregister, write property, read property, subscribe to property change events, and unsubscribe to change events. The implementation will allow multiple different components to have access to properties without have explict ownership. The CommunicationPropertiesHandlerInterface isn't responsible for property ownership.
|
virtualdefault |
Virtual destructor to assure proper cleanup of derived types.
|
pure virtual |
deregister the property, deregistration of the property only occurs when the property can be found and the passed in property matches the registered property.
name | Name of the property to deregister |
property | The property that we are deregistering. This is used to prove ownership of the property. the parameter can be a nullptr. |
|
pure virtual |
Read the value from a property.
name | Name of the property we are trying to read. | |
[out] | value | The reference where we will populate the read value. |
Implemented in alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< T >, alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< std::string >, and alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< int >.
|
pure virtual |
Register a new Property
name | The name of the new property |
initValue | The initial value that the property will have. |
writeValidator | The class that we will use to validate the write operation. If a nullptr the property will be read only. |
|
pure virtual |
Subscribe to change events for a specific property. No value will be passed back. The user should read the value of the property after subscribing.
propertyName | Name of property we want to subscribe to. |
subscriber | The subscriber that will define the action for on change event. |
|
pure virtual |
Unsubscribe to change events for a specific property.
propertyName | Name of property we want to unsubscribe from. |
subscriber | The subscriber that will be unsubscribed from the change events. |
|
pure virtual |
Write a new value to the property, this will be validated by the writeValidator.
name | The property that we are writing the newValue to. |
newValue | The new value for the property. |
Implemented in alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< T >, alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< std::string >, and alexaClientSDK::acsdkCommunication::InMemoryCommunicationPropertiesHandler< int >.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0