AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Types | Public Member Functions | List of all members
alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface Class Referenceabstract

#include <InputControllerInterface.h>

Inheritance diagram for alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface:
Inheritance graph
[legend]

Classes

struct  Response
 

Public Types

using SupportedInputs = std::vector< std::pair< Input, std::unordered_set< std::string > >>
 

Public Member Functions

virtual ~InputControllerInterface ()=default
 
virtual SupportedInputs getSupportedInputs ()=0
 
virtual Response setInput (Input input)=0
 
virtual Input getInput ()=0
 
virtual bool addObserver (std::weak_ptr< InputControllerObserverInterface > observer)=0
 
virtual void removeObserver (std::weak_ptr< InputControllerObserverInterface > observer)=0
 

Detailed Description

An interface to handle input changes from InputController.

Note
Implementations of this interface must be thread-safe.

Member Typedef Documentation

◆ SupportedInputs

using alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::SupportedInputs = std::vector<std::pair<Input, std::unordered_set<std::string> >>

A set of pairs to specify the supported inputs of the device. The first element of a pair is the Input type, and the second element is the set of friendly names for that input.

Note
Each friendly name must be unique across inputs for this device

Constructor & Destructor Documentation

◆ ~InputControllerInterface()

virtual alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::~InputControllerInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addObserver()

virtual bool alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::addObserver ( std::weak_ptr< InputControllerObserverInterface observer)
pure virtual

Adds a InputControllerObserverInterface observer.

Note
If InputController implementation has configured its instance's property as proactively reported, then it is required to notify observers of InputControllerObserverInterface for any change in its property state. This includes notifying the value when the device starts, if it is different from the last reported value.
Parameters
observerThe pointer to the InputControllerObserverInterface.
Returns
true if the object supports observer notification and observer was successfully added; otherwise, return false

Implemented in alexaClientSDK::alexaInputController::test::MockHandler.

◆ getInput()

virtual Input alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::getInput ( )
pure virtual

◆ getSupportedInputs()

virtual SupportedInputs alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::getSupportedInputs ( )
pure virtual

◆ removeObserver()

virtual void alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::removeObserver ( std::weak_ptr< InputControllerObserverInterface observer)
pure virtual

Removes a observer of InputControllerObserverInterface.

Parameters
observerThe pointer to the InputControllerObserverInterface.

Implemented in alexaClientSDK::alexaInputController::test::MockHandler.

◆ setInput()

virtual Response alexaClientSDK::alexaInputControllerInterfaces::InputControllerInterface::setInput ( Input  input)
pure virtual

Set the input.

Parameters
inputThe desired input of the endpoint, which is one of those that is available from the device.
Returns
whether the input was successfully set, or if an error was encountered in the process. InputControllerInterface::Response.type should return SUCCESS if no errors were encountered. Otherwise, InputControllerInterface::Response.type should contain the corresponding error code along with a log message in InputControllerInterface::Response.errorMessage.

Implemented in alexaClientSDK::alexaInputController::test::MockHandler, and alexaClientSDK::sampleApplications::common::EndpointInputControllerHandler.


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