AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T > Class Template Reference

#include <CommunicationProperty.h>

Public Member Functions

bool setValue (T newValue)
 
getValue ()
 
bool isWriteable ()
 
bool addSubscriber (const std::weak_ptr< CommunicationPropertyChangeSubscriber< T >> &subscriber)
 
void removeSubscriber (const std::shared_ptr< CommunicationPropertyChangeSubscriber< T >> &subscriber)
 

Static Public Member Functions

static std::shared_ptr< CommunicationProperty< T > > create (const std::string &name, T initValue, bool writeable)
 

Detailed Description

template<typename T>
class alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >

The CommunicationProperty is the class that will be returned when we register a new property with the CommunicationPropertiesHandlerInterface. This will hold a value of type T. This class allows the owner direct read and write access.

Member Function Documentation

◆ addSubscriber()

template<typename T>
bool alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::addSubscriber ( const std::weak_ptr< CommunicationPropertyChangeSubscriber< T >> &  subscriber)
inline

Add a subscriber to property change events.

Parameters
subscriberThe new subscriber that wants to listen to property change events.
Returns
true if subscriber is valid and was added, false otherwise.

◆ create()

template<typename T>
static std::shared_ptr<CommunicationProperty<T> > alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::create ( const std::string &  name,
initValue,
bool  writeable 
)
inlinestatic

Create a new Property

Parameters
nameName of the new property.
initValueThe initial value of the property
writeableIf the property is writeable or not.
Returns
shared_ptr to a new Property.

◆ getValue()

template<typename T>
T alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::getValue ( )
inline

Owner of the property can get the value of the property without going through the CommunicationPropertiesHandlerInterface

Returns
the value of the property

◆ isWriteable()

template<typename T>
bool alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::isWriteable ( )
inline

A function used to determine if the property is writeable or not.

Returns
true if writeable, false otherwise

◆ removeSubscriber()

template<typename T>
void alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::removeSubscriber ( const std::shared_ptr< CommunicationPropertyChangeSubscriber< T >> &  subscriber)
inline

Remove a subscriber from property change events.

Parameters
subscriberThe subscriber that doesn't want to listen to property change events.

◆ setValue()

template<typename T>
bool alexaClientSDK::acsdkCommunicationInterfaces::CommunicationProperty< T >::setValue ( newValue)
inline

setValue allows setting of the value without going through the CommunicationPropertiesHandlerInterface

Parameters
newValueThe newValue which we are setting the value to.
Returns
true if value was set, false otherwise.

Capturing a snapshot of this communication property and notifying the subscribers by submitting this to the executor.


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